[jboss-user] [JBoss jBPM] - Re: Process State in a Fork not executing correctly
philso
do-not-reply at jboss.com
Wed Jan 7 10:52:12 EST 2009
Hi Ronald thanks for your reply. I've noted your comment about events & actions above node level,very useful thanks.
Please disregard the previous post as I've simplied the Process Definitions to:
Main Process Definition (ExpenseReport4)
And the Sub Process (ClaimVat)
I've pulled out my code into a simple test block as below. This code goes through the transitions in both the main Proc Def & its two sub processes. The sub processes use the same proc def (ClaimVat.xml). I've included in the codes comments what I would expect to see versus what I am seeing. Any help would be greatly appreciated.
Best regards, Phil
| String expenseReport4ProcDef="<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+
| "<process-definition xmlns=\"urn:jbpm.org:jpdl-3.1\" name=\"ExpenseReport4\">"+
| "<swimlane name=\"Initiator\"></swimlane>"+
| "<start-state name=\"Start SubProcess\">"+
| "<task swimlane=\"Initiator\"></task>"+
| "<transition to=\"ClaimVat1\" name=\"toClaimVat1\"></transition>"+
| "</start-state>"+
| "<process-state name=\"ClaimVat1\">"+
| "<sub-process name=\"ClaimVat\"></sub-process>"+
| "<transition to=\"fork1\" name=\"toFork\"></transition>"+
| "</process-state>"+
|
| "<fork name=\"fork1\">"+
| "<transition to=\"state2\" name=\"toState2\"></transition>"+
| "<transition to=\"state1\" name=\"toState1\"></transition>"+
| "</fork>"+
|
| "<process-state name=\"ClaimVat2\">"+
| "<sub-process name=\"ClaimVat\"/>"+
| "<transition to=\"join1\" name=\"fromClaimVat2\"></transition>"+
| "</process-state>"+
|
| "<task-node name=\"taskNode1\">"+
| "<transition to=\"join1\" name=\"fromTaskNode1\"></transition>"+
| "</task-node>"+
|
| "<join name=\"join1\">"+
| "<transition to=\"End\" name=\"toEnd\"></transition>"+
| "</join>"+
|
| "<state name=\"state1\">"+
| "<transition to=\"taskNode1\" name=\"toTaskNode1\"></transition>"+
| "</state>"+
|
| "<state name=\"state2\">"+
| "<transition to=\"ClaimVat2\" name=\"toClaimVat2\"></transition>"+
| "<transition to=\"join1\" name=\"fromState1\"></transition>"+
| "</state>"+
| "<end-state name=\"End\"></end-state>"+
| "</process-definition>";
|
| String claimVatProcDef="<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+
|
| "<process-definition xmlns=\"\" name=\"ClaimVat\">"+
|
| "<start-state name=\"ClaimSubmitted\">"+
| "<transition to=\"ReviewClaim\" name=\"toReviewClaim\"></transition>"+
| "</start-state>"+
|
|
| "<task-node name=\"ReviewClaim\" signal=\"never\" >"+
| "<task name =\"taskReviewClaim\" ></task>"+
| "<transition to=\"ClaimReviewed\" name=\"toClaimReviewed\"></transition>"+
| "</task-node>"+
|
| "<state name=\"ClaimReviewed\" >"+
| "<transition to=\"ClaimArchived\" name=\"toClaimArchived\"></transition>"+
| "</state>"+
|
| "<end-state name=\"ClaimArchived\" >"+
| "</end-state>"+
|
| "</process-definition>";
|
| ProcessDefinition processDefinition = null;
|
| processDefinition = ProcessDefinition.parseXmlString(expenseReport4ProcDef);
| context.deployProcessDefinition(processDefinition);
|
| processDefinition = ProcessDefinition.parseXmlString(claimVatProcDef);
| context.deployProcessDefinition(processDefinition);
|
| ProcessInstance procInstance = context.newProcessInstanceForUpdate("ExpenseReport4");
|
| String[] processTransitions = {"toClaimReviewed", "toClaimArchived", "toClaimVat2","toTaskNode1" ,"toClaimReviewed", "toClaimArchived"};
|
| procInstance.signal("toClaimVat1");
| procInstance.getRootToken().getSubProcessInstance().getRootToken().getAvailableTransitions(); //This returns transition "toClaimReviewed" as expected. This is correct.
| procInstance.getRootToken().getSubProcessInstance().signal("toClaimReviewed");
| procInstance.getRootToken().getSubProcessInstance().signal("toClaimArchived");
| procInstance.getRootToken().getChild("toState1").signal("toTaskNode1");
| procInstance.getRootToken().getChild("toState2").signal("toClaimVat2");
| procInstance.getRootToken().getChild("toState2").getAvailableTransitions();//this should contain "toClaimReviewed" but only contains the transition "fromClaimVat2" after
| // Sub Process. The only difference I can see between the execution of this sub process and the one above is this
| // sub process is being executed from a child
| // execution path,whereas the sub process that works as expected is the one that is executed from the root execution path.
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200120#4200120
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200120
More information about the jboss-user
mailing list