cancel
Showing results for 
Search instead for 
Did you mean: 

Integrating activiti explorer within spring mvc web application

shivnarayanvarm
Champ in-the-making
Champ in-the-making
My requirement :

1. A background job is polling database , message channels to read new invoices and create new invoice approval workflow task using

runtimeService.startProcessInstanceByKey("Invoice_Approval_Process", invoice.getId().toString(), vars);

1.  User will login through custom web application screen.

2.  User will be authenticated.

3.  User will shown list of all the Invoice review Task shown to him using :

   taskService.createTaskQuery().taskAssignee(username).list();
   
4.  Now question is I would like to show "review", "approve", "adjust" buttons defined in bpmn diagram to user and clicking approve should  take it to next level of UserTask.
   
   a. One of the way of doing it can be creating your custom jsp form with approve, review buttons and on the action it complete the task using java controller.
   
   b. Another possibility : can I render activiti form to user (defined in bpmn diagram). and let activiti handle the process.
   
      e.g. activii form:
      <userTask id="task">
        <extensionElements>
         <activiti:formProperty id="room" />
         <activiti:formProperty id="duration" type="long"/>
         <activiti:formProperty id="speaker" variable="SpeakerName" writable="false" />
         <activiti:formProperty id="street" expression="#{address.street}" required="true" />
        </extensionElements>
      </userTask>
   
      How this can be done? Question is how to integrate with activiti form page for process from spring web page.
     
      Thanks for your help in advance.
     
      Regards, Shiv
2 REPLIES 2

shivnarayanvarm
Champ in-the-making
Champ in-the-making
Any inputs… I am waiting for your inputs…

jbarrez
Star Contributor
Star Contributor
Well, it's a pretty generic question … both ways work. Either use the form properties … or use a formKey and use that to display and submit the form yourself (i have a preference for the form key approach).

Activiti doesn't care about how you do it: if you use the form key approach, the form properties are passed as process variables with a regular taskService.complete(taskId, Map<String, Object> variables) call.