3.7. Process root element(流程根元素)
The root of an BPMN 2.0 XML
process is the definitions elements. As the name states, the
subelements will contain the actual definitions of the business process(es).
Every process child will be able to have an id and name. An empty business process in
BPMN 2.0 looks as follows. Also note that it is handy to have the BPMN2.xsd on
the classpath, to enable XML completion.
BPMN 2.0 XML流程的根是definitions元素。子元素会则包含真正的业务流程定义。每个process子元素可以拥有一个id和name。一个空的BPMN 2.0业务流程定义如下所示。注意需要把BPMN2.xsd放在classpath下,来启用XML自动补全功能。
<definitions id="myProcesses"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 BPMN20.xsd"
xmlns="http://schema.omg.org/spec/BPMN/2.0"
typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://jbpm.org/example/bpmn2">
<process id="myBusinessProcess" name="My business processs">
...
</process>
<definitions>
If an id is defined for a
process element, it will be used as business key for that process (ie. starting
a process can be done by calling executionService.startProcessInstanceByKey("myBusinessProcess"),
otherwise the jBPM engine will create a unique process key (same mechanism as
for JPDL).
如果一个process元素定义了id,它会作为业务流程的key使用。比如,启动流程可以通过调用executionService.startProcessInstanceByKey("myBusinessProcess"),否则jBPM引擎会流程创建一个唯一key(这一点与jPDL相同)。
3.8. Basic constructs(基本结构)
3.8.1. Events(事件)
Together with
activitites and gateways, events are used in practically every business
process. Events allow process modelers to describe business processes in a very
natural way, such as 'This
process starts when I receive a customer order', 'If the task is not finished in 2 days, terminate the
process' or'When I
receive a cancel e-mail when the process is running, handle the e-mail using
this sub-process'. Notice that typical businesses always work in a
very event-driven way. People are not hard-coded sequential creatures, but they
tend to react on things that happen in their environment (ie. events). In the
BPMN specification, a great number of event types are described, to cover the
range of possible things that might occur in context of a business.
活动、网关和事件几乎在每个业务流程中被使用。事件让业务流程建模者用很自然的方式描述业务流程,比如'当我接收到客户的订单时启动该流程','如果两天内任务没结束,就终止流程' 或者'当我收到一封取消邮件,当流程在运行时,使用子流程处理邮件'。注意典型的业务通常使用这种事件驱动的方式。人们不是按照一定顺序进行处理事情,而是倾向于根据在他们的环境中发生的事情(比如,事件)来进行处理。在BPMN规范中,定义了很多事件类型,为了能够覆盖可能在业务环境中出现的各种情况。
3.8.2. Event: None start
event(事件:空启动事件)
A start event
indicates the start of process (or a subprocess). Graphically, it is visualized
as a circle with (possibly) a small icon inside. The icon specifies the actual
type of event that will trigger the process instance creation.
一个启动事件指示流程(或子流程)的开始。它看起来是一个圆(可能)内部有一个小图标。图标表示了事件的实际类型,将会在流程实例创建时被触发。
The 'none start
event' is drawn as a circle without an icon inside, which means that the
trigger is unknown or unspecified. The start activity of JPDL basically has the
same semantics. Process instances whose process definition has a 'none start
event' are created using the typical API calls on the executionService.
空启动事件用一个圆来表示,内部没有图标,意思是这个触发器是未知或者未指定的。这与jPDL的开始活动是一样的。 流程实例的流程定义中包含了一个空启动事件,可以使用executionService的调用创建。
A none start event
is defined as follows. An id is required, a name is optional.
一个空启动事件定义如下。id是必需的,name则是可选的。
<startEvent id="start" name="myStart" />
3.8.3. Event: None end
event(事件:空结束事件)
An end event indicates
the end of an execution path in a process instance. Graphically, it is
visualized as a circle with a thick border with (possibly) a small icon inside.
The icon specifies the type of signal that is thrown when the end is reached.
结束事件表示流程实例中一个流程路径的结束。它看起来就是一个圆拥有厚边框(可能)内部有小图标。图标表示了流程结束的时候那种信号将会被抛出。
The 'none end event'
is drawn as a circle with thick border with no icon inside, which means that no
signal is thrown when the execution reaches the event. The end activity in JPDL
has the same semantics as the none end event.
空结束用一个拥有厚边框的圆,内部没有图标来表示,这意味着当流程到达事件时,不会抛出任何信号。与jPDL中的结束事件的语义相同。
A none end event is
defined as follows. An id is required, a name is optional.
空结束事件定义如下。id是必需的,name则是可选的。
<endEvent id="end" name="myEnd" />
The following
example shows a process with only a none start and end event:
下面的例子显示了只使用空开始和结束事件的流程:
The corresponding
executable XML for this process looks like this (omitting the definitions root element for clarity)
这个流程对应的可执行XML像这样(忽略声明用的definitions根元素)
<process id="noneStartEndEvent" name="BPMN2 Example none start and end event">
<startEvent id="start" />
<sequenceFlow id="flow1" name="fromStartToEnd"
sourceRef="start" targetRef="end" />
<endEvent id="end" name="End" />
</process>
A process instances
can now be created by calling the startProcessInstanceXXX operations.
现在可以通过调用startProcessInstanceXXX操作,创建一个流程实例。
ProcessInstance processInstance = executionService.startProcessInstanceByKey("noneStartEndEvent");
3.8.4. Event: Terminate
end event(事件:终止结束事件)
The difference
between a 'terminate' and a 'none'
end event lies in the
fact how a path of execution is treated (or a 'token' in BPMN 2.0 terminology).
The 'terminate' end event will end the complete process instance, whereas the
'none' end event will only end the current path of execution. They both don't
throw anything when the end event is reached.
终止和空结束事件的区别是实际中流程的路径是如何处理的(或者使用BPMN 2.0的术语叫做token)。 终止结束事件会结束整个流程实例,而空结束事件只会结束当前流程路径。他们在到达结束事件的时候都不会抛出任何信息。
A terminate end
event is defined as follows. An id is required, a name is optional.
一个终止结束事件定义如下。id是必需的,name则是可选的。
<endEvent id="terminateEnd" name="myTerminateEnd">
<terminateEventDefinition/>
</endEvent>
A terminate end
event is depicted as an end event (circle with thick border), with a full
circle as icon inside. In the following example, completing the 'task1' will
end the process instance, while completing the 'task2' will only end the path
of execution which enters the end event, leaving the task1 open.
终止结束事件使用一个拥有厚边框的圆和内部图标为实心圆来表示。在下面的例子中,完成task1会结束流程实例,当完成task2时只会结束到达结束事件的流程路径,而task1保持为打开状态不变。
See the examples
shipped with the jBPM distribution for the unit test and XML counterpart of
this business process.
可以参考jBPM发布包中的示例,单元测试和业务流程对应XML。
- 大小: 2.3 KB
- 大小: 11.3 KB
分享到:
相关推荐
yaoqiang BPMN2.0设计器是一款专为流程图设计打造的工具,主要用于支持Activiti和JBPM等流行的业务流程管理系统。BPMN(Business Process Modeling Notation)是一种国际标准,它为业务流程建模提供了图形化表示,...
jbpm-bpmn2-5.1.0.Final.jar jbpm5
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.GA.zip
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
jbpm-jpdl-designer-site-3.1.7.zip jbpm-jpdl-designer-site-3.1.7.zip jbpm-jpdl-designer-site-3.1.7.zip
5. **创建工作流程定义(BPMN2文件)**: 利用jBPM插件提供的流程设计器,可以创建和编辑`.bpmn2`文件,定义业务流程。设计器会自动生成对应的XML文件,描述流程的结构和逻辑。 6. **编写测试代码**: `src`目录下...
jbpm-jpdl-suite-3.2.GA.zip
jbpm-jpdl-suite-3.2.GA.zip
BPMN 2.0是业务流程模型与符号的第二版标准,旨在提供一套广泛适用于业务分析、流程设计、实现以及用户管理监控的流程建模符号。它主要被业务用户和建模者使用,通过一套清晰的图形化表示方法,允许业务流程的各个...
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-jpdl-suite-3.2.GA.zip
jbpm-designer作为jBPM的一部分,通过Web界面提供了一个用户友好的BPMN2.0模型创建环境。用户可以利用其拖放式界面,创建、编辑和保存流程图,这些流程图符合BPMN2.0标准,确保了流程图的标准化和可交换性。此外,...
第 1 章 简介 1.1. 目标读者 这个开发指南是为了给有经验的开发者看的, 这样就可以获得jBPM 的完全的灵活性。在这个开发 文档中提及的特性 可能当前不会...第 3 章 BPMN 2.0 介绍如何在jBPM 中使用BPMN 2.0 流程语言。
jbpm-persistence-jpa-5.1.0.Final.jar jbpm5
jbpm-6.0.0.Final-installer-full.tar.gz
常用jar包二十几个 bsh-1.3.0.jar commons-dbcp-1.2.1.jar commons-fileupload-1.2.1.jar commons-io-1.3.2.jar commons-logging-1.0.4.jar commons-pool-1.2.jar dom4j-1.6.1.jar freemarker-2.3.13.jar jbpm.sar....