读书人

jBPM Developers Guide(jBPM开发指南)

发布时间: 2012-11-04 10:42:41 作者: rapoo

jBPM Developers Guide(jBPM开发指南)--Chapter 3. BPMN 2.0(第三部分)

3.8.5.?Sequence Flow(顺序流)

?? ?A sequence flow isthe connection between events, activities and gateways shown as a solid linewith an arrow in a BPMN diagram (JPDL equivalent is the transition). Eachsequence flow has exactly one source?and exactly one?target?reference, that contains the?id?ofan activity, event or gateway.

?

?? ?BPMN中顺序流显示为为一条带有箭头的实线,用来连接事件、活动和网关(在jPDL中等效的是transition)。每个顺序流都有且仅有一个源头和一个目标活动、事件或网关的引用。

<sequenceFlow id="myFlow" name="My Flow"         sourceRef="sourceId" targetRef="targetId" /> 
?? ?An importantdifference with JPDL is the behaviour of multiple outgoing sequence flows. InJPDL, only one transition is selected as outgoing transition, unless theactivity is a fork (or a custom activity with fork behaviour). However, inBPMN, the standard behaviour of multiple outgoing sequence flow is to split theincoming token ('execution' in jBPM terminology) into a collection of tokens,one for each outgoing sequence flow. In the following situation, aftercompleting the first task, there will be three tasks activated instead of one.

?

?? ?与jPDL的一个重要区别是在有多个外出顺序流时。在jPDL中,只有一个转移会成为外向转移,除非活动是fork(或自定义活动拥有fork行为)。然而,在BPMN中,多个外出顺序流的默认行为是将进入的token(jBPM中术语叫做execution)切分成token集合,每个顺序流一个。在下面示例中,当完成第一个任务后就会激活三个任务。


jBPM Developers Guide(jBPM开发指南)-Chapter 3. BPMN 2.0(第三一部分)

?? ?To avoid that acertain sequence flow is taken, one has to add a condition to the sequenceflow. At runtime, only when the condition evaluates to true, that sequence flowwill be taken.

?

?? ?为了避免使用一个顺序流,必须添加condition条件到顺序流中。在运行时,只有当condition条件结果为true,顺序流才会被执行。

?

?? ?To put a conditionon 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 iscurrently is necessary to add the?xsi:type="tFormalExpression"?to theconditionExpression.This can change in a future release.

?

?? ?注意,当前必须把?xsi:type="tFormalExpression"添加到?conditionExpression中。在未来的版本中可能会修改。

?

?? ?Activities (such asthe user task) and gateways (such as the exclusive gateway) can have a defaultsequence flow. This default sequence flow is taken only when all the otheroutgoing sequence flow from an activity or gateway have a condition thatevaluate to false. A default sequence flow is graphically visualized as asequence flow with a 'slash marker'.

?

?? ?活动(比如用户任务)和网关(比如唯一网关)可以设置默认顺序流。默认顺序流只会在活动或网关的所有其他外向顺序流的condition条件为false时才会被使用。 默认顺序流图形像是顺序流多了一个斜线标记。


jBPM Developers Guide(jBPM开发指南)-Chapter 3. BPMN 2.0(第三一部分)

?? ?The default sequenceflow is specified by filling in the?'default'attribute?ofthe activity or gateway.

?

?? ?默认顺序流通过活动或网关的?'default' 属性?来指定。

?

?? ?Also note that anexpression on a default sequence flow is ignored.

?

?? ?也要注意,默认顺序流上的表达式将会被忽略。

?

3.8.6.?Gateways(网关)

?? ?A gateway in BPMN isused 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 canbe merged or split depending on the gateway type.

?

?? ?BPMN中网关是用来控制流程中的流向的。更确切的说,当一个token(BPMN 2.0中execution的概念注解)到达一个网关,它会根据网关的类型进行合并或切分。

?

?? ?Gateways aredepicted as a diamond shape, with an icon inside specifying the type(exclusive, inclusive, etc.).

?

?? ?网关使用菱形来表示,内部内部的图标则用来表示网关的类型 (唯一,广泛,其他)。

?

?? ?On every gatewaytype, the attribute?gatewayDirection?can be set following values arepossible:

?

?? ?作为一个网关,属性gatewayDirection属性可以设置为以下值:

unspecificed (default): the gateway may have multiple incoming and multiple sequence flow.unspecificed (默认)网关可能拥有多个进入和多个顺序流。mixed: the gateway must have multiple incoming and multiple outgoing sequence flow.mixed网关必须拥有多个进入和外出顺序流。converging: the gateway must have multiple incoming sequence flow, but can have only one outgoing sequence flow.converging网关必须拥有多个进入顺序流, 但是只能有一个外出顺序流。diverging: the gateway must have only one incoming sequence flow and multiple outgoing sequence flow.diverging网关必须拥有一个进入顺序流,和多个外出顺序流。

读书人网 >软件架构设计

热点推荐