cancel
Showing results for 
Search instead for 
Did you mean: 

Forms for the user task

suoza
Champ in-the-making
Champ in-the-making
Hi,

I my process flow i want the form with a browse option where an user can upload documents and images of various types.

Can any one please suggest how this can be done using the forms in activiti and how the data / documents will be managed in the database.

4 REPLIES 4

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Suoza,

There are many option how to implement it. Some of them:
  • extend types used by activiti-explorer form renderer (example: org.activiti.explorer.ui.form.UserFormPropertyRenderer).
  • use related content as a task attachment in the explorer
Regards
Martin

suoza
Champ in-the-making
Champ in-the-making
Hi Martin,

Thanks for the reply.

Can you please share a small example for the same also how will this be configured in the process xml as part of form tags.

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

extend types used by activiti-explorer form renderer (example: org.activiti.explorer.ui.form.UserFormPropertyRenderer).

This example is a part of activiti-explorer source code.
(detailed description could be found in the activiti in action (10.4 Custom form types and external form rendering)

(/WEB-INF/activiti-ui-context.xml)

  <!– 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" />
        <bean class="org.activiti.explorer.ui.form.ProcessDefinitionFormPropertyRenderer" />
        <bean class="org.activiti.explorer.ui.form.MonthFormPropertyRenderer" />
      </list>
    </property>
  </bean>

(/WEB-INF/activiti-standalone-context.xml)

  <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
   <property name="dataSource" ref="dataSource" />
   <property name="transactionManager" ref="transactionManager" />
   <property name="databaseSchemaUpdate" value="true" />
   <property name="jobExecutorActivate" value="true" />
    <property name="customFormTypes">
      <list>
        <bean class="org.activiti.explorer.form.UserFormType"/>
        <bean class="org.activiti.explorer.form.ProcessDefinitionFormType"/>
        <bean class="org.activiti.explorer.form.MonthFormType"/>  
      </list>
    </property>
  </bean>

It shows how custom form types could be added to the activiti-explorer.


use related content as a task attachment in the explorer
Click on the task in the activiti-explorer.
On the user task form is  the section "Related content" click on the (+) button on the right.
You should be able do add link or file to the task.


Regards
Martin

pinmikaa
Champ in-the-making
Champ in-the-making
I committed a fix for this which should be in the next release. The Matching strategy throws a NPE when trying to match/open an editor that's not a BPMN process.