This section presents a conversion from an artifact type Γ (see Definition 3.1) into a Case type T (see Definition 3.4). While the syntactical transformation between an artifact type Γ into a Case type T is achievable CMMN does not have the concepts of snapshot and Business step (B-step) that formally describe the GSM operational semantics. CMMN execution semantics are event-driven, described by rules (i.e., stage autocomplete, manual activation, required, repetition, and applicability rules) and by the entities’ life cycle (see Figures 5.4, 5.6, 5.8 and 5.10) [OMG14a]. Implementation details are left to the vendors, in particular the order in which events are processed is not defined. Therefore, different vendors may implement CMMN’s execution semantics slightly differently, and so there is no guarantee that a converted artifact type Γ will execute in CMMN in the same way that it did in GSM. The transformation of an artifact type into a case type assumes that the target CMMN engine supports Object Constraint Language (OCL) [OMG14b] as an expression language, and allows expressions to access the state of the CMMN objects’ life cycle. The CMMN specification allows implementations to support multiple expression languages. It is therefore natural to continue using OCL during the transformation, which is the only expression language supported by GSM.
Definition 5.1. (From an Artifact type Γ to a CMMN case type T): Given an artifact type
Γ = h Att, EType, Stg, Mst, Stry, Lcyc i with Lcyc = h Substages, Tasks, Submilestones, Guards, Terminators, Ach, Inv i. The corresponding case type T will have the following
form,
TΓ= hDΓ,BΓi Where,
DΓ = {d | d ∈ Attdata} ∪ {md| mExpr(m)}
BΓ = h
St
Γ,Ta
Γ,Mi
Γ,Ev
Γ,H
Γ,R
ΓiSt
Γ = {s | s ∈ Stg}Ta
Γ = {t | (∃S)(S ∈ Stg ∧ t = Tasks(S))} ∪{mi | mExpr(m)}∪{ma| mExpr(m)}
∪{ei | e ∈ ETypeinc ∧ Payload(e)}
Ev
Γ = {e | e ∈ ETypeinc ∧ noPayload(e)}H
Γ = {hx, yi | x ∈ Stg ∧ (y = Substages(x) ∨ y = Submilestones(x) ∨ y = Tasks(x))} ∪{hcase, yi | topLevelStage(y)}∪{hcase, eii | e ∈ ETypeinc ∧ Payload(e)}
∪{hx, mii | x ∈ Stg ∧ mExpr(m) ∧ m = Submilestones(x)}
∪{hx, mai | x ∈ Stg ∧ mExpr(m) ∧ m = Submilestones(x)}
R
Γ = hϕ,b S ,cE ,b X ,cM ,cR,b N ,cA , icb
ϕ = {c | (∃y)(y ∈ Stry ∧ c = ifconvert(y))}
The Boolean condition in the artifact type sentries is converted to case type Boolean conditions.
c
S = {s | (∃y)(y ∈ Stry ∧ s = convert(y))}
The set of artifact type sentries is converted to case type sentries.
b E = {hx, yi | y ∈ Stg ∧ x = convert(Guards(y)) ∨ y ∈ Tasks ∧ x= convert(Guards(y)) ∨ y ∈ Mst ∧ mExpr(m) ∧ x = convert(Ach(y))} ∪ {hx, mii | mExpr(m) ∧ x = convert(Inv(m))} ∪ {hx, mai | mExpr(m) ∧ x = convert(Ach(m))}
The case type entry criteria relationship is populated with the guards for stages, tasks, and milestones. In addition, the generated tasks used to update the milestone status get the corresponding achieved and invalidated guards.
c
X = {hx, yi | y ∈ Stg ∧ x = convert(Terminators(y))}
The exit criteria relationship is populated with the artifact type sentries for terminators.
c
M = ∅
GSM does not support the concept of manual activation.
b
R = ∅
GSM does not support the concept of required.
c
N = {htrue, yi | y ∈
St
∪Ta
∪Mi
}In GSM all of the stages, tasks and milestones are repeatable.
c
A = {a | a ∈
St
} ∪ {case}In GSM all of the stages are automatically terminated when the terminator is achieved, and no manual intervention is needed.
md is a Boolean property for milestone m ∈ Mst. This property is only created for milestones
that can be invalidated in the artifact type, and allows the milestone to maintain its status.
mi is a task that sets the value of md to false, when the milestone is invalidated.
ma is a task that sets the value of mdto true, when the milestone is achieved.
mExpr(x) is a predicate that is true if x is a milestone (x ∈ Mst) and has both an achieving
and invalidating sentry ((∃g, j)(g = Inv(m) ∧ j = Ach(m))), and the value of x is used in a sentry condition expression ϕ.
Payload(x) is a predicate that is true if the event x has a payload.
noPayload(x) is a predicate that is true if the event x does not have a payload.
topLevelStage(x) is a predicate that is true for x ∈ Stg when x is a top level stage (@y)(x =
Substages(y)).
convert(x) is a function that uses onconvert(x) and ifconvert(x) to convert a GSM sentry
into a CMMN sentry.
ifconvert(x) is a function that converts the condition expression of a GSM sentry ϕ into a
valid CMMN condition expression by replacing all of the references to Attstages and to
Attmilestones with a reference to the correct state as shown in Figures 5.8 and 5.10. In
the case of milestones that test for ¬m, the generated md property is used.
replaces references to S (S ∈ Attstages) with S.Active.
replaces references to ¬S (S ∈ Attstages) with ¬S.Active.
replaces references to m (m ∈ Attmilestones) with m.Completed.
replaces references to ¬m (m ∈ Attmilestones) with ¬md.
add ¬mdfor milestones that test for −m in the ξ expression.
onconvert(x) is a function that converts the event expression of a GSM sentry ξ into a
valid CMMN event expression ˙ξ by replacing all of the generated events with state transitions as shown in Figures 5.8 and 5.10. In the case of milestones that test for −m, the generated mdproperty is used.
replaces +m (milestone m is triggered) with <occur>:m. replaces −m (milestone m is triggered) with <update>:md.
replaces +S (stage S open) with <start>:S. replaces −S (stage S closes) with <complete>:S. replaces I:t (task t is invoked) with <start>:t.
replaces C:t (task t completes) with <complete>:t.
replaces E:e (incoming event e with no payload arrives) with <occur>:e. replaces E:e (incoming event e with payload arrives) with <complete>:ei.
The notion of invalidating a milestone does not exist in CMMN. Therefore, to deal with mile- stones for which there is an invalidation sentry in the artifact type (m ∈ Mst such that (∃g)(g = Inv(m)) a Boolean property (md) is created to maintain the state of the milestone, and two tasks (maand mi) are used to set the Boolean property to true when the milestone is achieved,
and to false when it is invalidated. The entry criteria for these two tasks are the same sentries used by the milestone for achieving (Ach(m)) and invalidating (Inv(m)) it. The onconvert(x) function makes use of the milestone Boolean property as required to convert an expression that makes use of the milestone status (Attmilestone).
CMMN does not have the notion of an incoming event with a payload. Therefore, a map of incoming events without payloads to event listeners is created. In CMMN incoming events with a payload need to be processed by a task. Therefore, a map of incoming events with payloads to tasks ei without entry criteria is created to listen to the incoming events. The
onconvert(x) function maps incoming event expressions to a CMMN standard event on an event listener for events without payloads, or to standard events of the tasks listening for the incoming message.
5.2.1 Example
Using the example taken from Eshuis et al. [Esh+13], described in Section 3.2.2 and presented in Figure 3.3, this researcher converted the GSM artifact type into a CMMN case type. The resulting case type is depicted in Figure 5.2.
All five milestones present in the original artifact type have invalidating sentries (see Table 3.2) and these are used in other sentries’ condition expressions ϕ. Therefore, new ma and mi
tasks were generated for each milestone, as well as new Boolean attributes md (see rule 6
in Table 3.1, and rules 21 and 22 in Table 3.2). There is one incoming event (Regulation Changein rule 24 in Table 3.2) without a payload, which is converted into an event listener. All of the resulting entry and exit criteria for the deal case type presented in Figure 5.2 are shown in Table 5.1.
Deal
Create Deal
+
Deal Drafted
Propose Offer Letter
- Deal Declined Deal Agreed Create Offer Letter + Offer Letter Created Propose Offer Letter + Offer Letter Proposed Refine Deal - ReCheckCredit Needed Draft Term + Term Drafted Check Credit Credit Checked Deal Failed Deal Refined Determine Price + Price Determined ReDraftTerm Needed Regulation Change ReCheck Credit Neededa ReDraft Term Neededa Credit Checkeda Term Drafteda Price Determineda ReCheck Credit Neededi ReDraft Term Neededi Credit Checkedi Term Draftedi Price Determinedi
Figure 5.2: The deal case model in CMMN
The IBM Global Financing (IGF) example from Figure 3.3 transformed into CMMN.
Table 5.1:Entry and exit criteria for the Refine Deal stage in Figure 5.2 Entry criteria Exit criteria
Stages
Draft Term
r1: [on start:Refine Deal] r3: [on occur:Term Drafted] r2: [on occur:ReDraftTermNeeded
r4: [on complete:Refine Deal]
if Refine Deal·Active]
Determine Price
r6: [on occur:Price Determined] r5: [if Term Draftedd r7: [on start:Draft Term]
∧Credit Checkedd r8: [on start:Check Credit]
∧Refine Deal·Active] r9: [on complete:Refine Deal]
Tasks
Check Credit
r10: [on start:Refine Deal] r12: [on occur:Credit Checked] r11: [on occur:ReCheckCreditNeeded
r13: [on complete:Refine Deal]
if Refine Deal·Active]
Term Drafteda r14: [on complete:Draft Term
if Refine Deal·Active]
Table 5.1 – Continued from previous page
Entry criteria Exit criteria
Credit Checkeda r15: [on complete:Check Credit
if Refine Deal·Active]
Price Determineda r16: [on complete:Determine Price
if Refine Deal·Active]
ReDraftTermNeededa
r17: [on occur:Regulation Change
if Refine Deal·Active]
r18: [if credit_level > 100, 000
∧Refine Deal·Active] ReCheckCreditNeededa r19: [if risk_level > 4
∧Refine Deal·Active] Term Draftedi r20: [on start:Draft Term]
r21: [on occur:ReDraftTermNeeded]
Credit Checkedi r22: [on start:Check Credit]
r23: [on occur:ReCheckCreditNeeded]
Price Determinedi
r24: [on start:Draft Term
if ReDraftTermNeededd]
r25: [on start:Check Credit
if ReCheckCreditNeededd]
r26: [on start:Determine Price]
ReDraftTermNeededi r27: [on occur:Term Drafted]
ReCheckCreditNeededi r28: [on occur:Credit Checked]
Milestones
Term Drafted r14: [on complete:Draft Term
if Refine Deal·Active]
Credit Checked r15: [on complete:Check Credit
if Refine Deal·Active]
Price Determined r16: [on complete:Determine Price
if Refine Deal·Active]
ReDraftTermNeeded
r17: [on occur:Regulation Change
if Refine Deal·Active]
r18: [if credit_level > 100, 000
∧Refine Deal·Active] ReCheckCreditNeeded r19: [if risk_level > 4
∧Refine Deal·Active]