[jboss-user] [JBoss jBPM] - Re: Token.signal() ---> 2 tokens?

pojomonkey do-not-reply at jboss.com
Fri Feb 22 04:38:23 EST 2008


"kukeltje" wrote : In most of the situations the states (not to be confused with the state nodes) are either signalled by a human, or async after the execution of some action.
Please, can you clarify what the difference is between 'the states' and 'the state nodes'? I am taking a token being at a state node to present a given process state, and then the node-enter events can indicate the transition into a state.

"kukeltje" wrote : When using async nodes, the token is 'known' to the code that signals the node again. That way it does not have to have knowledge about the processdefinition but just the one token that needs to be signalled.
Hmm, I think I follow that - will have to let that stew with the rest of my understanding of jBPM so far and see if some epiphany results.

"kukeltje" wrote : 
  | Btw, Client based assignment only shows up on google for the jbpm 2.0 docs. Is that where you read it?
Yes. I wouldn't have expected that capability to have been 'lost'. If jBPM is no longer capable/suitable, then I need to find that out pretty soon!

Based on the various comments and reading that I've done, I've now tried pushing the tokens through the flow by only signalling a token when it has no active children, and if it has to signal the children (unless they have active children etc.) - that seems to 'work' insofar that the root token ends up in the terminal state.

Like this:
	
  |         private boolean signalTokens(Token token)
  | 	{
  | 		if (token.hasEnded())
  | 			return true;
  | 		
  | 		Map children = token.getActiveChildren();
  | 		
  | 		if (children.size() == 0)
  | 		{
  | 			token.signal();
  | 		}
  | 		else
  | 		{
  | 			Collection ct = children.values();
  | 			Iterator it = ct.iterator();
  | 			
  | 			while (it.hasNext())
  | 			{
  | 				Token child = (Token)it.next();
  | 				while (!signalTokens(child))
  | 					;
  | 			}
  | 		}
  | 		
  | 		return false;
  | 	}
  | 

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

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



More information about the jboss-user mailing list