[jboss-user] [jBPM] - Re: JBPM 3.1 Exception thrown on EndState

Al Daher do-not-reply at jboss.com
Mon Oct 10 11:28:56 EDT 2011


Al Daher [http://community.jboss.org/people/baltajino] created the discussion

"Re: JBPM 3.1 Exception thrown on EndState"

To view the discussion, visit: http://community.jboss.org/message/630935#630935

--------------------------------------------------------------
i analysed the log Information, there was something suspicious happening in my process.
The process cgoes as follows:
Start---->validateNode(actionhandler1)---->decisionNodeUponValidation(actionhandler2)----->End\or go further
in actionHandler1 ihad the following code:
Line1 if(startDate.before(currentDate))
Line2        {
Line3            executionContext.setVariable(ProjectManagementProcessConstants.VAR_PROJECT_STATUS, Status.REJECTED);
Line4            executionContext.leaveNode();
Line5        }
Line6        else if(projecttitle==null || projecttitle.equals(""))
Line7        {
Line8            executionContext.setVariable(ProjectManagementProcessConstants.VAR_PROJECT_STATUS, Status.REJECTED);
Line9            executionContext.leaveNode();
Line10        }
Line11        executionContext.setVariable(ProjectManagementProcessConstants.VAR_PROJECT_STATUS, Status.APPROVED);
Line12        executionContext.leaveNode();

according my test, it shall go through line 3 and 4 and after that actionhandler2 shall be called and then to endState will be reached. So fas so good. And it happens indeed BUT:
after getting out of End State the code completes to line 11 and 12 in actionHandler1. Now the Variable Status is has changed But actionHandler1 has not finished. So while leaving EndState it goes furrther in actionHandler1 and actionHandler2. in actionHandler2 it fires a a leavenode(transition1) and tries to go to a transition1 which does not exist in End State. Hence the exception can't leave node 'EndState(endProjectManagementProcess)' without leaving transition.

Bottom Line: LEAVENODE FUNCTION IS NOT THE SAME AS RETURN
That is something NEW AND INTERESTING to learn
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/630935#630935]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111010/a1337283/attachment.html 


More information about the jboss-user mailing list