Você está na página 1de 33

Process Execution and Semantics

Process Mapping and Execution in BPMN 1.X

CS752, November 2012

www.hilcoe.com.et

Process Mapping and Execution in BPMN 2.0

CS752, November 2012

www.hilcoe.com.et

Important features of BPMN 2.0


BPMN 2.0 has a valid Metamodel
A metamodel is a precise definition of the constructs and rules needed for creating specific model Several benefits associated to metamodel:
It formalizes the definition of models and elements It formalizes the relationship between elements It enables interoperability

A valid metamodel is an ontology


CS752, November 2012 www.hilcoe.com.et 4

Important features of BPMN 2.0


BPMN metamodel defines all BPMN entities with all other attributes and relations
Where entities could be any visual shapes like, events, activities or gateways or invisible structures like web service operations or data structures

The metamodel enables interchange, interoperability and execution of models


CS752, November 2012 www.hilcoe.com.et 5

BPMN 2.0 conformance levels


Software compliance or conformance with BPMN 2.0 is achieved, iff, the software fully matches the applicable conformance points specified
Process modeling conformance
BPMN process types, BPMN process elements, visual appearance, structural, attributes, extended and optional elements, visual interchange

Process execution conformance


Execution semantics, import of process diagrams

BPEL Process Execution Conformance Choreography Modeling conformance


BPMN choreography types, BPMN choreography elements, visual appearance, choreography semantics, visual interchange
CS752, November 2012 www.hilcoe.com.et 6

BPMN 2.0 Execution Semantics


The purpose of the execution semantics is to describe a clear and precise understanding of the operation of the elements BPMN execution semantics include:
Process instantiation and termination semantics Semantics of different types of activities
Normal, subprocess, loop, multiple instances

Semantics of different kinds of gateways


Parallel, event based, exclusive,

Semantics of different kinds of events


Start, intermediate, end, event sub-process,

Some elements are non-operational


Manual task, abstract task, ad-hoc subprocess,
CS752, November 2012 www.hilcoe.com.et 7

BPMN 2.0 Execution Semantics


BPMN 2.0 presents an execution semantics that defines precisely how models in the BPMN notation should behave when executed in a tool The execution semantics is defined informally using natural language

CS752, November 2012

www.hilcoe.com.et

Execution semantics of elements are presented in the following structure:


A description of the operational semantics of the element Exception issues for the element where relevant List of workflow patterns supported by the element where relevant

A process can start as a result of any of the following:


Its start event occurs With event based gateways With receive task
CS752, November 2012 www.hilcoe.com.et 9

In these circumstances new process instances will be created and the instantiate flag of the process is set to true. [a runtime b/r] For a Process instance to become completed, all tokens in that instance MUST reach an end node, =>
(1) There is no token remaining within the Process instance, (2) No Activity of the Process is still active.

* Note also that if a token reaches a Terminate End Event, the entire Process is abnormally terminated

CS752, November 2012

www.hilcoe.com.et

10

Description of Some BPMN Elements: FlowElement


Is an abstract super class for all elements that can appear in a Process flow

Flow nodes:
Event Activity ChoreographyActvity Gateway

SequenceFlow

Some attributes of a FlowElement

CS752, November 2012

www.hilcoe.com.et

11

Class diagram for FlowElement

CS752, November 2012

www.hilcoe.com.et

12

Activity
Is an abstract super class for all Concrete Activity types

Task SubProcess CallActivity (Reusable Activity /Global Tasks)

It inherits the attributes and model associations of FlowElement Some more attributes of Activity element:

CS752, November 2012

www.hilcoe.com.et

13

Attribute Name
isForCompensation: boolean = false

Description
A flag that identifies whether this Activity is intended for the purposes of compensation. If false, then this Activity executes as a result of normal execution flow. If true, this Activity is only activated when a Compensation Event is detected and initiated under Compensation Event visibility scope (see page 281 for more information on scopes). An Activity MAY be performed once or MAY be repeated. If repeated, the Activity MUST have loopCharacteristics that define the repe-tition criteria (if the isExecutable attribute of the Process is set to true). The Sequence Flow that will receive a token when none of the conditionExpressions on other outgoing Sequence Flows evaluate to true. The default Sequence Flow should not have a conditionExpression; any such Expression SHALL be ignored. This references the Intermediate Events that are attached to the boundary of the Activity The default value is 1. The value MUST NOT be less than 1. This attribute defines the number of tokens that MUST arrive before the Activity can begin. Note that any value for the attribute that is greater than 1 is an advanced type of modeling and should be used with caution.
www.hilcoe.com.et 14

loopCharacteristics: LoopCharac-teristics [0..1] default: SequenceFlow [0..1]

boundaryEventRefs: BoundaryEvent [0..*] startQuantity: integer =1

CS752, November 2012

CS752, November 2012 www.hilcoe.com.et 15

h BP at h ap in M N pe UM Ac ns L tiv In st si d at ity e e di Life an ag cy Ac ra cl m e de tivit y sc rib ? ed

The Start Quantity attribute of an activity defines the number of token required for the activity to be Ready for execution The first InputSet where all data inputs are available (by means of data associations) is used to start the execution of the Activity. If no InputSet is available, then the execution will wait until this condition is met this InputSet is based on data associations For tasks that are attached after Event-Based Exclusive Gateways, the first element (Task or Event) that completes causes all other Tasks to be withdrawn The diagram shows complete conditions faced by an activity from start to end
www.hilcoe.com.et 16

CS752, November 2012

If the Activity has no outgoing Sequence Flows, the Activity will terminate without producing any tokens and termination semantics for the container is then applied Automated activities are executed by a system, while manual activities are executed by humans (or a system of that capability) All Activities share common attributes and behavior such as states and state transitions.
CS752, November 2012 www.hilcoe.com.et 17

A Task is a Concrete Activity, and has multiple variations

Class diagram for Task

A task has no more attributes than it inherits from the Activity super class; while the variations have
CS752, November 2012 www.hilcoe.com.et 18

All about Tasks


Service Task: Upon activation, the data in the inMessage of the Operation is assigned from the data in the Data Input of the Service Task the Operation is invoked. On completion of the service, the data in the Data Output of the Service Task is assigned from the data in the outMessage of the Operation, and the Service Task completes. If the invoked service returns a fault, that fault is treated as interrupting error, and the Activity (the Service Task) fails Send Task: Upon activation, the data in the associated Message is assigned from the data in the Data Input of the Send Task. The Message is sent and the Send Task completes Receive Task: Upon activation, the Receive Task begins waiting for the associated Message. When the Message arrives, the data in the Data Output of the Receive Task is assigned from the data in the Message, and Receive Task completes. For key-based correlation, only a single receive for a given CorrelationKey can be active, and thus the Message matches at most one Process instance. For predicate-based correlation, the Message can be passed to multiple Receive Tasks. If the Receive Tasks instantiate attribute is set to true, the Receive Task itself can start a new Process instance
www.hilcoe.com.et 19

CS752, November 2012

All about Tasks


User Task: Upon activation, the User Task is distributed to the assigned person or group of people. When the work has been done, the User Task completes Manual Task: Upon activation, the manual task is distributed to the assigned person or group of people. When the work has been done, the Manual Task completes. This is a conceptual model only; a Manual Task is never actually executed by an IT system Business Rule Task: Upon activation, the associated business rule is called. On completion of the business rule, the Business Rule Task completes Script Task: Upon activation, the associated script is invoked. On completion of the script, the Script Task completes Abstract Task: Upon activation, the Abstract Task completes. This is a conceptual model only; an Abstract Task is never actually executed by an IT system.

CS752, November 2012

www.hilcoe.com.et

20

Tasks

CS752, November 2012

www.hilcoe.com.et

21

Read on the execution semantics of Sub Process, Call Activity, Ad-Hoc SubProcess, Loop Activity and Multiple Instance Activity

CS752, November 2012

www.hilcoe.com.et

22

Send task
A task specifically designed to send a Message to an external Participant

CS752, November 2012

www.hilcoe.com.et

23

Send Task Model Associations

CS752, November 2012

www.hilcoe.com.et

24

Execution Semantics for Gateway


Example: Parallel Gateway
Operational Semantics The Parallel Gateway is activated if there is at least one token on each incoming Sequence Flow The Parallel Gateway consumes exactly one token from each incoming Sequence Flow and produces exactly one token at each outgoing Sequence Flow If there are excess tokens at an incoming Sequence Flow, these tokens remain at this Sequence Flow after execution of the Gateway Exception Issues The Parallel Gateway cannot throw any exception
CS752, November 2012 www.hilcoe.com.et 25

Execution Semantics for Events


Start Events
For single Start Events, concerned with starting a new Process instance each time the Event occurs. Sequence Flows leaving the Event are then followed as usual

Intermediate Events
The handling consists of waiting for the Event to occur. Waiting starts when the Intermediate Event is reached Once the Event occurs, it is consumed

End Event
The behavior associated with the Event type is performed

Study all the different variation of events


CS752, November 2012 www.hilcoe.com.et 26

BPMN to WS-BPEL
Here a mapping of a BPMN model to WS-BPEL that is derived by analyzing the BPMN objects and the relationships between the objects is considered Not all BPMN orchestration Processes can be mapped to WS-BPEL in a straight-forward way.
One reason being BPMN allows the modeler to draw almost arbitrary graphs to model control flow

Only sound and well synchronized BPMN Orchestration processes can be directly mapped to WS-BPEL
CS752, November 2012 www.hilcoe.com.et 27

Two possible, but undesirable states:


Deadlock: when token on some sequence flow couldnt be removed in known future time Lack of synchronization: when there is more than one token on some Sequence Flow

Q: Please give examples to each of these scenarios


CS752, November 2012 www.hilcoe.com.et 28

Directed graphs
The Gateways and the Sequence Flows of the BPMN orchestration Process form a directed graph A block of a diagram is a connected sub-graph that is connected to the rest of the graph only through exactly two Sequence Flows:
exactly one Sequence Flow entering the block and exactly one Sequence Flow leaving the block

A block hierarchy for a Process model is a set of blocks of the Process model in which each pair of blocks is either nested or disjoint and which contains the whole process model
CS752, November 2012 www.hilcoe.com.et 29

Example Block Hierarchy

CS752, November 2012

www.hilcoe.com.et

30

CS752, November 2012

www.hilcoe.com.et

31

The mapping process


[BPMN Construct] = WS-BPEL Construct
E.g.
<if><condition>[c1]</condition> <do>[T1]</do>

<else><condition>[c2]</condition> <do>[T2]</do> </else> </if>

CS752, November 2012

www.hilcoe.com.et

32

Continues

Você também pode gostar