1.4 Introducing BPMN 2.0 from a developers viewpoint(从开发者的角度介绍BPMN 2.0)
To become familiar with the important constructs of BPMN, we’ll build up the detail level of modeling similar to the categorization of WfMC and Bruce Silver. First, we start with a high-level model example and then we dive into a more detailed process. Level 3 of the Bruce Silver categorization will be discussed in section 1.5, when we will implement our first process with the Activiti process engine.
为了熟悉BPMN重要的构件,我们将构件和WfMC和Bruce Silver分类相似的详细的建模层次。首先,我们以一个高层建模示例开始,而后我们专研一个更详细的流程。Bruce Silver分类的层次将在节1.5讨论,然后我们将用Activiti流程引擎实现第一个流程。
1.4.1 High-level modeling with BPMN 2.0 (采用BPMN 2.0进行高级建模)
In section 1.1 we looked at a sample book order business process. In figure 1.1 the book order process was modeled without a real model notation. With the simple or level 1 palette in mind, we’ll take another look at the book order process and convert it into a real BPMN 2.0 business process model.
节1.1,我们讨论了一个订书业务流程的示例。在图1.1中,订书流程的建模没有采用实际的模型符号。采用简单的或者级别1调色板,我们将用另外的方式讨论订书流程,并将它转换成BPMN 2.0的业务流程模型。
This means that we have to add a more formal notation to describe the book order process. So in the BPMN 2.0 book order process we’ll use start and end events, parallel gateways, pools and tasks. Figure 1.7 shows the book order process modeled with a simple subset of the BPMN 2.0 palette.
这意味着我们不得不增加正式符号描述订书流程。所以,在BPMN 2.0订书流程,我们将使用开始和结束事件,并行网关,泳池和任务。图1.7展示了采用一个BPMN2.0调色板子集建模的订书流程。
Figure 1.7 A high level BPMN 2.0 model describing the book order process with a simple subset of the BPMN 2.0 construct palette.
图 1.7 采用BPMN 2.0 构件调色板简单子集描述订书流程的高级BPMN 2.0模型
Before discussing the process in more detail let’s first look at the individual BPMN 2.0 constructs in table 1.1.
在详细讨论流程之前,让我们首先看看表1.1中的单个BPMN 2.0构件
Table 1.1 Overview of the BPMN 2.0 constructs used in figure 1.7.
表1.1 在图1.7中使用的BPMN 2.0构件的概貌
Now we know the meaning of the individual BPMN 2.0 constructs let’s walk through the full process model. One of the eye-catching differences between the model we’ve drawn in section 1 and figure 1.7 is the use of pools and lanes. In figure 1.7 there are three pools: Customer, Book store and Publisher. The pools describe the different roles that perform activities in the business process. In the book store pool there are two lanes that characterize the different organizational units within the book store. Because in this example the bookstore is a small company, there’s only a sales and an inventory organizational unit.
既然我们知道单个BPMN 2.0构件的意义,让我们遍历全部的流程模型。在我们于图1.7中所绘的模型使用了泳池和泳道。图1.7有三个泳池:客户,书籍和出版商。泳池是业务流程中执行活动的不同角色。在书店泳池里有两个泳道,对书店里不同的两个组织单元进行特性化。因为本示例中,书店是一个小公司,所以只有销售和库房两个组织单元。
In this business process model we focus on the book store, but we could also include the process activities that are necessary for the publisher to complete the order process. The process is started with a order request by a customer, which is pictured here as a message flow (the dashed line) initiating a start event (a circle).
在业务流程模型中,我们关注书店,但也包括为出版商完成订单流程的流程活动。流程由一个客户启动。在此绘制为一个消息流(虚线)来启动一个开始事件(一个圆圈)。
When the process is started two tasks should be completed, which are the process payment and the check stock tasks. These tasks can be executed in parallel and therefore a parallel gateway is modeled after the start event. After the stock is checked an exclusive gateway is used for the conditional logic of the book being in stock or not. When the book is not in stock it’s ordered from the publisher by an additional task.
当流程启动时,应当完成两个任务。它们是支付任务和存货检查任务。因为这些任务可以并行执行,所以在开始事件之后,建模为平行网关。在存货检查之后,用一个排他网关进行书籍是否有库存的条件逻辑的判断。当书籍没有库存,则通过另外的任务从出版商订货。
When the book is in stock, either because it was already or by an extra order via the publisher, the book is ready for shipment. But before the book will be shipped we must be sure that the payment has been successfully completed. So a parallel gateway is used to join the tasks, meaning that the process will go further before these tasks have been completed.
当书籍有库存,或者是因为书籍已准备就绪,或者是因为通过出版商的额外订货,书籍可以准备发货。但是,在书籍发货之前,我们必须确定支付已成功完成。所以并行网关用来聚合任务。在这些任务完成之前,将会向前推进。
After the parallel gateway two additional tasks are executed that ship the book to the customer and inform the customer about the arrival date before the process is completed by an end event. As you see the high level model doesn’t contain stuff like error handling or the definition of the type of a task. That’s what we will add in the next section.
在两个额外任务的并行网关执行之后,在通过一个结束事件完成流程之前,把书籍发送给客户,并通知客户到货的日期。正如你所见,高级模型并不包括错误处理或者任务类型定义之类的事情。那是我们在下节讨论的内容。