[jBPM Users] - Re: workflow design about wait states
by mmusaji
My classes in the custom nodes do very little. I don't understand how these would have an impact on wait state which is after they execute.
| public class ValidateOneRequest implements ActivityBehaviour {
|
| private static final long serialVersionUID = 1L;
| ExperianDetails experianDetails;
|
| public void execute(ActivityExecution execution) throws Exception {
| Thread.sleep(2000);//simulate a delay in processing.
| OneDetails oneDetails= (OneDetails)execution.getVariable("oneDetails");
| oneDetails = update(oneDetails); //update the object in some way (change a name)
| execution.setVariable("oneDetails", oneDetails);
| }
| }
|
I'm working on a unit test, appreciate your feedback so far. I tried to do this before but because of the fork the unit test would always fail as the unit test thread would continue and fork would not be complete.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254711#4254711
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254711
16 years, 7 months
[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
16 years, 7 months