[jboss-user] [jBPM] - start a process within another process in jbpm 4.3
Al Nadein
do-not-reply at jboss.com
Mon May 17 12:22:56 EDT 2010
Al Nadein [http://community.jboss.org/people/matrixpooh] replied to the discussion
"start a process within another process in jbpm 4.3"
To view the discussion, visit: http://community.jboss.org/message/543442#543442
--------------------------------------------------------------
In short, I start a process that happily follows a few steps before it hits a 'wait' state where it's persisted to db. At some point, i have to derive by the rules if any other sub-processes have to be created. Since jbpm provides an option to create only 1 subprocess at a given step, I'm openning subprocesses programmatically, i.e. in *CreateSubprocesses* activity handler:
{code}
//calculate groups to assign to a swimlane
taskAssignees = ...;
assigneeGroups.put(SharedConstants.KEY_SWIMLANE_CANDIDATE_GROUPS, taskAssignees);
ProcessInstance processInstance = executionService.startProcessInstanceByKey("subprocess_1", assigneeGroups);
{/code}
Again, all of the above is done in an activity handler of the process that has just been instantiated and hasn't been saved to db yet.
Here's a shortened version of my jpdl:
{code:xml}
<process key="main" name="main" xmlns=" http://jbpm.org/4.3/jpdl http://jbpm.org/4.3/jpdl">
<start g="5,23,48,48" name="start">
<transition g="141,46:-88,-15" name="open.case" to="Create sub-process"/>
</start>
<state g="306,193,148,52" name="Wait For Update">
<transition g="-23,-24" name="end" to="end1"/>
</state>
<custom g="239,26,138,52" name="Create sub-process" class="*CreateSubprocesses*">
<transition g="484,52:-108,-17" name="to-split-paths" to="Wait For Update"/>
</custom>
<end g="566,493,48,48" name="end1"/>
</process>
{/code:xml}
and one of possible sub-processes (simplified):
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<process name="test" key="test" xmlns=" http://jbpm.org/4.3/jpdl http://jbpm.org/4.3/jpdl">
<swimlane candidate-groups="#{assigned.responsibilities}" name="assigned-group"/>
<start name="start1" g="16,21,48,48">
<transition name="to task1" to="task1" g="-17,-20"/>
</start>
<end name="end1" g="219,17,48,48"/>
<task name="task1" g="96,16,92,52" swimlane="assigned-group">
<transition name="to end1" to="end1" g="-20,-19"/>
</task>
</process>
{/code:xml}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/543442#543442]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100517/5c0adc47/attachment-0001.html
More information about the jboss-user
mailing list