boolean ret = n.doStart(nc);
if (ret == true) {
EngineMessage newMsg = new EngineMessageImpl();
newMsg.setCurrentTokenID(newToken.getTokenID());
queue.enqueue(newMsg);
}
break;
}
/*
* this state is 'between' doStart() and doEnd(). So prepare
* context and call doEnd()
*/
case Token.MID : {
logger.debug("processMessage : Current state = MID for " + tk);
nc.setCurrentExecutionToken(tk);
/*
* call doEnd() and get the set of conenctions that we need
* to traverse, or null if we are to stop
*/
Connection[] c = n.doEnd(nc);
if (c != null && c.length > 0) {
Token[] newTokens = tokenService.nextToken(c, tk);
for(int i = 0; i < c.length; i++) {
EngineMessage newMsg = new EngineMessageImpl();
newMsg.setCurrentTokenID(newTokens[i].getTokenID());
queue.enqueue(newMsg);
}
}
else {
// all done