(4) jbpm websale code learning: task. jsp (two branch policies of jbpm)

Source: Internet
Author: User
Tags jbpm

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.