cancel
Showing results for 
Search instead for 
Did you mean: 

File upload in activiti

ajax
Champ in-the-making
Champ in-the-making
Hello All,

I tried to search a lot but not able to find out as to how can I add a HTML file upload element in my activiti process. Was able to add textarea using form type but not able to get exactly how can I add file upload element in process.

Kindly guide as to how to do that…

Thanks,
Ajax
9 REPLIES 9

jbarrez
Star Contributor
Star Contributor
Sorry, we haven't implemented that feature yet in Activiti.

ajax
Champ in-the-making
Champ in-the-making
So any way around to achieve the same. I mean how can I upload a attachment or document during process??

jbarrez
Star Contributor
Star Contributor
For the engine, an attachment or document is nothing more than a process variable.
What you need is mapping from the form property (file) to something the engine understands (process variable).

The explorer app is shipped with such a custom form property so you can start with that to learn how it can be done.

ajax
Champ in-the-making
Champ in-the-making
For the engine, an attachment or document is nothing more than a process variable.
What you need is mapping from the form property (file) to something the engine understands (process variable).

The explorer app is shipped with such a custom form property so you can start with that to learn how it can be done.

Thank you for your quick response…

With FormService I can surely get data but problems is how do I show such element which actually can provide a way to select files from system which can further be used from variable??

ajax
Champ in-the-making
Champ in-the-making
After looking into Book-Webapp-Explorer-App have seen a class FileAttachmentEditor is there but not able to find a form type associated with it. Is there a way to use the same in my process?

jbarrez
Star Contributor
Star Contributor
Yes indeed, FileAttachmentEditor is a good example of such a component.

Now what you need is a new form property type (eg file), that has a client side part (ie what is used in Vaadin for rendering) and one that has an Activiti side (ie form property -> process variable). I haven't done it myself, so it's only theory so far. Could very well be some API is blocking something. But unfortunately I currently don't have time to look into how it would fit.

ajax
Champ in-the-making
Champ in-the-making
Yes indeed, FileAttachmentEditor is a good example of such a component.

Now what you need is a new form property type (eg file), that has a client side part (ie what is used in Vaadin for rendering) and one that has an Activiti side (ie form property -> process variable). I haven't done it myself, so it's only theory so far. Could very well be some API is blocking something. But unfortunately I currently don't have time to look into how it would fit.

Ok, I tried to create the same but getting error saying "no editor or conversion strategy found to convert my field into activiti's form type" Smiley Sad

If you can spare a little time and if can guide/provide pointer to me at least what all one has to do to create a component then I will try to implement and would contribute once done. Would be good for others too.

Sorry to ask so much but I have to do it  :roll:

Thanks…

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Use a real ui framework… The ui of the explorer might fint your needs now with a few customizatios, but you'll getvstuck in the end

jbarrez
Star Contributor
Star Contributor
Ok, I tried to create the same but getting error saying "no editor or conversion strategy found to convert my field into activiti's form type"

This is because you need to define a form property converter on the engine too. See the webapp config:

  <!– Custom form property renderers can be plugged in here –>
  <bean id="formPropertyRendererManager" class="org.activiti.explorer.ui.form.FormPropertyRendererManager" lazy-init="true">
    <!– Default renderer –>
    <property name="noTypePropertyRenderer">
      <bean class="org.activiti.explorer.ui.form.StringFormPropertyRenderer" />
    </property>
    <!– Renderers by property type –>
    <property name="propertyRenderers">
      <list>
        <bean class="org.activiti.explorer.ui.form.StringFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.EnumFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.LongFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.DateFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.UserFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.BooleanFormPropertyRenderer" />
      </list>
    </property>
  </bean>

Sorry to ask so much but I have to do it

At the moment we're pretty busy with finishing up on the 5.12 release. But afterwards I might have time to look into it.

Use a real ui framework

That's just matter of opinion of course 😉

But I agree with you if you meant that the Explorer UI is for demo purposes only.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.