[jboss-user] [jBPM] - Re: How to get WorkItemHandler results

Esteban Aliverti do-not-reply at jboss.com
Fri Feb 24 12:12:03 EST 2012

Esteban Aliverti [https://community.jboss.org/people/eaa] created the discussion

"Re: How to get WorkItemHandler results"

To view the discussion, visit: https://community.jboss.org/message/719574#719574

The results of a WorkItem Handler are usually used INSIDE the process. If you need them outside of the process you can basically follow 2 mechanisms:
1. Create your external mechanism that the WorkItem Handler will use: i.e. pass a List to the constructor of the WorkItem Handler, the handler then will populate the list (no need to put the results in the resulting map since you are not going to use the value in the process) and then retrieve the value from your app.
2. Put the result in the map and pass it to the process (this is automatically done when you complete the WI), in the process definition you have to map the result to a process' variable. Then, when the process is completed, you can get the value of that variable using something like:
((WorkFlowProcessInstance) process).getVariable("nameOfTheProcessVariable")

Best Regards,

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120224/49cad149/attachment.html 

More information about the jboss-user mailing list