• No results found

3.3 Case Management Model and Notation

3.3.1 Case Type

This section formalizes the definition of a case type and its components. Without losing generality, the concepts of roles and work assignments in a case type can be ignored because

they are irrelevant to the overall execution semantics of CMMN. Therefore, this formalization excludes roles, planning tables, and applicability rules (which specify when planning tables are available for roles to use them).

Definition 3.4. (Case type): In CMMN a case is composed of an information model and a

behavioral model. The Case Type T is defined by its data D, and its behavior B, and is described as the tuple

T = hD, Bi where,

D is a set of data attributes that describe the case information model. The model starts with a case file, which is a container that holds all of the data belonging to a case instance. The schema of the case file allows for scalars, records of scalars, and containers such as sets, hierarchical structures, etc. It is also intended to hold structured (records of scalars, database tables, etc.) and unstructured data (documents, pictures, voice recordings, video, etc.). By default it does not contain status data. Elements d ∈ D have a predefined life cycle as described in Figure 5.6.

D = Dcasef ile∪Ddiscrete∪Dcontainer

where,

Dcasef ile is a single element set containing the case file. Each case has a single case file,

which acts as a container for all of the case data.

Ddiscrete is a set of all the discrete data in the case. Discrete data can be structured or

unstructured.

Dcontainer is a set of data containers, with its root being the case file.

B is a tuple describing the case’s behavioral model (see Definition 3.5).

Definition 3.5. (Case behavior): The behavior B of a case type T is described by its stages

St

,

tasks

Ta

, milestones

Mi

, event listeners

Ev

, hierarchy

H

, and rules

R

. The case behavior

is described by the tuple

B = h

St

,

Ta

,

Mi

,

Ev

,

H

,

R

i where,

St

is a set of stages. It is partitioned into four types of stages (a single case plan, planned

stages, discretionary stages, and plan fragments). All four types of stages have different

characteristics, but all of them are behavioral containers.

where,

St

case is a single element set. The elements represent the case plan. The life cycle of

the case plan is described in Figure 5.4.

St

planned is a set of planned stages. These are stages contained in the execution plan,

as opposed to discretionary stages that can be manually added to the execution plan during runtime.

St

discretionary is a set of discretionary stages. The life cycle for elements of both planned

stages

St

planned and discretionary stages

St

discretionary is described in Figure 5.8.

St

f ragment is a set of plan fragments. Plan fragments are groups of discretionary items.

Plan fragments do not have any execution semantics.

St

case,

St

planned,

St

discretionary, and

St

f ragment are pairwise disjoint.

Ta

is a set of tasks. The set of tasks

Ta

is partitioned into two types of tasks (planned tasks

and discretionary tasks).

Ta

=

Ta

planned

Ta

discretionary

where,

Ta

planned is a set of planned tasks.

Ta

discretionary is a set of discretionary tasks. The life cycle for elements of both planned

tasks

Ta

planned and discretionary tasks

Ta

discretionary is described in Figure 5.8.

Ta

planned and

Ta

discretionary are pairwise disjoint.

Mi

is a set of milestones. The life cycle of milestones is described in Figure 5.10.

Ev

is a set of event listeners. The life cycle of event listeners is described in Figure 5.10.

H

is a binary relationship (

H

St

× {

St

Ta

Mi

Ev

}) describing a hierarchical organization of stages

St

, tasks

Ta

, milestones

Mi

, and event listeners

Ev

in the case.

R

is a tuple that describes the rules governing the behavior of the case type (see Defini- tion 3.7).

Definition 3.6. (Case hierarchy): Stages

St

in the case type can be nested within other

stages. In addition, stages can contain tasks, milestones, and event listeners thereby creating a hierarchy in the case type. The case hierarchy

H

is a binary relationship (

H

St

× {

St

Ta

Mi

Ev

}) that describes the organization of the case type. The hierarchical

relationship is defined as a set of ordered pairs

H

={hx, yi | x ∈

St

∧ y ∈

St

Ta

Mi

Ev

∧ x 6= y ∧ y is reachable from x ∧ ¬(∃z)(z ∈

St

∧ z is reachable from x ∧ y is reachable from z)}

The hierarchy of a case type implements a tree, with the root of the tree being the single element in

St

case (¬(∃hx, yi)(hx, yi ∈

H

∧ y ∈

St

case)). The leaves of the tree correspond

to tasks in

Ta

, milestones in

Mi

, and event listeners in

Ev

. The non-leaf nodes of the tree are composite stages in

St

. Elements in this tree are said to be “reachable” from x, if they

are present in the sub-tree with root x.

Definition 3.7. (Case behavioral rules): The rules of a case type

R

are described by its

conditionsϕb, sentries S , entry criteriac E , exit criteriab X , manual activationc M , requiredc b

R, repetitionN rules, and autocompletec A . The rules are defined as a tuplec

R

= hϕ,b S ,cE ,b X ,cM ,cR,b N ,cA ic

where,

b

ϕ is a set of Boolean expressions defined in a similar way as ϕ in a sentry (see Definition 3.8),

but is used for rules instead of for sentries.

c

S is a set of sentries. Sentries are defined in a similar way to the way they are in GSM. The main difference is that a sentry in CMMN may have multiple event expressions ˙ξ.

b

E is an entry criteria relation that associates a sentry with a stage, task, or milestone that will be activated when the sentry is satisfied. It is a binary relationship (E ⊆b

c

S × {

St

planned

St

discretionary

Ta

Mi

}) defined as follows:

b

E = {hx, yi | x ∈S ∧ y ∈ {c

St

planned

St

discretionary

Ta

Mi

} ∧ x entry criteria of y}

c

X is an exit criteria relation that associates a sentry with a stage or task that will terminate when the sentry is satisfied. It is a binary relationship (X ⊆c S × {c

St

case

St

planned

St

discretionary

Ta

}) defined as follows:

c

X = {hx, yi | x ∈S ∧ y ∈ {c

St

case

St

planned

St

discretionary

Ta

} ∧ xexit criteria of y}

c

M is a manual activation relation that associates a Boolean expression with a stage or task that will require manual activation. It is a binary relationship (M ⊆c

b

ϕ × {

St

planned

St

discretionary

Ta

}) defined as follows:

c

b

R is a required relation that associates a Boolean expression with a stage, task, or milestone that indicates when these are required. It is a binary relationship (R ⊆b ϕ × {b

St

planned

Ta

planned

Mi

}) defined as follows:

b

R = {hx, yi | x ∈ϕ ∧ y ∈ {b

St

planned

Ta

planned

Mi

} ∧ xrequired rule of y}

c

N is a repetition relation that associates a Boolean expression with a stage, task, or milestone that indicates that these can repeat execution. It is a binary relationship (N ⊆c

b

ϕ × {

St

planned

St

discretionary

Ta

Mi

}) defined as follows:

c

N = {hx, yi | x ∈ϕ ∧ y ∈ {b

St

planned

St

discretionary

Ta

Mi

} ∧ xrepetition rule of y}

c

A is a set of stages with an autocomplete flag.

c

A = {a | a ∈

St

case

St

planned

St

discretionaryautoComplete(a)}

Definition 3.8. (CMMN Sentry): A CMMN sentry x inS for a case type T is an expressionc

˙χ ˙χ =           

[on ˙ξ if ϕ] event expression ˙ξ and condition ϕ [on ˙ξ] event expression ˙ξ only

[ if ϕ] condition ϕ only

where, ˙ξ is an optional event expression comprising one or more events, and ϕ is an optional well-formed Boolean expression that may or may not use attributes from D. A CMMN sentry ˙χ differs from a GSM sentry χ in the event expression. While the event expression ξ of a GSM sentry χ comprises a single event, the event expression ˙ξ of a CMMN sentry ˙χ comprises one or more events. An event expression ˙ξ having n events (n > 0) is expressed as an unordered tupleJe1, . . . , enK, where each event is a CMMN standard event. We write the event e as <state transition>:<element>, where the element is one of the following:

• Data element (x ∈ D) with the state transition described in Figure 5.6. • Case instance (

St

case) with the state transition described in Figure 5.4.

• Stage and task elements (x ∈

St

planned ∨ x ∈

St

discretionary ∨ x ∈

Ta

) with the state

transition described in Figure 5.8.

• Event listener and milestone elements (x ∈

Ev

∨ x ∈

Mi

) with the state transition described in Figure 5.10.

A condition ϕ can access all of the data in D, and can be used to reason about the state of elements as defined in Figures 5.4, 5.6, 5.8 and 5.10.