37
Presented by IBM developerWorks ibm.com/developerWorks/webservices © 2005 IBM Corporation. September – December 2005 Implementing a Implementing a Business Process Business Process

Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

  • Upload
    lamtram

  • View
    222

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

Presented by IBM developerWorksibm.com/developerWorks/webservices

© 2005 IBM Corporation.

September – December 2005

Implementing a Implementing a Business ProcessBusiness Process

Page 2: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-2

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

The big pictureThe big pictureRational RequisitePro

Create, Simulate & Analyze As-Is

Business Model

WebSphere Business Integration Modeler

Create FinancialReports & ROI

Estimates

Create Observation Model with KPIs & export to Monitor

Create, Simulate, Analyze and Optimize To-Be Business Model

BusinessAnalyst

Integration Developer

WebSphere Studio Application Developer Integration Edition

Choreograph services using BPEL, WSDL,

etc.

Configure Human Task Manager

(including Ad-Hoc) & Client

Assemble Solution(BPEL, Human Task Manager, Business

Rules, etc)

Understand Risk, Project Costs,

and ROI

Identify and Manage

Projects and Resources

CIO

ProjectManager

Rational PortfolioManager

Databasemodeler

ModelRelationalDatabaseSchemas

Data Modeling

RDB Mapping

Trace Requirements & Create System

Use Case Realizations

Model & Implement Services, & expose as

Web Services

Test Create & Manage

SystemRequirements

Architect

RationalRationalSoftwareSoftwareArchitectArchitect Java

Developer

Develop Portlets(App UI

and Monitor)

PortalDeveloper

Tester

Rational Functional & Performance Tester

IBM Rational Team Unifying Platform

BPELWSDL

UML

DBA

Deploy/Run

Monitor BusinessOperations

Analyst

RuntimeWBI Server FoundationWebSphere Portal WBI Monitor

WSDLEAR

WSDLEAR

Observation ModelRun-time Statistics

Page 3: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-3

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

The big pictureThe big picture• Business experts design the process

in a modeling tool– This design can be arbitrarily complex– The process design focuses on the

business and its resources (people, warehouses, etc.), not on the way the eventual application will work

• When the business experts are satisfied with the process design, they can export that design to developers

Page 4: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-4

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

The big pictureThe big picture• When the process design is exported

from the modeling tool, three files are generated:– BPEL – Defines the process flows,

branching points, and so forth– WSDL – Defines the interfaces to the

services used by the process– XSD – Defines the XML data structures

(serialized objects) used by the process.

Page 5: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-5

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

How we use those filesHow we use those files• Here's how developers use those files:

– BPEL – Each step in the process is wired to a Web service

– WSDL – If necessary…– XSD – Defines custom data types and

maybe used for generating Java beans

Page 6: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-6

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

What is BPEL4WSWhat is BPEL4WS• Business Process Execution Language for

Web Services

• Proposed industry standard for Web services choreography

• A language to specify behavior of business processes – As Web services– Between Web services

Page 7: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-7

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

History of WSHistory of WS--BPELBPEL• 7/2002: Original 1.0 BPEL4WS proposal

from IBM, Microsoft and BEA. Combined ideas from IBM’s WSFL and Microsoft’s XLang

• 4/2003: OASIS Technical Committee formed. Standards-based follow-on to earlier BPEL4WS work

• 5/2003: Revised 1.1 proposal with contributions from SAP and Siebel

Page 8: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-8

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

BPEL is StandardsBPEL is Standards--basedbased• BPEL is managed by

Oasis• Based on WSDL and

other XML standards– WSDL defines interface

of composed service and services used by composite

– XML Schema and XPathfor data context handling and business rules specification

BPEL4WS (Business Process Execution Language For Web Services)

BPEL4WS (Business Process Execution Language For Web Services)

WSDL (Web Services Description Language) WSDL (Web Services Description Language)

XPath (XML Path Language) XPath (XML Path Language)

XSD (XML Schema)XSD (XML Schema)

XMLXML

Page 9: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-9

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Elements of a BPEL ProcessElements of a BPEL Process

! ! !

JavaSnippet

Wait

JavaSnippet

Receive

Assign

Assign

Receive

Invoke

Receive

Invoke

Throw

PartnerLinksplaceholders for

process callers and service providers

PartnerLinksplaceholders for

process callers and service providers

Variableshold data used in

the business process

Variableshold data used in

the business process

FaultHandlersenclose activities that

are performed in cases of error

FaultHandlersenclose activities that

are performed in cases of error

CorrelationSetssupport process

instance identification

CorrelationSetssupport process

instance identification

Activitiessubtasks of the process

Activitiessubtasks of the process

Control Linksdefine the process'

control flow

Control Linksdefine the process'

control flow

Page 10: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-10

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

The BPEL editorThe BPEL editor• WebSphere Studio Integration

Edition features a state-of-the-art BPEL editor and debugger

• Everything is done graphically, so it's easy to make changes to your business process

• If you combine the ability to automate Web services calls with the ability to use legacy applications, BPEL becomes a very powerful tool

Page 11: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-11

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

DemoDemo• We'll define a process in WBI

Modeler and export it to WebSphere Studio as a BPEL document

Page 12: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-12

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Elements of a BPEL ProcessElements of a BPEL Process

! ! !

JavaSnippet

Wait

JavaSnippet

Receive

Assign

Assign

Receive

Invoke

Receive

Invoke

Throw

PartnerLinksplaceholders for

process callers and service providers

PartnerLinksplaceholders for

process callers and service providers

Variableshold data used in

the business process

Variableshold data used in

the business process

FaultHandlersenclose activities that

are performed in cases of error

FaultHandlersenclose activities that

are performed in cases of error

CorrelationSetssupport process

instance identification

CorrelationSetssupport process

instance identification

Activitiessubtasks of the process

Activitiessubtasks of the process

Control Linksdefine the process'

control flow

Control Linksdefine the process'

control flow

Page 13: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-13

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

BPEL ActivitiesBPEL Activities• Basic activities allow to define the tasks or steps that make up the business process

• Structuring activities help to define the control flow of the business process

Page 14: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-14

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

BPEL Basic ActivitiesBPEL Basic Activities

PickWait for one of multiple messages to arrive or for a time-out alarm to go off.

ReceiveWait for a message to arrive. Optionally start a new process instance when the message arrives.

ReplySend a message in reply to a message that was received through a Receive.

EmptyA "no-op" instruction in the business process.

InvokeInvoke a one-way or a request-response operation offered by a partner.

TerminateImmediately terminate the process instance.

Page 15: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-15

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

BPEL Basic ActivitiesBPEL Basic Activities

AssignUpdate the values of variables with new data.

StaffInvoke an interaction with a human user.

BPEL Extension

JJ JavaSnippetInvoke an inline snippet of Java code.

WaitWait for a given time period or until a certain time has passed.

BPEL Extension

! SubprocessInvoke another process – life cycle events will be propagated.

ThrowGenerate a fault from.inside the business process.

BPEL Extension

Page 16: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-16

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

BPEL Structuring Activities / BPEL Structuring Activities / ElementsElements

FlowHolds multiple activities that are performed concurrently.

LinkSynchronizes two activities that are enclosed in a Flow (i.e, enforces a certain execution order).

SwitchSelects one branch of activity from a set of choices.

SequenceHolds multiple activities that are performed sequentially in lexical order.

ScopeAllows for the definition of a nested activity with its own fault handler.

WhileHolds a (basic or structuring) activity that is repeated until a success criteriy has been met.

Page 17: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-17

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Composing a Business Process Composing a Business Process ApplicationApplication

Enterprise Application(EAR file)

Business Process Module (JAR file)

Reply

Staff

Wait

Invoke

Receive

Assign

Assign

Invoke

Staff

Receive

Reply

Staff

Wait

Invoke

Receive

Assign

Assign

Invoke

Staff

Receive

BPEL

WSDL

Page 18: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-18

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Deployment of the Business Process Deployment of the Business Process ApplicationApplication

BI Server FoundationVersion 5.1

Business Process DB

Business ProcessContainer

ProcessApp.ear

ProcessEJB.jarUtility.jar

Client.war

...

Process.bpel

Process.wsdl

Process-Base.javaProcess

Base Class

Process.javaStateless

Session Bean

Process-Entity.javaEntity Bean

JavaSnippet

Wait

JavaSnippet

Receive

Assign

Assign

Receive

Invoke

Receive

Invoke

Throw

EAR file

• WebSphere Administrative Console• Manage BPEL container• Install/uninstall BPEL applications• Start/stop BPEL applications

Page 19: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-19

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Elements of a BPEL ProcessElements of a BPEL Process

! ! !

JavaSnippet

Wait

JavaSnippet

Receive

Assign

Assign

Receive

Invoke

Receive

Invoke

Throw

PartnerLinksPartnerLinksVariablesVariables

FaultHandlersFaultHandlersCorrelationSetsCorrelationSets

Activities & Links

Activities & Links

Page 20: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-20

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Partner LinksPartner Links• "Placeholder" for a

partner – No need to specify

concrete service endpoints within the model

– Allows for late binding of partners (at assembly time « build time)

• Allows for long-running, stateful interactions with a partner

Purchase OrderBusiness Process

ShippingService

InvoiceService

ProductionScheduling

Service

start price calculationrequest shipment

send schedule

send shipment price

send invoice

start scheduling

send shipping schedule

Page 21: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-21

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Partner LinksPartner Links• Refer to PartnerLinkTypes

• Specify roles of each partner

<partnerLinks><partnerLink name="ShipperPL“

partnerLinkType="wsdl1:order-shipperPLT"myRole="orderingService"partnerRole="shipper"/>

...</partnerLinks>

<partnerLinks><partnerLink name="ShipperPL“

partnerLinkType="wsdl1:order-shipperPLT"myRole="orderingService"partnerRole="shipper"/>

...</partnerLinks>

BPEL FileBPEL File

Page 22: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-22

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Elements of a BPEL ProcessElements of a BPEL Process

! ! !

JavaSnippet

Wait

JavaSnippet

Receive

Assign

Assign

Receive

Invoke

Receive

Invoke

Throw

PartnerLinksPartnerLinksVariablesVariables

FaultHandlersFaultHandlersCorrelationSetsCorrelationSets

Activities & Links

Activities & Links

Page 23: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-23

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

VariablesVariables• Hold data that constitute the state of a

process– May be received from or sent to partners– Can be specified as input or output variables

for invoke, receive, and reply activities – May hold state data related to the process and

never exchanged with partners

• Associated with WSDL message types

Page 24: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-24

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Elements of a BPEL ProcessElements of a BPEL Process

! ! !

JavaSnippet

Wait

JavaSnippet

Receive

Assign

Assign

Receive

Invoke

Receive

Invoke

Throw

PartnerLinksPartnerLinksVariablesVariables

FaultHandlersFaultHandlersCorrelationSetsCorrelationSets

Activities & Links

Activities & Links

Page 25: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-25

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

CorrelationSetsCorrelationSetsPurchase Order

Business ProcessInvoiceService

start price calculation

send shipment price

send invoice

Page 26: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-26

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

CorrelationSetsCorrelationSets• Defined by groups of properties• Used between partners to identify process

instances• Values of a correlation set initialized once,

thereafter associated with process instance• Properties in incoming messages later used to

correlate message with process instance

<correlationSets><correlationSet name="orderCS"

properties="wsdl1:orderNo"/>...

</correlationSets>

<correlationSets><correlationSet name="orderCS"

properties="wsdl1:orderNo"/>...

</correlationSets>

BPEL FileBPEL File

Page 27: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-27

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Message Properties: Key to Message Properties: Key to CorrelationCorrelation

• Property: a globally unique name, associated with an XML Schema simple type

• PropertyAlias: identifies the location of the property in a message

<bpws:property name="orderNumber" type="xsd:string"/>

<bpws:propertyAlias propertyName="tns:orderNumber" messageType="tns:productData" part="oNo" query="" />

<message name="productData"><part name="oNo" type="xsd:string"/><part name="kind" type="xsd:string"/><part name="size" type="xsd:string"/>

</message>

<bpws:property name="orderNumber" type="xsd:string"/>

<bpws:propertyAlias propertyName="tns:orderNumber" messageType="tns:productData" part="oNo" query="" />

<message name="productData"><part name="oNo" type="xsd:string"/><part name="kind" type="xsd:string"/><part name="size" type="xsd:string"/>

</message>

WSDL FileWSDL File

Page 28: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-28

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Elements of a BPEL ProcessElements of a BPEL Process

! ! !

JavaSnippet

Wait

JavaSnippet

Receive

Assign

Assign

Receive

Invoke

Receive

Invoke

Throw

PartnerLinksPartnerLinksVariablesVariables

FaultHandlersFaultHandlersCorrelationSetsCorrelationSets

Activities & Links

Activities & Links

Page 29: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-29

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Fault HandlerFault Handler ! ! !• Associated with a Scope• Handles faults thrown in their scope • A fault reaching a fault handler means that regular

processing within this part of the business process can no longer be successfully completed– All active work within the scope will be stopped

• Specifies activities that must be performed if a fault has been thrown

• Allows association of different fault handling activities with different kind of faults (Catch blocks for different faults)

Page 30: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-30

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Elements of a BPEL ProcessElements of a BPEL Process

! ! !

JavaSnippet

Wait

JavaSnippet

Receive

Assign

Assign

Receive

Invoke

Receive

Invoke

Throw

PartnerLinksPartnerLinksVariablesVariables

FaultHandlersFaultHandlersCorrelationSetsCorrelationSets

Activities & Links

Activities & Links

Page 31: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-31

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Cross dependencies: LinksCross dependencies: Links• A <link> can be used to alter the

behavior of a <flow>, crossing the boundaries of <sequence> and <flow> as required

• Links have– A source of the link– A target of the link– When the source completes

• The link becomes "active"• The target is no longer blocked by the link

Page 32: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-32

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Execution mode of a processExecution mode of a process• Microflow

– Non-interruptible – Single unit of work– Not persistent No database / message queueing

system involved – High throughput

• Long-running process– Interruptible– Persistent

• State stored persistently in database• Usage of persistent messaging to reliably hold the

navigation information of the flow– Transacted execution– Supports all types of activities (including those not

supported in microflows, e.g. human interaction and asynchronous invocations)

Page 33: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-33

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Transactions: MicroflowTransactions: Microflow

Receive

Invoke

Invoke

InvokeReply

Reply Fault

Transaction BoundaryTransaction Boundary

TT00

Page 34: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-34

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

Transactions: LongTransactions: Long--running running processprocess

Receive

Invoke

Invoke

TT00

TT11

TT22

TT33

TT44

JMS Message JMS Message Continue ConnectorContinue Connector

Reply

Invoke

TT55

Page 35: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-35

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

ReferencesReferences• BPEL4WS Specification 1.1

– http://www-106.ibm.com/developerworks/library/ws-bpel/

• Whitepapers on Process Choreographer from WSDD– http://www7b.boulder.ibm.com/wsdd/zones/was/wpc.

html• Business Process Management and Web Services

– http://researchweb.watson.ibm.com/journal/sj/412/leymann.html

• Article Series "Understanding BPEL4WS" on DeveloperWorks– http://www-

106.ibm.com/developerworks/webservices/library/ws-bpelcol1/

Page 36: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

6-36

Presented by IBM developerWorks

Implementing a service-oriented architecture © 2005 IBM Corporation.

SummarySummary• BPEL makes it possible to build

flexible processes that are easy to build, test, deploy and modify– IBM's BPEL and process modeling tools

make these things easy– The hard part is converting your

existing applications to services– Once you've done that, changing a

BPEL-defined process is simple

Page 37: Presented by IBM · 6-3 Presented by IBM developerWorks Implementing a service-oriented architecture © 2005 IBM Corporation. The big picture • Business experts design the process

Presented by IBM developerWorksibm.com/developerWorks/webservices

© 2005 IBM Corporation.

September – December 2005

Best practices is nextBest practices is next……

…after the break