Movo to node
jagr Mar 10, 2008 12:10 PMI've defined a process like this.
<?xml version="1.0" encoding="UTF-8"?> <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="reserva"> <swimlane name="reception"> <assignment actor-id="pepeito"></assignment> </swimlane> <start-state name="Offer petition"> <task name="Offer petition" swimlane="reception"> <controller></controller> </task> <transition to="searchClient" name="search"></transition> </start-state> <task-node name="Create client"> <task name="Create client" swimlane="reception"> <controller></controller> </task> <event type="node-enter"> <action class="com.aixtelecom.actions.CreateClientAction"></action> </event> <transition to="Create offer" name="crear oferta"></transition> </task-node> <task-node name="Create offer"> <task name="Create offer" swimlane="reception"> <controller></controller> </task> <event type="node-enter"> <action class="com.aixtelecom.actions.CreateOfferAction"></action> </event> <transition to="Createbooking" name="yes"></transition> <transition to="finish" name="no"></transition> </task-node> <task-node name="Createbooking"> <task name="Createbooking" swimlane="reception"> <controller></controller> </task> <transition to="finish" name="Fi"></transition> </task-node> <node name="searchClient"> <event type="node-enter"> <action class="com.aixtelecom.actions.SearchClientAction"></action> </event> <transition to="Create offer" name="tr_create_offer"></transition> <transition to="Create client" name="tr_create_client"></transition> </node> <end-state name="finish"></end-state> </process-definition>
At seachClient node i've created action handler on node-enter.
This action is:
public class SearchClientAction implements ActionHandler{ /** The log. */ private Logger log = Logger.getLogger(SearchClientAction.class); private static final long serialVersionUID = 3364679100134686576L; public void execute(ExecutionContext context) throws Exception { [connection with external mysql data base] if (result of query){ //go to create offer node.leave(context, "tr_create_offer"); } else{ //go to create client node.leave(context, "tr_create_client"); } } }
I want depending on result of query, automatically process go to create client or create offer.
On create client node and create offer node i've configured actions with
System.out.println("Running on CreateClientAction...");
or
System.out.println("### Running on CreateOfferAction");
When i start the process and enter on searchClient node, always the process finish into create offer node.
17:06:49,000 INFO [STDOUT] Running on CreateClientAction... 17:06:49,000 WARN [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.TaskNode - thi s operation breaks == 17:06:49,000 INFO [STDOUT] ### Running on CreateOfferAction
Any idea?