Activiti in Action(實(shí)戰(zhàn)Activiti)-第一章 BPMN 2.0: what’s in it for developers?(5)
Posted on 2011-01-03 16:06 網(wǎng)路冷眼@BlogJava 閱讀(4034) 評(píng)論(0) 編輯 收藏 所屬分類(lèi): Java 、Java EE 、BPM1.4 Introducing BPMN 2.0 from a developers viewpoint(從開(kāi)發(fā)者的角度介紹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重要的構(gòu)件,我們將構(gòu)件和WfMC和Bruce Silver分類(lèi)相似的詳細(xì)的建模層次。首先,我們以一個(gè)高層建模示例開(kāi)始,而后我們專(zhuān)研一個(gè)更詳細(xì)的流程。Bruce Silver分類(lèi)的層次將在節(jié)1.5討論,然后我們將用Activiti流程引擎實(shí)現(xiàn)第一個(gè)流程。
1.4.1 High-level modeling with BPMN 2.0 (采用BPMN 2.0進(jìn)行高級(jí)建模)
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.
節(jié)1.1,我們討論了一個(gè)訂書(shū)業(yè)務(wù)流程的示例。在圖1.1中,訂書(shū)流程的建模沒(méi)有采用實(shí)際的模型符號(hào)。采用簡(jiǎn)單的或者級(jí)別1調(diào)色板,我們將用另外的方式討論訂書(shū)流程,并將它轉(zhuǎn)換成BPMN 2.0的業(yè)務(wù)流程模型。
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.
這意味著我們不得不增加正式符號(hào)描述訂書(shū)流程。所以,在BPMN 2.0訂書(shū)流程,我們將使用開(kāi)始和結(jié)束事件,并行網(wǎng)關(guān),泳池和任務(wù)。圖1.7展示了采用一個(gè)BPMN2.0調(diào)色板子集建模的訂書(shū)流程。
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 構(gòu)件調(diào)色板簡(jiǎn)單子集描述訂書(shū)流程的高級(jí)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.
在詳細(xì)討論流程之前,讓我們首先看看表1.1中的單個(gè)BPMN 2.0構(gòu)件
Table 1.1 Overview of the BPMN 2.0 constructs used in figure 1.7.
表1.1 在圖1.7中使用的BPMN 2.0構(gòu)件的概貌
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.
既然我們知道單個(gè)BPMN 2.0構(gòu)件的意義,讓我們遍歷全部的流程模型。在我們于圖1.7中所繪的模型使用了泳池和泳道。圖1.7有三個(gè)泳池:客戶(hù),書(shū)籍和出版商。泳池是業(yè)務(wù)流程中執(zhí)行活動(dòng)的不同角色。在書(shū)店泳池里有兩個(gè)泳道,對(duì)書(shū)店里不同的兩個(gè)組織單元進(jìn)行特性化。因?yàn)楸臼纠?,?shū)店是一個(gè)小公司,所以只有銷(xiāo)售和庫(kù)房?jī)蓚€(gè)組織單元。
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).
在業(yè)務(wù)流程模型中,我們關(guān)注書(shū)店,但也包括為出版商完成訂單流程的流程活動(dòng)。流程由一個(gè)客戶(hù)啟動(dòng)。在此繪制為一個(gè)消息流(虛線(xiàn))來(lái)啟動(dòng)一個(gè)開(kāi)始事件(一個(gè)圓圈)。
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.
當(dāng)流程啟動(dòng)時(shí),應(yīng)當(dāng)完成兩個(gè)任務(wù)。它們是支付任務(wù)和存貨檢查任務(wù)。因?yàn)檫@些任務(wù)可以并行執(zhí)行,所以在開(kāi)始事件之后,建模為平行網(wǎng)關(guān)。在存貨檢查之后,用一個(gè)排他網(wǎng)關(guān)進(jìn)行書(shū)籍是否有庫(kù)存的條件邏輯的判斷。當(dāng)書(shū)籍沒(méi)有庫(kù)存,則通過(guò)另外的任務(wù)從出版商訂貨。
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.
當(dāng)書(shū)籍有庫(kù)存,或者是因?yàn)闀?shū)籍已準(zhǔn)備就緒,或者是因?yàn)橥ㄟ^(guò)出版商的額外訂貨,書(shū)籍可以準(zhǔn)備發(fā)貨。但是,在書(shū)籍發(fā)貨之前,我們必須確定支付已成功完成。所以并行網(wǎng)關(guān)用來(lái)聚合任務(wù)。在這些任務(wù)完成之前,將會(huì)向前推進(jìn)。
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.
在兩個(gè)額外任務(wù)的并行網(wǎng)關(guān)執(zhí)行之后,在通過(guò)一個(gè)結(jié)束事件完成流程之前,把書(shū)籍發(fā)送給客戶(hù),并通知客戶(hù)到貨的日期。正如你所見(jiàn),高級(jí)模型并不包括錯(cuò)誤處理或者任務(wù)類(lèi)型定義之類(lèi)的事情。那是我們?cè)谙鹿?jié)討論的內(nèi)容。