Chapter 6 Declarative Workflow
description
Transcript of Chapter 6 Declarative Workflow
![Page 1: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/1.jpg)
a university for the worldrealR
WW LLLYYY AA
© 2009, www.yawlfoundation.org YYY
Chapter 6Declarative Workflow
Maja Pesic
Helen Schonenberg
Wil van der Aalst
![Page 2: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/2.jpg)
a university for the worldrealR
2WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Outline
1 Introduction
2 Constraint-Based Workflow Specification
3 Enactment of Constraint Model Instances
4 Dynamic Instance Change
5 Conclusions
![Page 3: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/3.jpg)
a university for the worldrealR
3WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
1 Introduction
• Why declarative workflows?• Procedural vs. declarative workflows.• Combining procedural and declarative workflows.
![Page 4: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/4.jpg)
a university for the worldrealR
4WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Flexibility vs. Support
![Page 5: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/5.jpg)
a university for the worldrealR
5WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Procedural vs. Declarative Workflow
![Page 6: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/6.jpg)
a university for the worldrealR
6WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Workflow Decomposition
• Combining various workflow languages (e.g., A, B, …, Z)• Combining various approaches (e.g., procedural and
declarative)
![Page 7: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/7.jpg)
a university for the worldrealR
7WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
2 Constraint-based workflow specification
• Specifying constraints with Linear Temporal Logic.• Constraint templates.• Constraints.• The ConDec language.• Constraint workflow models.• Truck Load and Less Than Truck Load ConDec
models.• Verification of constraint models.
![Page 8: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/8.jpg)
a university for the worldrealR
8WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Linear Temporal Logic
Standard operators
• negation: !a• conjunction: a /\ b• disjunction: a \/ b• implication: a -> b• equivalence: a <-> b• true• false
Temporal operators• always: [] a• eventually: <> a• next: O a• until: a U b• weak until: a W b = (<> a) -> (a U B)
![Page 9: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/9.jpg)
a university for the worldrealR
9WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Specifying Constraints with LTL
Automaton can be generated for LTL constraint = exactly the set of all execution traces that satisfy the constraint.
LTL formula for constraint
automaton representing satisfying traces
semantics
<> bill Task bill must be executed at least once.
(! bill) W pickup
Task bill can not be executed until (i.e., before) task pickup is executed.
![Page 10: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/10.jpg)
a university for the worldrealR
10WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Constraint Templates
• “Declarative workflow patterns”• A template has:
– name– LTL formula– graphical representation
existence(A) : <> A init(A): A response(A,B): []( A -> <> B) precedence(A,B): (!B) W A
succession(A,B): response(A,B) /\ precedence(A,B) not co-existence: !( <>A /\ <>B ) 1 of 4(A,B,C,D): <>A \/ <>B \/ <>C \/ <>D
![Page 11: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/11.jpg)
a university for the worldrealR
11WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Constraints
• are created from templates• can be “branched”
![Page 12: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/12.jpg)
a university for the worldrealR
12WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
An Example Language: ConDec
Has more than 30 templates: existence, relation (ordered and not ordered), negative relation, and choice (standard and explicit).
![Page 13: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/13.jpg)
a university for the worldrealR
13WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Constraint Workflow Models
• A constraint model has:– set of tasks: T={t1,t2,…,tn}– Set of mandatory constraints (must be followed): CM={cm1,cm2,
…,cmp}
– optional constraints (can be violated): CO={co1,co2,…,cok}
• Traces that satisfy a constraint model are:
– if CM = Ø : all traces, represented by automaton
– if CM ≠ Ø : traces that satisfy formula F= cm1/\cm2/\…/\cmp, represented by automaton automatically generated for F
![Page 14: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/14.jpg)
a university for the worldrealR
14WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Less Than Truck Load (LTTL)
(a) YAWL model
(b) ConDec model
(c) automaton generated for the ConDec model
Constraints:• <> delivery• <> bill• (!pickup) W bill
![Page 15: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/15.jpg)
a university for the worldrealR
15WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Truck Load (TL)
(b) ConDec model
Constraints:• <> delivery• <> bill• <> shipment
(a) YAWL model
![Page 16: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/16.jpg)
a university for the worldrealR
16WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Verification of Constraint Models
By analyzing the automaton generated for the model two types of errors can be detected:
– Dead task is a task that can never be executed. None of the transitions in the automaton allows the task.
– A conflict exists if there is no way to satisfy all mandatory constraints in the model. The generated automaton is empty, there is no trace that satisfies this model.
![Page 17: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/17.jpg)
a university for the worldrealR
17WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Example: Model with a Dead Task
• None of the transitions allows task pickup, i.e., task pickup is dead.
• None of the transitions allows task bill, i.e., task bill is dead.
(a) ConDec model
(b) automaton generated for the ConDec model
![Page 18: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/18.jpg)
a university for the worldrealR
18WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Example: Model with a Conflict
The generated automaton is empty, there is no trace that satisfies this model.
(a) ConDec model
(b) automaton generated for the ConDec model
![Page 19: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/19.jpg)
a university for the worldrealR
19WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Detecting the Cause of Error
By searching through the powerset of mandatory constraints and analyzing these automata, the exact subset of constraints that causes the error can be detected.
![Page 20: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/20.jpg)
a university for the worldrealR
20WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
3 Enactment of Constraint Model Instances
• Instances of Constraint Models• Monitoring States of Constraints• Monitoring State of the Instance• Enforcing Correct Instance Execution• Enforcing Correct Instance Completion• Dynamic Instance Change
![Page 21: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/21.jpg)
a university for the worldrealR
21WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Constraint Model Instance
• Instance = constraint model + trace• Trace is a sequence of executed tasks.• At the end of the execution, instance’s trace must satisfy all
mandatory constraints from instance’s model.• During the execution of one instance it is necessary to:
– monitor constraint states,
– monitor instance state,
– enforce correct execution, and
– enforce correct completion.
![Page 22: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/22.jpg)
a university for the worldrealR
22WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Monitoring Constraint States
• Every time a new task is executed, the states of constraints are “calculated”.
• Based on the current trace a constraint can be:– satisfied, – temporarily violated, the constraint is not satisfied, but it is
possible to satisfy it in the future, and – violated, the constraint is not satisfied and it is not possible to
satisfy it in the future.
![Page 23: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/23.jpg)
a university for the worldrealR
23WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Determining Constraint StatesThe state is determined by the automaton generated form the constraint’s formula:
– satisfied: trace is accepted by the automaton,
– temporarily violated, trace can be replayed on the automaton but it is not accepted by the automaton, and
– violated, trace can not be replayed on the automaton.
(a) precedence constraint and its automaton (b) existence constraint and its automaton
Trace 1State of constraint
(a) (b)
initial sat. (S0) tmp. viol. (S0)
pickup sat. (S1) tmp. viol. (S0)
delivery
sat. (S1) sat. (S1)
bill sat. (S1) sat. (S1)
Trace 2State of constraint
(a) (b)
initial sat. (S0) tmp. viol. (S0)
delivery
sat. (S0) sat. (S1)
Trace 3State of constraint
(a) (b)
initial sat. (S0) tmp. viol. (S0)
delivery
sat. (S0) sat. (S1)
bill viol. (?) sat. (S1)
![Page 24: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/24.jpg)
a university for the worldrealR
24WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Monitoring Instance States
For the instance state everything holds like for the constraint state, but now we use the automaton created for the instance’s model.
Trace 1State of instance
initial tmp. viol. (S0)
pickup tmp. viol. (S1)
delivery
tmp. viol. (S4)
bill sat. (S5)
Trace 2State of instance
initial tmp. viol. (S0)
delivery
tmp. viol. (S2)
Trace 3State of instance
initial tmp. viol. (S0)
delivery
tmp. viol. (S2)
bill viol. (?)
(a) Less Than Truck Load (LTTL) ConDec model
(b) automaton generated for the LTTL model
![Page 25: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/25.jpg)
a university for the worldrealR
25WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Enforcing Correct Instance Execution• Making sure that users do not execute tasks that make the instance violated.
• Enabling only tasks that are allowed by the automaton.
Trace 1Enabled tasks and
executed task
initial pickup, delivery (S0)
pickup bill, pickup, delivery (S1)
delivery
bill, pickup, delivery (S4)
bill bill, pickup, delivery (S5)
Trace 2Enabled tasks and
executed task
initial pickup, delivery (S0)
delivery
pickup, delivery (S2)
Trace 3Enabled tasks and
executed task
initial pickup, delivery (S0)
delivery
pickup, delivery (S2)
billNot possible to execute – bill was not enabled!
(a) Less Than Truck Load (LTTL) ConDec model
(b) automaton generated for the LTTL model
![Page 26: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/26.jpg)
a university for the worldrealR
26WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Enforcing Correct Instance Completion
• Making sure the instance can be closed only when it is satisfied.• Allowing completion only when the automaton is in the accepting state.
Trace 1Enabled tasks and
executed task
initial can’t close (S0)
pickup can’t close (S1)
delivery can’t close (S4)
bill CAN CLOSE (S5)
Trace 2Enabled tasks and
executed task
initial can’t close (S0)
delivery can’t close (S2)
(a) Less Than Truck Load (LTTL) ConDec model
(b) automaton generated for the LTTL model
![Page 27: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/27.jpg)
a university for the worldrealR
27WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Dynamic Instance Change
The change is allowed only if the new model does not bring the instance into the violated state.
(a) original model
(b) automaton generated for the original model Instance 1
Trace State
initial temporarily violated (S0)
pickup temporarily violated (S1)
delivery temporarily violated (S4)
bill satisfied (S5)
Instance 2
Trace State
initial temporarily violated (S0)
pickup temporarily violated (S1)
bill temporarily violated (S3)
delivery satisfied (S5)
![Page 28: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/28.jpg)
a university for the worldrealR
28WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Making Instance Change
(b) new model(b) automaton generated for the new model
Instance 1 (change refused)
Trace State
initial satisfied (S0)
pickup satisfied (S0)
delivery violated (?)
bill
Instance 2 (change accepted)
Trace State
initial satisfied (S0)
pickup satisfied (S0)
bill satisfied (S1)
delivery satisfied (S1)
(a) original model
![Page 29: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/29.jpg)
a university for the worldrealR
29WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
4 Conclusions
• Procedural Workflows and Declarative Workflows• Flexibility and Support in Declarative Workflows
![Page 30: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/30.jpg)
a university for the worldrealR
30WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Procedural Workflows and Declarative Workflows• none is better solution
• should be combined• implementation in YAWL
![Page 31: Chapter 6 Declarative Workflow](https://reader035.fdocuments.in/reader035/viewer/2022070413/56814c5b550346895db97a5c/html5/thumbnails/31.jpg)
a university for the worldrealR
31WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Flexibility and Support in Declarative Workflows
flexibility
• by design• by underspecification• by change• by deviation
support
• model verification• monitoring instance state• monitoring states of
constraints• ensuring correct instance
execution• ensuring correct instance
completion