Chapter 2. 背景說明
2.3 基本假設與符號定義
工作流程規格描述一個或數個工作流程實例 (instances) 的正規定義,並記 錄參與的processes、流向、資料,以及資源。正規的工作流程規格定義,可以 用3-tuple < N, F, R> 方式來表示一個工作流程規格 ws,其中 N 表示參與的 processes 集合 {n1,n2,...,nk},F 定義流向集合{ f1, f2,...,fm},R 記錄各 process 操作時會使用、參考到的相關資源集合之總集合。
上述processes 集合{n1,n2,...,nk}當中的每個 process 可區分為兩種類別,
一種是activity processes,而另一種是 control processes。activity processes 負責 執行任務,常見的執行方式是透過人機互動、或是以軟體代理程式 (agent) 自 動完成。control processes 屬於邏輯式的選擇,目的是主動根據策略作出決策。
本文中討論四種類型的control processes,分別是:(1) and-join, (2) and-split, (3) xor-join, (4) xor-split, 這些點的說明與解釋詳細列於 Figure 4 當中。
Figure 4 Control processes
A A-S
B
C
A-J D
A XO-S
B
C
XO-J D
A, B, C, D: Activity processes that perform tasks
A-S: And-Split that forks into each successor activity with related data A-J: And-Join that synchronizes each parent activity with related data XO-S: Exclusive Or-Split that chooses one successor activity to perform XO-J: Exclusive Or-Join that merges one parent activity to one activity
一個工作流程規格,擁有唯一的起始點,與數個結束點。F 定義工作流程 中流向集合{ f1, f2,...,fm},每一條流向 f 以i fi =<na,nb >的方式來記錄,描述 process n 執行後執行 process a n ,其中 b n ,a nb∈N 。
資源集合 R 描述表示為{R1, R2, …, Rn }記錄工作流程中各 activity process 所需要的資源,每一個Ri set 分別對應到 activity process n ,set 當中記錄相關i 所需的哪些資源 r 集合。 i
底下 Figure 5 舉例說明,以一個有向無循環的圖形(DAG),可大致表示一 個工作流程規格所使用的正規定義。每個資料集合 Ri 當中的元素表示此所需 參考、使用到的資源集合,φ 則表示此activity process 不需要參考或使用任何 資源。
Definition 1 (Workflow Specification)
ws = <N, F, R> is a workflow specification where (1) N: a set of processes
∈
∀n N, n.TYPE ∈ {ACTIVITY, AND-SPLIT, XOR-SPLIT, AND-JOIN, XOR-JOIN}
(2) F: a set of flows
∈
∀f F, f =<ni,nj >, there exists a transition from ni to nj f is an out-flow of ni, and f is an in-flow of nj respectively ni is a source process of f, and nj is a sink process of f
respectively
(3) R: a set of resource sets
∀Ri∈R, Ri= {rj|rj is a resource accessed by ni, ni∈N }
Figure 5 A basic workflow specification diagraph
接著定義路徑(path)、可達性(Reachability)、路徑長度(distance)、以及最近 共同祖先(nearest common ancestor)等項目,這些項目將會在後續的討論當中使 用到。[2]
Definition 2 (Path and acyclic path)
Let p=<n1,n2,...,nt >, where ni∈N,i=0,1,...,t, be a sequence. If
Definition 5 (Nearest common ancestor)
Given two processes ni and nj in a workflow specification, their nearest common ancestor is the process, which is a common ancestor and has the shortest distances to them, denoted as nnca.
Definition 4 (Distance)
The distance between two processes n and j n in a workflow i
specification can be computed as follows:
⎪⎩
Definition 3 (Reachability)
Process n is reachable from process j ni if there is an acyclic path
>
=<ni nj
p ,..., on ws.
Let Reachable(ni,nj) be a Boolean function to denote the reachability from process n to i n such that j
2.4 資源限制的一致性
2.4.1 資源
在一個工作流程中,activity process 常常需要存取部分資源以協助其完成 預期的工作內容。資源包含軟體、硬體設備,例如印表機、文件資料,亦或是 中央資料庫中的一筆記錄等等。
資源大致上可分為共享資源或是私有資源,由於私有資源屬於該活動點自 我運作時參照使用,所以不需列入資源一致性分析。共享資源當中,允許多個 活動同時存取、或是依據活動存取模式決定資源可否被存取的類型,也不列入 考量。就是僅考量屬於嚴格的不可同步存取的資源。[2]
2.4.2 潛在的資源衝突
資源衝突是指兩個或兩個以上的activity processes,在執行時期同時間參考 到共同的資源。在同一工作流程規格中,兩個 activity processes 會產生潛在資 源衝突 ( potential resource conflict ),須符合下列兩項檢驗條件:
(1) activity processes ni,nj ∈N 且 i ≠ ,若 j n ,i nj 所需要存取的資源有
交集,亦即 Ri IRj ≠φ,則稱 n ,i nj 有「資源相依」關係。( resource
dependency )
(2) n ,i nj 不在同一條路徑上,且其最近共通祖先點 (nearest common ancestor) 有 AND-SPLIT 類型的控制點。也就是說,n ,i nj 處在可能 同時執行的兩條平行路徑上。