[jboss-user] [JBoss jBPM] - Re: Fork that have conditions.. how??

salaboy21 do-not-reply at jboss.com
Tue Nov 4 07:41:22 EST 2008


I was looking into the code and I find this that can help you:

  |  // by default, the fork spawns a token for each leaving transition
  |     if (script==null) {
  |       transitionNames = getLeavingTransitionsMap().keySet();
  | 
  |     } else { // a script is specified  
  |       // if a script is specified, use that script to calculate the set 
  |       // of leaving transitions to be used for forking tokens.
  |       Map outputMap = null;
  |       try {
  |         outputMap = script.eval(token);
  |       } catch (Exception e) {
  |         this.raiseException(e, executionContext);
  |       }
  |       if (outputMap.size()==1) {
  |         Object result = outputMap.values().iterator().next();
  |         if (result instanceof Collection) {
  |           transitionNames = (Collection) result;
  |         }
  |       }
  | 
This means that you can add a script to tell the fork node with transitions you want to take.
Hope it helps

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4186670#4186670

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4186670



More information about the jboss-user mailing list