[jboss-user] [jBPM] - Re: How does a sub-process work?

Esteban Aliverti do-not-reply at jboss.com
Thu Jun 16 13:12:49 EDT 2011

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

"Re: How does a sub-process work?"

To view the discussion, visit: http://community.jboss.org/message/610649#610649

In JBPM5 you have two different scopes: one are process' variables and the other is ksession (shared among all the processes running in it). In the case of variables, you need to map the input and output variables of your sub-process using the editor for example. So If you want to use a variable from the main process in the sub-process, you need to define an input parameter in the sub-process and do the corresponding mapping in the reusable-subprocess node of your main process. If your sub-process modifies the variable or creates a new one and you want to use it in the main process, you need to map (again, in the reusable-subprocss node) the output variable from the sub-process to a variable in the main process. In the case of embedded sub-processes, you don't need to do these mappings, because both processes are in the same "context". If you are storing variables in you session (using insert() for example), you don need to do anything special. You don't even need to pass the ksession from the main process to the sub-process. Both processes could reach the same ksession using the "magic" variable kcontext: kcontext.getKnowledgeRuntime()  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/20110616/bfa25b9d/attachment-0001.html 

More information about the jboss-user mailing list