[jBPM Users] - Re: workflow design about wait states
by mmusaji
Previous one did not have wait state. I was referring to it once I'd added but here it is.
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process name="process" xmlns="http://jbpm.org/4.0/jpdl">
| <start>
| <transition to="parse request"/>
| </start>
|
| <custom class="org.application.workflow.ParseRequest" name="parse request" two="#{myObj}">
| <transition to="evaluate parse result"/>
| </custom>
|
| <decision name="evaluate parse result" expr="#{content}" >
| <transition name="valid" to="find providers" />
| <transition name="invalid" to="error"/>
| </decision>
|
| <custom two="#{myObj}" class="org.application.workflow.FindProviders" name="find providers">
| <transition to="fork"/>
| </custom>
|
| <fork name="fork">
| <transition name="validate one" to="validate one request"/>
| <transition name="validate two" to="validate two request"/>
| <transition name="validate three" to="validate three request"/>
| </fork>
|
| <!-- EACH OF THESE CUSTOM NODES WILL TAKE AN UNKNOWN AMOUNT OF TIME -->
| <custom continue="async" name="validate one request" class="org.application.workflow.ValidateoneFraudRequest" two="#{oneDetails}">
| <transition to="join"/>
| </custom>
|
| <custom continue="async" name="validate two request" class="org.application.workflow.ValidateExpFraudRequest" two="#{twoDetails}">
| <transition to="join"/>
| </custom>
|
| <custom continue="async" name="validate three request" class="org.application.workflow.ValidateSysFraudRequest" two="#{threeDetails}">
| <transition to="join"/>
| </custom>
|
| <join name="join" continue="exclusive">
| <transition name="wait" to="wait"/>
| </join>
|
| <state name="wait">
| <transition to="evaluate validation results"/>
| </state>
|
| <decision name="evaluate validation results" expr="#{content}" >
| <transition name="valid" to="construct message" />
| <transition name="invalid" to="error"/>
| </decision>
|
| <custom name="construct message" class="org.application.workflow.ConstructRequest" two="#{myObj}">
| <transition to="send"/>
| </custom>
|
| <custom name="send" class="org.application.workflow.SendRequest" two="#{myObj}">
| <transition to="get responses"/>
| </custom>
|
| <custom name="get responses" class="org.application.workflow.GetResponse" two="#{myObj}">
| <transition to="process responses"/>
| </custom>
|
| <custom name="process responses" class="org.application.workflow.ProcessResponse" two="#{myObj}">
| <transition to="getMyObject"/>
| </custom>
|
| <custom name="getMyObject" class="org.application.workflow.GetMyObject" two="#{myObj}">
| <transition to="end"/>
| </custom>
|
| <task name="end">
| <transition name="to complete" to="end process"/>
| </task>
|
| <end name="end process" state="complete"/>
| <end-error name="error"/>
|
| </process>
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254704#4254704
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254704
15 years, 4 months
[jBPM Users] - Re: workflow design about wait states
by mmusaji
I understand what you said earlier Ronald, having trouble implementing this in a Junit test.
I've added a state in my workflow which will wait until signal recieved. Its after the join in the above example. I wont paste the whole workflow again, hope that's ok.
My Unit test is
public void testSimple() throws Exception {
|
| ProcessInstance processInstance = executionService.startProcessInstanceByKey("process", variables);
| String processInstanceId = processInstance.getId();
|
| String executionId = processInstance.findActiveExecutionIn("wait").getId();
|
| processInstance = executionService.signalExecutionById(executionId, "continue");
| }
Problem is I always get null pointer exception as no execution is found in "wait". I presume what is happening is similar to a problem I had before when the async processes from fork carry on, my unit test in a seperate thread carries on and the wait state isn't there yet.
Any suggestions?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254695#4254695
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254695
15 years, 4 months