cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement auto approval of forms?

bbarani
Champ in-the-making
Champ in-the-making
Hi,

Can someone let me know how to implement an auto approval process.

For example, the below custom form should get auto approved and stored in archive based on the request but as of now someone has to get in to the system to approve this task. I am passing the data from source system to activiti (to populate the form) and I need those details for future reporting hence I wont be able to bypass the form without archiving it.

I need to set the value of the field 'approvalConfirmed' to true and call my java class… Can someone let me know how to do that?

<userTask id="NoNeedApproval" name="Auto Approval"
activiti:candidateUsers="${user}" activiti:assignee="${user}">
<extensionElements>
<activiti:formProperty id="test6" name="Needs Approval:"
expression="${needsApproval}" writable="false" type="boolean" />

<activiti:formProperty id="test3" name="Initiator:"
expression="${initiator}" writable="false" type="string" />

<activiti:formProperty id="test3" name="Description:"
expression="${description}" readable="true" writable="false" type="string" />

<activiti:formProperty id="test" name="User:"
expression="${user}" writable="false" type="string" />

<activiti:formProperty id="test2" name="Image:"
expression="${imageName}" writable="false" type="string" />
<activiti:formProperty id="approvalConfirmed"
name="approvalConfirmed" type="enum" required="true">
<activiti:value id="true" name="Yes"></activiti:value>
<activiti:value id="false" name="No"></activiti:value>
</activiti:formProperty>
</extensionElements>
</userTask>

I have a java class to archive the form but I am not sure how to invoke the class automatically from this user task..


Thanks,
Barani
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
You don't need a usertask if the trigger is always from an automatic system.
Use a wait state (receive task) and call runtimeService.signal() with the id you want to trigger.