[JBoss-user] [JBoss jBPM] - Re: spawning multiples subprocess instances
Hi, the solution I have proposed DON'T work because the code modifies the process definition, not only the process instance. In fact there is no concept of transition instance, only transition. So bad. I will think about a solution based on a custom fork and certainly a custom join. I think this feature, offered by some others bpm softwares, is very important and I hope the JBpm team will include it in a future version. Thanks. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3954340#3954340 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954340 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: spawning multiples subprocess instances
You could always delete those transitions after you go to them. Could you just create new child tokens from the root, and then just do the token.setNode( yourNode ); for each of them to force them on there without changing the process definition? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3954357#3954357 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954357 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: spawning multiples subprocess instances
finally I will do that : | ?xml version=1.0 encoding=UTF-8? | | process-definition xmlns=urn:jbpm.org:jpdl-3.1 | name=super-process | | swimlane name=tester | assignment expression=user(ernie) / | /swimlane | | start-state name=start | task name=start-task swimlane=tester | controller | variable name=an-other-sub-process.counter / | /controller | /task | transition name= to=an-other-sub-process / | /start-state | | decision name=an-other-sub-process | handler class=com.traceone.bpm.ext.decision.CounterDecision / | transition name=no to=join / | transition name=yes to=my-fork / | /decision | | fork name=my-fork | transition to=sub-process-state / | transition name=to-an-other to=an-other-sub-process / | /fork | | process-state name=sub-process-state | sub-process name=sub-process / | transition to=join / | /process-state | | join name=join | transition to=end / | /join | | end-state name=end / | | /process-definition | | public class CounterDecision implements DecisionHandler { | | public String decide(ExecutionContext executionContext) throws Exception { | Decision decision = (Decision) executionContext.getNode(); | String varName = new StringBuffer(decision.getName()).append(.counter).toString(); | String tmp = (String) executionContext.getVariable(varName); | int counter = Integer.parseInt(tmp); | String transition = counter 0 ? yes : no; | executionContext.setVariable(varName, String.valueOf(--counter)); | return transition; | } | | } | View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3954374#3954374 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954374 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: spawning multiples subprocess instances
concerning the solution to delete the transition, i think the join will never do it's job. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3954371#3954371 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954371 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: spawning multiples subprocess instances
smalbequi wrote : concerning the solution to delete the transition, i think the join will never do it's job. As long as the join receives all of the child tokens created in the fork, the join will complete. Since your subprocess will finish X number of times, then all those tokens should move along. But, since it is editing the processdefinition, what happens if someone else happens to be iterating at that point at the same time? You could have crazy collisions, so still not the best of ideas. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3954397#3954397 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954397 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: spawning multiples subprocess instances
Hi, I propose this solution based on an event type node-enter on the fork node. | process-definition name=parent-process | | swimlane name=tester | assignment expression=user(ernie) / | /swimlane | | start-state name=start | task name=start-task swimlane=tester | controller | variable name=my-fork.leaving-transitions-count / | /controller | /task | transition to=my-fork / | /start-state | | fork name=my-fork | event type=node-enter | action name=spawning class=xxx.SpawningMultipleTransitions/ | /event | transition to=sub-process-state / | /fork | | process-state name=sub-process-state | sub-process name=sub-process / | transition to=join/ | /process-state | | join name=join | transition to=end / | /join | | end-state name=end / | | /process-definition | | package xxx; | | import java.util.List; | | import org.jbpm.graph.def.ActionHandler; | import org.jbpm.graph.def.Transition; | import org.jbpm.graph.exe.ExecutionContext; | import org.jbpm.graph.node.Fork; | | public class SpawningMultipleTransitions implements ActionHandler { | | public void execute(ExecutionContext executionContext) throws Exception { | Fork fork = (Fork) executionContext.getNode(); | String varName = new StringBuffer(fork.getName()).append(.leaving-transitions-count).toString(); | String leavingTransitionCount = (String) executionContext.getVariable(varName); | if (leavingTransitionCount == null) { | throw new RuntimeException(The variable + varName + must have an integer value); | } | int n; | try { | n = Integer.parseInt(leavingTransitionCount); | } | catch (NumberFormatException e) { | throw new RuntimeException(The variable + varName + must have an integer value); | } | | List transitions = fork.getLeavingTransitions(); | if (transitions.size() == 0) { | throw new RuntimeException(The fork node + fork.getName() + | must have a transition. Check your processdefinition.xml); | } | else if (transitions.size() 1) { | throw new RuntimeException(The fork node + fork.getName() + | must have only one transition. Check your processdefinition.xml); | } | Transition transition = (Transition) fork.getLeavingTransitions().remove(0); | if (transition.getTo() == null) { | throw new RuntimeException(The transition + transition.getName() + of the fork node + | fork.getName() + must have a destination. Check your processdefinition.xml); | } | String name = transition.getName(); | name = new StringBuffer(name != null ? name : transition).append(-).toString(); | for (int i = 1; i = n; i++) { | Transition trans = new Transition(new StringBuffer(name).append(i).toString()); | trans.setProcessDefinition(fork.getProcessDefinition()); | trans.setFrom(fork); | trans.setTo(transition.getTo()); | fork.addLeavingTransition(trans); | } | } | } | View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3953973#3953973 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3953973 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [JBoss jBPM] - Re: spawning multiples subprocess instances
Couldn't you also just use a fork, have n transitions to the sub process node and then a single transition from the join? Like this: ?xml version=1.0 encoding=UTF-8? | | process-definition name=process | !-- START-STATE -- start-state name=start | task name=task/task | transition name= to=fork1/transition /start-state | | !-- NODES -- |process-state name=process1 | transition name= to=join2/transition |/process-state |join name=join2 | transition name= to=end1/transition |/join |end-state name=end1/end-state |fork name=fork1 | transition name=tr1 to=process1/transition | transition name=tr2 to=process1/transition | transition name=tr3 to=process1/transition |/fork | /process-definition Oh wait, nevermind, you want to decide at runtime how many to make. The above code solution from smalbequi is better then :) View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3954003#3954003 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954003 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user