I have a user review task (which is parallel and Multi-instance type), which has custom form in Activiti with custom outcomes (Approve and Reject)... once the task gets completed, I want to know the form variable into which the task outcome is stored... I believe it is one of the task variables.... I want to access it in a Java Task Listener on task complete... please guide...
Solved! Go to Solution.
As Greg mentioned, the outcome is saved as a process variable form<formid>outcome. However when you have a multi-instance scenario it could get overwritten every time. So it is better not to rely on the process variable if you want to find the selected outcome. You would be better of using the
submittedFormService bean which will use the outcome data from each submittedForms associated with the individual tasks. Please find attached an example on how to achieve this with a Delegate.
Cheers,
Ciju
Custom outcomes are written into the process as process variables with a variable name of:
form<formid>outcome
e.g. form10001outcome = bogus
The variable will have a value of the outcome you have chosen.
I am not exactly sure what happens if the same form is reused in multiple tasks, since it appears to be the primary key of the form table that is included in the id of the variable.
Custom outcomes are very useful but not well documented unfortunately.
Greg
As Greg mentioned, the outcome is saved as a process variable form<formid>outcome. However when you have a multi-instance scenario it could get overwritten every time. So it is better not to rely on the process variable if you want to find the selected outcome. You would be better of using the
submittedFormService bean which will use the outcome data from each submittedForms associated with the individual tasks. Please find attached an example on how to achieve this with a Delegate.
Cheers,
Ciju
Hi,
I have used your implemented code but I am getting the below error.
When I add the capability "Administration of tenant of this group" to respective user then it works. but I don't want to give this capability to the user due to some company's policy.
Please help me how should I resolve it ?
Thanks
Rahi
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.