48
Business Processes Szolgáltatásorientált rendszerintegráció Service-Oriented System Integration Dr. Balázs Simon BME, IIT

Business Processes - iit.bme.hu · What are the inputs and outputs? ... Hotel and airline reservation Reserve flight Reserve hotel Parallel ... payment money receipt Event gateway

Embed Size (px)

Citation preview

Business ProcessesSzolgáltatásorientált rendszerintegráció

Service-Oriented System Integration

Dr. Balázs Simon

BME, IIT

Outline

Business processes

Business Process Model and Notation (BPMN)

Business Process Execution Language (BPEL)

Dr. Balázs Simon, BME, IIT 2

Business Processes

Dr. Balázs Simon, BME, IIT 3

BusinessRules

ESB (SCA)

ESB environment

Dr. Balázs Simon, BME, IIT 4

Business Processes

(BPMN, BPEL)

Operational Systems, Legacy Systems, External Services(Java, .NET, Cobol, ...)

User Interface(Web, Mobile, Human tasks)

ComplexEvent

Processing

ServiceRegistry & Repository

Business process environment

Dr. Balázs Simon, BME, IIT 5

Business ProcessManager

Service Interface

Service Interface

Business process

Goal: build more complex services

by calling and combining other services

business processes are also services

A business process connects tasks in order to reach the desired effect

Types of business processes: Operational process: basic process of an organization producing

the primary business value

Supporting process: supports basic processes, but not published to the world

Management process: controls system operation

Business processes can be split up to smaller processes

Dr. Balázs Simon, BME, IIT 6

Business processes

Business process analysis: breakdown of processes into subprocesses until elementary tasks

Development steps: identifying processes

documentation

implementation

change management

systematic organization

Dr. Balázs Simon, BME, IIT 7

Designing business processes

Who are the participants?

What kind of entities and data does the process operate on?What are the inputs and outputs?

Which tasks and activities build up the process?

When does the process start or stop?When do its activities start or stop?

What is the order of the tasks and activities?

Dr. Balázs Simon, BME, IIT 8

Automating business processes

Goal: executing business processes by computers

Advantages: speed

consistency

quality improvement

Requirement: formalized description (e.g. BPMN, BPEL)

Two models: orchestration and choreography

Dr. Balázs Simon, BME, IIT 9

Orchestration model

Central process

Connecting several services together

Executed by a process execution engine

Exposed also as a service

Usually within an organization

Dr. Balázs Simon, BME, IIT 10

Choreography model

No central entity

A collaboration of several services

Each service processes the data and forwards it to the next service

Usually between organizations

Dr. Balázs Simon, BME, IIT 11

Elements of business process description languages

Simple activities variable assignment

sending or receiving messages

throwing exceptions

waiting and timing

terminating

Composite activities sequential or parallel activities

conditional branching

event handling

exception handling

compensation

Dr. Balázs Simon, BME, IIT 12

Business Process Model and Notation (BPMN)

Dr. Balázs Simon, BME, IIT 13

BPMN

Originally: BPMN 1.0 Business Process Modeling Notation

only graphical notation

no semantic model

no interchange format

BPMN 2.0 Business Process Model and Notation

graphical notation

semantic model

interchange format

Dr. Balázs Simon, BME, IIT 14

BPMN

OMG standard

Describes business processes

Graphical notation similar to UML activity diagrams

Executable

Target audience: business analysts to create initial drafts

developers to implement the logic

business people to manage and monitor

Dr. Balázs Simon, BME, IIT 15

BPMN elements

Flow objects: activities, events, gateways define the behavior of the process

Connecting objects: sequence flow, message flow connect flow objects with each other or with other information

Data represent the data handled by the process

Swimlanes for grouping model elements

Artifacts extensibility: additional information about the process

Dr. Balázs Simon, BME, IIT 16

Flow objects

Event something that happens during

the course of the process

it either has a cause (trigger)

or it has an impact (result)

Activity a work performed by a participant

can be atomic

or non-atomic (compound)

Gateway control the branching, forking,

merging and joining flow paths

Dr. Balázs Simon, BME, IIT 17

Start

Intermediate

End

Connecting objects

Sequence flow shows the execution order of

the activities

Message flow shows the flow of messages

between two participants

Association links data, information and

artifacts to elements

can be directed

Dr. Balázs Simon, BME, IIT 18

Data

Data object input or output of an activity

can be singular

or it can be a collection

Message contents of the communication

between two participants

Dr. Balázs Simon, BME, IIT 19

Swimlanes

Pool represents a participant

contains the activities performed by the participant

it can also be a “black-box” if the activities are not known

Lane partitions the activities of the participant within a pool

Dr. Balázs Simon, BME, IIT 20

Ban

k

Verify loan request

Approved?

Transfer money

Inform rejection

Yes

Simple loan approval process

Dr. Balázs Simon, BME, IIT 21

Simple activity

Condition

Defaultbranch

DecisionStart

End

Collapsed subprocess

Verify loan request

Amount?

Automatic approval

Manual approval

Peer-reviewed approval

amount > 1000

500 < amount <= 1000

Verify loan request

Dr. Balázs Simon, BME, IIT 22

Condition

Condition

Default

Rule-based task

Human task

Decision

Reservation subprocess

Dr. Balázs Simon, BME, IIT 23

Re

serv

atio

n Hotel and airline

reservation

Start: incomingmessage

End: outgoingmessage

Collapsed subprocess

Reservation subprocess expanded

Dr. Balázs Simon, BME, IIT 24

Res

erva

tio

n

Hotel and airline reservation

Reserve flight

Reserve hotel

Parallelfork

Paralleljoin

Reservation with compensation

Dr. Balázs Simon, BME, IIT 25

Res

erva

tio

n

Hotel and airline reservation

Reserve flight

Reserve hotel

Cancel flight

Cancel hotelCompensationevent

Compensationactivity

Reservation cancellation and error

Dr. Balázs Simon, BME, IIT 26

Re

serv

atio

n

Hotel and airline reservation

Send reservation

info

Notify about unexpected

error

Notify abount

unsuccessful reservation

Cancellationevent

Errorevent

Bak

ery

Bake pizza

Prepare

Wait for 10 minutes

Inform delay

Bake

Baking pizza

Dr. Balázs Simon, BME, IIT 27

Eventgateway

Timeoutevent

Throw anescalation

Bak

ery

Bake pizza

Inform delay

Delay when baking pizza

Dr. Balázs Simon, BME, IIT 28

Catch anescalation

Ordering a book

Dr. Balázs Simon, BME, IIT 29

Web

sho

pC

usto

mer

De

live

ryW

ebpa

ge

Wants a book

Select the book

Order the book

Book order

Book delivered

1 day elapsed

Check order status

Pay for the delivery

Has the book

Send order status

Wrap book Deliver bookReceive

payment

money receipt

Event gateway

Parallel

Collaboration

Message flow

Sequence flow

BPMN events I.

Dr. Balázs Simon, BME, IIT 30

BPMN events II.

Dr. Balázs Simon, BME, IIT 31

BPMN gateways

Dr. Balázs Simon, BME, IIT 32

All the true branches execute

The events can arrive anytime while theprocess is running,can start a new instance of the process

Executes for exactly one event,can start a new instance of the process

Similar to a petri-net transition,conditions are like tokens

The first true branch executes

Fork and join

BPMN process models

Process (orchestration)

Collaboration

Choreography

Dr. Balázs Simon, BME, IIT 33

Orchestration examples

Dr. Balázs Simon, BME, IIT 34

Private:

Public:

Collaboration example

Dr. Balázs Simon, BME, IIT 35

Choreography example

Dr. Balázs Simon, BME, IIT 36

Business Process Execution Language

(BPEL)

Dr. Balázs Simon, BME, IIT 37

BPEL

Business Process Execution Language for Web Services (BPEL4WS, WS-BPEL)

OASIS standard

XML-based structured programming language

No standard graphical notation

Executable

Describes business processes

Provides and consumes web services

Follows the orchestration model

Dr. Balázs Simon, BME, IIT 38

BPEL process

Executable

Describes: activities

order of execution

data

partners

exception handling

long running transactions

Dr. Balázs Simon, BME, IIT 39

BPEL 1.1 structure

Dr. Balázs Simon, BME, IIT 40

process

partnerLinks

variables

correlationSets

faultHandlers

compensationHandlers

eventHandlers

…activities

BPEL 2.0 structure

Dr. Balázs Simon, BME, IIT 41

process

partnerLinks

variables

correlationSets

faultHandlers

messageExchanges

eventHandlers

…activities

import

scope

variables

correlationSets

faultHandlers

eventHandlers

…activities

compensationHandlers

BPEL 2.0 elements I.

import: importing XSD and WSDL files

XSDs describe types for the BPEL language

WSDLs describe interfaces for web services called or implemented by the BPEL process

partnerLink: describes a connection between the process and an external

web service

the interfaces of the two ends of the connection are described by a partnerLinkType in a WSDL

each end of the connection has a role (e.g. loanRequestor-bank)

messageExchange: used to disambiguate between multiple inbound messages

Dr. Balázs Simon, BME, IIT 42

BPEL 2.0 elements II.

variable: variables are like in conventional programming languages

they have a name and type

the type can be: XSD type, XSD element, WSDL message

correlationSet: used to route messages to the correct process instance

multiple process instances are running behind the same web service endpoint (URL): the process server has to decide which process instance to forward the message to

correlations work with properties: important parts of the messages are selected to identify values which can be matched (correlated) with each other (e.g. orderID)

messages with the same (correlated) values belong to the same process instance

Dr. Balázs Simon, BME, IIT 43

BPEL 2.0 elements III.

faultHandler: same as exception handlers in conventional programming languages

eventHandler: handles incoming messages during execution similar to interrupts messages find the process instance through correlations

compensationHandler: used to roll back steps of a long-running “transaction” example:

reserving flight and hotel at the same time both may take a long time and both may succeed or fail if one succeeds and the other fails, we need to revoke the one

no ACID like in database transactions: the “rollback” is also recorded, it does not erase anything the system may be in an inconsistent state while the long-running

“transaction” is running

Dr. Balázs Simon, BME, IIT 44

BPEL 2.0 simple activities

receive: receives a message from an external partner can start (initiate) a new process instance

reply: sends a reply to a receive if it is a synchronous (request-response) operation

invoke: calls an external partner

wait: the process waits until/for the specified time

empty: does nothing

terminate: terminates the process immediately

throw: throws an exception

assign: value assignment (using XPATH)

compensate: start a rollback

Dr. Balázs Simon, BME, IIT 45

BPEL 2.0 structured activities

scope: like a scope in a conventional programming language has local variables, local fault handlers, etc.

sequence: serial execution

if (called switch in BPEL 1.1): conditional branching

while: repeating activities

pick: defines a set of messages will be executed if one of the messages arrives timeout can also be specified can start (initiate) a new process instance

flow: parallel execution of activities which form a DAG an activity is executed when all previous activities have been executed

Dr. Balázs Simon, BME, IIT 46

Summary

Dr. Balázs Simon, BME, IIT 47

Summary

Business processes

Business Process Model and Notation (BPMN) at first it was only a graphical notation

execution semantics came later

Business Process Execution Language (BPEL) BPEL came earlier than BPMN

XML-based structured programming language

BPMN can be transformed to BPEL, but it is not necessary any more, since BPMN has execution semantics, too

Today: BPMN is used for modeling business processes

BPEL is used only for service composition

Dr. Balázs Simon, BME, IIT 48