- 浏览: 129040 次
- 性别:
文章分类
最新评论
-
cultivator129:
匿名用户没办法下载,也没找到登陆的地方,大家是怎么登陆的?
signavio-core-components编译初体验 -
511039003:
...
如何使用Guava的缓存管理 -
string2020:
activiti如何整合OSGI
Activiti User Guide -- Activit 用户指南 Part06 -
刺客8882010:
楼主可否给我份Demo,谢谢,控制部分代码在哪里写我不是很清楚 ...
利用Spring动态对Quartz定时任务管理 -
yu120:
有源码吗?
利用Spring动态对Quartz定时任务管理
3.8.5. Sequence Flow(顺序流)
A sequence flow is the connection between events, activities and gateways shown as a solid line with an arrow in a BPMN diagram (JPDL equivalent is the transition). Each sequence flow has exactly one source and exactly one target reference, that contains the id of an activity, event or gateway.
BPMN中顺序流显示为为一条带有箭头的实线,用来连接事件、活动和网关(在jPDL中等效的是transition)。每个顺序流都有且仅有一个源头和一个目标活动、事件或网关的引用。
<sequenceFlow id="myFlow" name="My Flow" sourceRef="sourceId" targetRef="targetId" />An important difference with JPDL is the behaviour of multiple outgoing sequence flows. In JPDL, only one transition is selected as outgoing transition, unless the activity is a fork (or a custom activity with fork behaviour). However, in BPMN, the standard behaviour of multiple outgoing sequence flow is to split the incoming token ('execution' in jBPM terminology) into a collection of tokens, one for each outgoing sequence flow. In the following situation, after completing the first task, there will be three tasks activated instead of one.
与jPDL的一个重要区别是在有多个外出顺序流时。在jPDL中,只有一个转移会成为外向转移,除非活动是fork(或自定义活动拥有fork行为)。然而,在BPMN中,多个外出顺序流的默认行为是将进入的token(jBPM中术语叫做execution)切分成token集合,每个顺序流一个。在下面示例中,当完成第一个任务后就会激活三个任务。
To avoid that a certain sequence flow is taken, one has to add a condition to the sequence flow. At runtime, only when the condition evaluates to true, that sequence flow will be taken.
为了避免使用一个顺序流,必须添加condition条件到顺序流中。在运行时,只有当condition条件结果为true,顺序流才会被执行。
To put a condition on a sequence flow, add a conditionExpression element to the sequence flow. Conditions are to be put between ${}.
可以使用conditionExpression元素给顺序流添加condition条件。条件必须放在 ${}中。
<sequenceFlow id=....> <conditionExpression xsi:type="tFormalExpression">${amount >=500} </conditionExpression> </sequenceFlow>Note that is currently is necessary to add the xsi:type="tFormalExpression" to theconditionExpression. This can change in a future release.
注意,当前必须把 xsi:type="tFormalExpression"添加到 conditionExpression中。在未来的版本中可能会修改。
Activities (such as the user task) and gateways (such as the exclusive gateway) can have a default sequence flow. This default sequence flow is taken only when all the other outgoing sequence flow from an activity or gateway have a condition that evaluate to false. A default sequence flow is graphically visualized as a sequence flow with a 'slash marker'.
活动(比如用户任务)和网关(比如唯一网关)可以设置默认顺序流。默认顺序流只会在活动或网关的所有其他外向顺序流的condition条件为false时才会被使用。 默认顺序流图形像是顺序流多了一个斜线标记。
The default sequence flow is specified by filling in the 'default' attribute of the activity or gateway.
默认顺序流通过活动或网关的 'default' 属性 来指定。
Also note that an expression on a default sequence flow is ignored.
也要注意,默认顺序流上的表达式将会被忽略。
3.8.6. Gateways(网关)
A gateway in BPMN is used to control the flow through the process. More specifically, when a token (the BPMN 2.0 conceptual notion of an execution) arrives in a gateway, it can be merged or split depending on the gateway type.
BPMN中网关是用来控制流程中的流向的。更确切的说,当一个token(BPMN 2.0中execution的概念注解)到达一个网关,它会根据网关的类型进行合并或切分。
Gateways are depicted as a diamond shape, with an icon inside specifying the type (exclusive, inclusive, etc.).
网关使用菱形来表示,内部内部的图标则用来表示网关的类型 (唯一,广泛,其他)。
On every gateway type, the attribute gatewayDirection can be set following values are possible:
作为一个网关,属性gatewayDirection属性可以设置为以下值:
Take for example the following example: a parallel gateway that has as gatewayDirection 'converging', will have a join behaviour.
比如下面的例子:当并行网关的gatewayDirection属性设置为'converging', 会拥有流程合并行为。
<parallelGateway id="myJoin" name="My synchronizing join" gatewayDirection="converging" />
Note: the 'gatewayDirection' attribute is optional according to the specification. This means that we cannot rely on this attribute at runtime to know which type of behaviour a certain gateway has (for example for a parallel gateway if we have joining of forking behaviour). However, the 'gatewayDirection' attribute is used at parsing time as a constraint check for the incoming/outgoing sequence flow. So using this attribute will lower the chance on errors when referencing sequence flow, but is not required.
注意:gatewayDirection属性在规范中是可选的。这意味着我们不能通过该属性在运行时知道一个网关的行为(比如,一个用来进行合并切分行为的并行网关)。然而,gatewayDirection属性用在解析进入、外出顺序流的一个约束条件。所以在涉及到顺序流时可以使用该属性减低出错的机会,但不是必须的。
3.8.7. Gateway: Exclusive
Gateway(网关:唯一网关)
An exclusive gateway represents an exclusive decision in the process. Exactly one outgoing sequence flow will be taken, depending on the conditions defined on the sequence flow.
唯一网关表达了流程中的唯一决策。网关会根据定义在顺序流中的条件选择一个外出顺序流。
The corresponding JPDL construct with the same semantics is the decision activity. The full technical name of the exclusive gateway is the 'exclusive data-based gateway', but it is also often called theXOR Gateway. The XOR gateway is depicted as a diamond with a 'X' icon inside. An empty diamond without a gateway also signifies an exclusive gateway.
在jPDL中相应功能的是 decision活动。唯一网关的全称是'基于数据的唯一网关',也经常称之为XOR网关。XOR网关被描绘为一个菱形,内部有一个'X'。空的菱形网关也表示唯一网关。
The following diagram shows the usage of an exclusive gateway: depending on the value of the amount variable, one of the three outgoing sequence flow out of the exclusive gateway is chosen.
下面图形显示了唯一网关的用法:根据amount变量的值,会选择三个外出顺序流中的一个。
The corresponding executable XML of this process looks as follows. Note that the conditions are defined on the sequence flow. The exclusive gateway will select the single sequence flow for which its condition evaluates to true. If multiple conditions evaluate to true, the first one encountered will be taken (a log message will indicate this situation).
这个流程对应的可执行XML如下。注意定义在顺序流中的条件。唯一网关会选择一个条件为真的顺序流。如果多个条件为真,则选择第一个 (日志中则会输出相应的信息)。
<process id="exclusiveGateway" name="BPMN2 Example exclusive gateway"> <startEvent id="start" /> <sequenceFlow id="flow1" name="fromStartToExclusiveGateway" sourceRef="start" targetRef="decideBasedOnAmountGateway" /> <exclusiveGateway id="decideBasedOnAmountGateway" name="decideBasedOnAmount" /> <sequenceFlow id="flow2" name="fromGatewayToEndNotEnough" sourceRef="decideBasedOnAmountGateway" targetRef="endNotEnough"> <conditionExpression xsi:type="tFormalExpression"> ${amount < 100} </conditionExpression> </sequenceFlow> <sequenceFlow id="flow3" name="fromGatewayToEnEnough" sourceRef="decideBasedOnAmountGateway" targetRef="endEnough"> <conditionExpression xsi:type="tFormalExpression"> ${amount <= 500 && amount >= 100} </conditionExpression> </sequenceFlow> <sequenceFlow id="flow4" name="fromGatewayToMoreThanEnough" sourceRef="decideBasedOnAmountGateway" targetRef="endMoreThanEnough"> <conditionExpression xsi:type="tFormalExpression"> ${amount > 500} </conditionExpression> </sequenceFlow> <endEvent id="endNotEnough" name="not enough" /> <endEvent id="endEnough" name="enough" /> <endEvent id="endMoreThanEnough" name="more than enough" /> </process>This process needs a variable such that the expression can be evaluated at runtime. Variables can be provided when starting the process instance (similar to JPDL):
这个流程需要一个变量,这样表达式就可以在运行期间进行求值。变量可以在流程实例启动时提供(类似jPDL)。
Map<String, Object> vars = new HashMap<String, Object>();vars.put("amount", amount); ProcessInstance processInstance = executionService.startProcessInstanceByKey("exclusiveGateway", vars);
The exclusive gateway requires that all outgoing sequence flow have conditions defined on them. An exception to this rule is the default sequence flow. Use the default attribute to reference an existing id of a sequence flow. This sequence flow will be taken when the conditions on the other outgoing sequence flow all evaluate to false.
唯一网关需要所有外出顺序流上定义条件。对这种规则一种例外是默认顺序流。使用default 属性来引用一个已存在的 顺序流的id。当其他顺序流的条件被评估为false的时候这个顺序流就会被使用。
<exclusiveGateway id="decision" name="decideBasedOnAmountAndBankType" default="myFlow"/> <sequenceFlow id="myFlow" name="fromGatewayToStandard" sourceRef="decision" targetRef="standard"> </sequenceFlow>
3.8.8. Gateway: parallel
Gateway( 网关:并行网关)
A parallel gateway is used to split or synchronize the respectively incoming or outgoing sequence flow.
并行网关用来切分或同步相关的进入或外出顺序流。
A parallel gateway is defined as follows:
并行网关定义如下:
<parallelGateway id="myParallelGateway" name="My Parallel Gateway" />Note that the 'gatewayDirection' attribute can be used to catch modeling errors at parsing time (see above).
注意,gatewayDirection属性可以用来在解析阶段获取建模的错误(具体可参考上面)。
The following diagram shows how a parallel gateway can be used. After process start, both the 'prepare shipment' and 'bill customer' user tasks will be active. The parallel gateway is depicted as a diamond shape with a plus icon inside, both for the splitting and joining behaviour.
下面的图形显示了一个并行网关的使用。在流程启动后,'prepare shipment'和'bill customer'用户任务都会被激活。并行网关被描绘为一个菱形,内部图标是一个十字,对切分和归并行为都是一样。
The XML counterpart of this diagram looks as follows:
对应的XML如下所示:
<process id="parallelGateway" name="BPMN2 example parallel gatewar"> <startEvent id="Start" /> <sequenceFlow id="flow1" name="fromStartToSplit" sourceRef="Start" targetRef="parallelGatewaySplit" /> <parallelGateway id="parallelGatewaySplit" name="Split" gatewayDirection="diverging"/> <sequenceFlow id="flow2a" name="Leg 1" sourceRef="parallelGatewaySplit" targetRef="prepareShipment" /> <userTask id="prepareShipment" name="Prepare shipment" implementation="other" /> <sequenceFlow id="flow2b" name="fromPrepareShipmentToJoin" sourceRef="prepareShipment" targetRef="parallelGatewayJoin" /> <sequenceFlow id="flow3a" name="Leg 2" sourceRef="parallelGatewaySplit" targetRef="billCustomer" /> <userTask id="billCustomer" name="Bill customer" implementation="other" /> <sequenceFlow id="flow3b" name="fromLeg2ToJoin" sourceRef="billCustomer" targetRef="parallelGatewayJoin" /> <parallelGateway id="parallelGatewayJoin" name="Join" gatewayDirection="converging"/> <sequenceFlow id="flow4" sourceRef="parallelGatewayJoin" targetRef="End"> </sequenceFlow> <endEvent id="End" name="End" /> </process>
发表评论
-
图形连线路由算法
2014-03-20 16:34 5900最近打算将工作流引擎设计器使用html5技术进 ... -
signavio-core-components编译初体验
2012-03-28 11:17 4693最近又开始研究Acti ... -
jBPM Developers Guide(jBPM开发指南)--Chapter 3. BPMN 2.0(第六部分)
2010-06-22 20:15 27353.9. Complete example (includi ... -
jBPM Developers Guide(jBPM开发指南)--Chapter 3. BPMN 2.0(第五部分)
2010-06-22 19:43 18823.8.12. Task: Script Task(脚 ... -
jBPM Developers Guide(jBPM开发指南)--Chapter 3. BPMN 2.0(第四部分)
2010-06-20 22:03 36383.8.9. Tasks(任务) A ... -
jBPM Developers Guide(jBPM开发指南)--Chapter 3. BPMN 2.0(第二部分)
2010-06-20 21:29 20603.7. Process root element( ... -
jBPM Developers Guide(jBPM开发指南)--Chapter 3. BPMN 2.0(第一部分)
2010-06-19 09:16 3055前几天看了jBPM4.3版的开发指南,网上也有翻译但是觉得好像 ...
相关推荐
jbpm-bpmn2-5.1.0.Final.jar jbpm5
yaoqiang BPMN2.0设计器是一款专为流程图设计打造的工具,主要用于支持Activiti和JBPM等流行的业务流程管理系统。BPMN(Business Process Modeling Notation)是一种国际标准,它为业务流程建模提供了图形化表示,...
jbpm-jpdl-suite-3.2.GA.zip
jeecg-jbpm-framework 20130202.zipjeecg-jbpm-framework 20130202.zipjeecg-jbpm-framework 20130202.zipjeecg-jbpm-framework 20130202.zipjeecg-jbpm-framework 20130202.zipjeecg-jbpm-framework 20130202....
jbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3.zipjbpm-jpdl-suite-3.2.3....
jbpm-flow-builder-5.1.0.Final.jar jbpm5
【标题】"eclipse配置jBPM(jbpm-test-6.1.0.Final.jar)"涉及的是在Eclipse集成开发环境中配置jBPM(Java Business Process Management)框架的实践教程。jBPM是一个开源的工作流和业务流程管理平台,它允许开发者...
jbpm-jpdl-designer-site-3.1.7.zip jbpm-jpdl-designer-site-3.1.7.zip jbpm-jpdl-designer-site-3.1.7.zip
jbpm-jpdl-suite-3.2.GA.zip
jbpm-jpdl-suite-3.2.GA.zip
jbpm-jpdl-suite-3.2.GA.zip
jbpm-6.0.0.Final-installer-full.tar.gz
jbpm-persistence-jpa-5.1.0.Final.jar jbpm5
jbpm-flow-5.1.0.Final.jar jbpm5
jbpm-bam-5.1.0.Final.jar jbpm5
jbpm-bpmn2-7.3.0.Final.jar包含了对BPMN 2.0的支持,实现了流程模型的解析和执行。 2. **流程执行与监控**:jbpm-executor-7.3.0.Final.jar和jbpm-human-task-core-7.3.0.Final.jar分别提供了流程的执行服务和人类...
jbpm-starters-kit-3.1.2.插件,jbpm-starters-kit-3.1.2.插件,jbpm-starters-kit-3.1.2.插件,jbpm-starters-kit-3.1.2.插件,jbpm-starters-kit-3.1.2.插件,jbpm-starters-kit-3.1.2.插件,jbpm-starters-kit-...
jbpm-jpdl-suite-3.2.GA.zip