a university for the world real r © 2009, chapter 3 advanced synchronization moe wynn wil van der...
TRANSCRIPT
a university for the worldrealR
WW LLLYYY AA
© 2009, www.yawlfoundation.org YYY
Chapter 3Advanced Synchronization
Moe Wynn
Wil van der Aalst
Arthur ter Hofstede
a university for the worldrealR
2WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Overview
• Introduction• Informal semantics• Formal semantics• Algorithm• Optimisation• Conclusions
a university for the worldrealR
3WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
The Many Ways to Join
• When is task D enabled?• Three choices: XOR, AND, and OR
• AND-join– Full synchronization
• XOR-join– No synchronization
• OR-join– Active paths synchronization
A
B D
C
a university for the worldrealR
4WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Non-local semantics of a General OR-Join ("bus driver semantics")
a university for the worldrealR
5WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Advanced Synchronization: OR-join
• Synchronization is only performed for active threads
• Difficult to formally capture a desired informal semantics
• Difficult to determine when to enable an OR-join task
• Synchronizing Merge pattern in Workflow patterns
a university for the worldrealR
6WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Different interpretations
• OR Gateway in BPMN• OR-join in Event-driven Process Chains (EPCs)• OR-join in workflow systems e.g. InConcert, eProcess,
MQ workflow
• Syntactic restrictions• Vicious Circles• Local semantics• No formal semantics
a university for the worldrealR
7WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Informal semantics
a university for the worldrealR
8WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
OR-join• An OR-join is enabled at a marking iff
– there is at least one token in one of its input conditions and– It is not possible for more tokens to arrive in other empty input
conditions in the reachable markings from the current marking
• An OR-join task is not enabled at a marking iff– it is possible to place tokens in the unmarked input conditions of an OR-
join task in the reachable markings from the current marking
A
B
C
D
c1
c2
c3
c4
c5
c6
E
Enabled?
a university for the worldrealR
9WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Challenges
• How to capture the non-local semantics? • Formal semantics without syntactical restrictions
– Structural restrictions - InConcert, eProcess, MQ Workflow (acyclic)
– True/False tokens• Complications for complex workflows
– Unstructured– Cancelation regions – Multiple OR-joins– Loops
a university for the worldrealR
10WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Unstructured workflows
A
B
C
D
c1
c2
c3
c4
c5
c6
E F
• E should only wait for tokens in c5 and c6 (two paths)• Not the three paths from the corresponding OR-split after A
a university for the worldrealR
11WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Cancelation regions
A
B
C
D
c1
c2
c3
c4
c5
c6
E
• Cancellation region of task D – c2, C, c5• M=c2+c3+c4 -C-> M’= c3+c4+c5, E is not enabled• M=c3+c4+c5 -D-> c4+c6 (Remove token from c5), E is enabled• How to predict that E should be enabled at c3+c4+c5 without doing
a reachability analysis?
a university for the worldrealR
12WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Multiple OR-joins
A
c1
c2 B
C
D
E
F
c3
c7c4
c5 c6
• Two OR-joins E and F• What happens at marking c1+c3?• How should we treat E when considering when F should be
enabled?
a university for the worldrealR
13WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Formal semantics
a university for the worldrealR
14WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Considerations
• How to deal with complex constructs supported in YAWL?– Unstructured workflows– Cancelation, hierarchy, multiple instances, loops– Multiple OR-joins
• Reset nets – extend Petri nets with reset arcs • OR-join semantics are defined in terms of Reset nets
– Support for cancelation regions
a university for the worldrealR
15WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Reset nets1. Transition removes all tokens and not just one when it fires
2. Reset action can be ineffective
3. A reset arc can affect any place in the entire net
•Reachability notion is undecidable for reset nets with more than two reset arcs•Coverability notion is decidable using backwards firing algorithm
Complexity of a reset arc
a university for the worldrealR
16WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Backwards firing rule
• Backwards search techniques of Well-structured Transition Systems
• Input places that are not reset places– Add one token
• Output places that are not reset places– Remove one token
• Reset places that are also input places– Add one token (coverability)
a university for the worldrealR
17WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Semantics (Reset nets)
• An OR-join in a YAWL net is enabled at a marking M iff– M has tokens in one or more input conditions of the
OR-join and– there is no marking in the future states of the
corresponding reset net that covers M.
a university for the worldrealR
18WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Transformations
t
p1
AND-joint
pN
p1
XOR-join t
tp
pN
p1
AND-splitt
pN
p1
XOR-splitt
OR-splitt
pN
pN
YAWL Reset net
ts tept
p1
ts
pN
pt
p1 tsp1
pN
pt
tspN
ts teptp
YAWL Reset net
pN
p1
tept
pN
p1tep1
pt
tepN
pN
p1tep1
pt
tepN
tep1N
p1
a university for the worldrealR
19WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Constructs affecting the semantics
• Cancelation regions (reset nets)• Structured, unstructured and infinite loops (coverability)• Composite tasks, Multiple instances (atomic tasks)• Multiple OR-joins
• Ignore other OR-joins
• Treat them as AND-joins (Pessimistic)
• Treat them as XOR-joins (Optimistic)
a university for the worldrealR
20WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Characteristics
• General – no syntactical restriction– closely matches the informal semantics– behave as expected even for unsound nets
• Formal– defined using reset nets formalism – decided using backwards coverability algorithm
• Decidable– algorithm is applicable for workflows with
cancelation, multiple OR-joins and loops
a university for the worldrealR
22WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Algorithm
1. Transform a YAWL net into a Reset-net
2. Generate a set of possible enabling markings X
3. For each marking x in X, generate a set of backwards coverable markings X’
4. Check if the current Marking M or a smaller marking is found in X’
5. If so, returns False – the OR-join is not enabled at M
6. Otherwise, returns True - the OR-join is enabled at M
a university for the worldrealR
23WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
At marking c1+c7 task G is enabled if and only if ....
Example
a university for the worldrealR
24WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
At marking c1+c7 task G is enabled if and only if ....
... it is possible to cover c6+c7!
Example (Reset net)
a university for the worldrealR
25WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
G is not enabled !
a university for the worldrealR
26WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Carrier Appointment Example
the freight is physically picked up
[no delivery information]
[Truck-Load (TL)] [Single Package (SP)]
[Less than Truck-Load (LTL)]
[else: both]
[no delivery information]
[no pickup information]
4-eye pattern
Prepare Route GuideEstimate Trailer
Usage
Prepare Transportation Quote
CarrierTimeout
Arrange Delivery Appointment
Arrange Pickup Appointment
Create Bill of Lading
c1
o: Client Liaison c: Warehouse Officer
Arrange Delivery Appointment
[else]
Arrange Pickup Appointment
Arrange Delivery Appointment
Arrange Pickup Appointment
Arrange Delivery Appointment
Create Shipment Infomation Document
sArrange Pickup
AppointmentArrange Delivery
Appointment
Modify Pickup Appointment
Modify Pickup Appointment
Modify Delivery Appointment
Modify Delivery Appointment
ProduceShipment Notice
s: Supply Officer
o: Client Liaison
o: Client Liaison
o: Client Liaisono: Client Liaison
c: Warehouse Officer
s: Supply Officer
c: Warehouse Officer s: Supply Officer
s: Supply Officer c: Warehouse Officer
c: Warehouse Admin Officer
Arrange Pickup Appointment
Arrange Delivery Appointment
s: Senior Supply Officer: Masters in SC & L Mgt
Create Carrier Manifest
s: Senior Supply Officer: Masters in SC & L Mgt
c4
c2
c3
Complete Pick up / Delivery
[Truck-Load (TL)]
[Single Package (SP)]
[Less than Truck-Load (LTL)]
Prepare Route GuideEstimate Trailer
Usage
Prepare Transportation Quote
CarrierTimeout
Arrange Delivery Appointment
Arrange Pickup Appointment
Create Bill of Lading
c2
c3 c4
c1
OR-join Analysis: Create Bill of Ladingc1+c2 -> False (can cover c1+c4)c2+c3 -> False (can cover c3+c4)c1+c4 -> Truec3+c4 -> True
a university for the worldrealR
28WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Optimization
– Structural restriction• Remove parts of the net not associated with an OR-join• Restrict the search space using structural info• Apply once for each OR-join
– Active projection• Ignore parts of the net that cannot be marked from a given
marking• Restrict the search space using marking-dependent info• Apply once for every marking change
a university for the worldrealR
29WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Applying Optimisation to Carrier Appt example
[Truck-Load (TL)]
[Single Package (SP)]
[Less than Truck-Load (LTL)]
Prepare Route GuideEstimate Trailer
Usage
Prepare Transportation Quote
CarrierTimeout
Arrange Delivery Appointment
Arrange Pickup Appointment
Create Bill of Lading
Structural Restriction Region for Create Bill of Lading
Active Projection Region for marking c1+c2
c3 c4
a university for the worldrealR
30WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Implementation in YAWL
• OR-join enabling algorithm– Computationally very expensive
• Engine – Algorithm with optimization techniques
• Editor– Reduction rules for OR-joins– Soundness property– OR-joins in a cycle– Unnecessary OR-joins check
a university for the worldrealR
31WW LLLYYY AA
YYYYY
© 2009, www.yawlfoundation.org
Conclusions
• Introduction– Advanced synchronization: the OR-join construct in YAWL
• Informal semantics– Wait to synchronize and proceed when it is not possible
• Formal semantics– Reset nets, Backwards coverability
• Algorithm– Expensive, repetitive
• Optimization– Structural restriction, Active projection