01-16-2017 11:24 AM
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...
01-16-2017 08:52 PM
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
01-16-2017 05:49 PM
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
01-16-2017 08:52 PM
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
11-21-2018 01:37 AM
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
Explore our Alfresco products with the links below. Use labels to filter content by product module.