For branches, jbpm has two main implementation methods: demo-and multi-transition.
1) describe is used for Automatic Branch judgment.
"<Demo-name = 'hongsoft demo'>" +
"<Transition to = 'learning jbpm '/>" +
"<Transition name = 'imporant' to = 'forget about hongsoft '>" +
"<Condition >#{ hongsoft years old> 80 }</condition>" +
"</Transition>" +
"<Transition name = 'lea' to = 'learging jbpm too'>" +
"<Condition >#{ hongsoft years old> 18 }</condition>" +
"</Transition>" +
"</Demo->"
For such a node, the process will not stop; instead, it will automatically determine the transfer to which it should be switched and automatically execute it.
2) multiple transition is used for manual Branch judgment.
Let's take a look at the following parts of task. jsp:
<C: Choose>
<C: When test = "$ {! Empty taskbean. availabletransitions} ">
Task actions:
<C: foreach Var = "availabletransition" items = "$ {taskbean. availabletransitions}">
<C: Set Var = "availabletransition" Scope = "request" value = "$ {availabletransition}"/>
<H: commandbutton id = "transitionbutton" Action = "# {taskbean. saveandclose}" value = "# {availabletransition. name}"/>
</C: foreach>
</C: When>
<C: otherwise>
<H: commandbutton id = "transitionbutton" Action = "# {taskbean. saveandclose}" value = "Save and close task"/>
</C: otherwise>
</C: Choose>
First, determine whether there are multiple transitions in the activity. If so, list each transition, and the actor manually clicks to drive the process;
If not, there is only one transition and the task can be completed directly.
The corresponding process is defined as follows:
<Task-node name = "evaluate web order">
<Task execution Lane = "salesman">
</Task>
<Transition name = "OK" to = "salefork"/>
<Transition name = "More Info needed" to = "Fix web order data"/>
</Task-node>
That is, you can directly configure two or more transition in the node to implement the branch. This can also implement the process rollback function.