Yes, this looks like the same issue ( 
http://jira.jboss.org/jira/browse/JBPM-288 ).

My contention is that when a join node reactivates the parent token, all child 
tokens at that join node should be ended. The same is probably true for child 
tokens that arrive at the join after the parent has been reactivated.

>From jbpm3.1, join node:


  |   public void execute(ExecutionContext executionContext) {
  |     Token token = executionContext.getToken();
  |     
  |     // if this token is not able to reactivate the parent, 
  |     // we don't need to check anything
  |     if ( token.isAbleToReactivateParent() ) {
  | 
  |       // the token arrived in the join and can only reactivate 
  |       // the parent once
  |       token.setAbleToReactivateParent(false);
  | 
  |       Token parentToken = token.getParent();
  |       if ( parentToken != null ) {
  | 
  |         boolean reactivateParent = true;
  | 
  |         // if this is a discriminator
  |         if ( isDiscriminator ) {
  |           // reactivate the parent when the first token arrives in the 
  |           // join.  this must be the first token arriving because otherwise
  |           // the isAbleToReactivateParent() of this token should have been 
false
  |           // above.
  |           reactivateParent = true;
  | 
  |         // if a fixed set of tokenNames is specified at design time...
  |         } else if ( tokenNames != null ) {
  |           // check reactivation on the basis of those tokenNames
  |           reactivateParent = mustParentBeReactivated(parentToken, 
tokenNames.iterator() );
  | 
  |         // if a script is specified
  |         } else if ( script != null ) {
  | 
  |           // check if the script returns a collection or a boolean
  |           Object result = script.eval( token );
  |           // if the result is a collection 
  |           if ( result instanceof Collection ) {
  |             // it must be a collection of tokenNames 
  |             Collection runtimeTokenNames = (Collection) result;
  |             reactivateParent = mustParentBeReactivated(parentToken, 
runtimeTokenNames.iterator() );
  | 
  | 
  |           // if it's a boolean... 
  |           } else if ( result instanceof Boolean ) {
  |             // the boolean specifies if the parent needs to be reactivated
  |             reactivateParent = ((Boolean)result).booleanValue();
  |           }
  | 
  |         // if a nOutOfM is specified
  |         } else if ( nOutOfM != -1 ) {
  | 
  |           int n = 0;
  |           // wheck how many tokens already arrived in the join
  |           Iterator iter = parentToken.getChildren().values().iterator();
  |           while ( iter.hasNext() ) {
  |             Token concurrentToken = (Token)iter.next();
  |             if (this.equals(concurrentToken.getNode())) {
  |               n++;
  |             }
  |           }
  |           if ( n < nOutOfM ) {
  |             reactivateParent = false;
  |           }
  |           
  |         // if no configuration is specified..
  |         } else {
  |           // the default behaviour is to check all concurrent tokens and 
reactivate
  |           // the parent if the last token arrives in the join
  |           reactivateParent = mustParentBeReactivated(parentToken, 
parentToken.getChildren().keySet().iterator() );
  |         }
  | 
  |         // if the parent token needs to be reactivated from this join node
  |         if (reactivateParent) {
  | 
  |           // write to all child tokens that the parent is already 
reactivated
  |           Iterator iter = parentToken.getChildren().values().iterator();
  |           while ( iter.hasNext() ) {
  |             // ((Token)iter.next()).setAbleToReactivateParent( false );
  |              Token tok = ((Token)iter.next());
  |              tok.setAbleToReactivateParent( false );
  |              if (this.equals(tok.getNode()) tok.end();
  |           }
  | 
  |           // write to all child tokens that the parent is already 
reactivated
  |           ExecutionContext parentContext = new 
ExecutionContext(parentToken);
  |           leave(parentContext);
  |         }
  |       }
  |     }
  |   }
  | 


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

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


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to