web services - business process execution language

63
Web Services (NSWI145) Lecture 09: WS BPEL Martin Nečaský, Ph.D. Faculty of Mathematics and Physics Charles University in Prague, Czech Republic Summer 2013

Upload: martin-necasky

Post on 21-May-2015

366 views

Category:

Technology


1 download

TRANSCRIPT

  • 1. Web Services (NSWI145)Lecture 09: WS BPELMartin Neask, Ph.D.Faculty of Mathematics and PhysicsCharles University in Prague, Czech RepublicSummer 2013

2. Core WS Technologies SOAP defines XML messaging protocol for basic webservice interoperability WSDL introduces common grammar for describing webservicesSummer 2013 3. Business Process Automation ordering of activities with beginning and endperformed to achieve business outcome has inputs and outputsSummer 2013 4. Business Process Automation WSDL provides only stateless model forparticular request-response message exchange, or uncorrelated one-way message exchange typical model of business interaction sequence of particular peer-to-peer messageexchanges request-response and/or one-way stateful, long running interactions involving two ormore partiesSummer 2013 5. Business Process Automation core WS technologies allow automation ofonly particular message exchange we need additional WS technologies tosupport automation of whole businessprocesses core terms WS orchestration WS choreographySummer 2013 6. WS Orchestration specifies an executable process result is a web service view of one party that controls the process WS-BPEL: Web Services Business ProcessExecution LanguageSummer 2013 7. WS Choreography specifies a sequence of messages between collaboratingpartners and resources how they should communicate with each other not an executable process no particular view of particular partner WS-CDL: Web Services Choreography DescriptionLanguageSummer 2013 8. BPEL XML based language for orchestrating WebServices BPEL has two parts extensions to WSDL business process execution constructs BPEL script (internal process specification) +WSDL document (external process specification) define new Web Service implemented asorchestration of other Web Services requires WSDL 1.1 (WSDL 2.0 not supported)Summer 2013 9. Sample ProcessReceive Purchase OrderSend InvoiceCheck Credit CardProcess PaymentCalculate PurchaseOrder PriceArrange LogisticsSummer 2013 10. BPEL BPEL process = Abstract Web Service has WSDL description port types composed of operations with inputs andoutputs operates only on the level of WSDL portTypes no binding to concrete services specified by WS-BPEL processdescription orchestrates other web servicesSummer 2013 11. Process Exposition with WSDL exposes BPEL process as a web servicedescribed with WSDL WSDL 1.1 file with few restrictions andextensions restrictions no service and binding is defined only types, messages, port types with operationsSummer 2013 12. Process Exposition with WSDLPurchaseOrderProcessPurchaseOrderPortTypesendPurchaseOrderOperationCustomerPurchase OrderInvoiceSummer 2013 13. Process Exposition with WSDL...Summer 2013 14. Process Exposition with WSDL WSDL 1.1 file with few restrictions andextensions extensions partner link type characterization of conversational relationships betweenprocess and its partner partner link type between process and web serviceutilized by process two participants (process and web service) each with own role partner link type between process and its client one participant (process) with own roleSummer 2013 15. CreditCardServiceCreditCardPortTypecheckCreditCardOperationProcess Exposition with WSDLPurchaseOrderProcessCreditCardCallbackPortTypeprocessPaymentOperationconfirmCreditCardOperationCreditCardConfirmationconfirmPaymentOperationPaymentConfirmationpartner linktypeCreditCardPaymentSummer 2013 16. Process Exposition with WSDL...Summer 2013 17. Process Exposition with WSDL...Summer 2013 18. Process Exposition with WSDL element partnerLinkType WSDL extension specifies WSDL port types the process offers to and requiresfrom a partner service attribute name unique name of the partner link type within the scope of theWSDL description two (typically) or one element role each specifies role one of the communicating services acts attribute name unique name of the role within the partner link type attribute portType specifies WSDL port type the service acting in this role must offerSummer 2013 19. Process Exposition with WSDL...Summer 2013 20. Process Exposition with WSDL...Summer 2013 21. Process Definition root element process with four major sections: partnerLinks section relationships from process to external partner services variables section declaration of process data faultHandlers section handlers for processing faults main activity activity to be executed by the processSummer 2013 22. Process Exposition with WSDL.........Summer 2013 23. Process Definition Partner Link specified by element partnerLink models a link between the process and apartner service instance of a partner link type attribute name unique name of the partner link within theprocess attribute partnerLinkType reference to the partner link typeSummer 2013 24. Process Definition Partner Link attribute myRole references the role in the partner link type actedby the process attribute partnerRole references the role in the partner link type actedby the partner serviceSummer 2013 25. Process Definition Partner Link......Summer 2013 26. Process Definition Partner Link.........Summer 2013 27. Process Definition Variable element variable variables hold data that constitute the state of theprocess attribute name unique variable name content type of the variable specified as WSDLmessage type, XSD element or XSD simple/complextype attribute messageType reference to WSDL message type attribute element reference to XSD element declaration attribute type reference to XSD simple/complex type definitionSummer 2013 28. Process Definition Variable... ... Summer 2013 29. Process Definition - Activities specify the process itself (main activity) or fault handling several types of activities: messaging activities invoke, receive, reply, assign, structured activities sequence, flow, if, while, fault activities throw, exit, compensation activities compensate, Summer 2013 30. Process Definition invoke allows business process to call a partner service invokes one-way or request-response operation on a partners porttype attribute partnerLink specifies invoked partner port type attribute operation specifies invoked operation of the partner port type attribute inputVariable specifies variable with the input message can be replaced by toParts element with toPart child elements ifthe input message has more parts attribute outputVariable specifies variable with the output message can be replaced by fromParts element with fromPart childelements if the output message has more partsSummer 2013 31. Process Definition invokeSummer 2013 32. Process Definition receive allows business process to receive a messagefrom a partner service blocking activity attribute partnerLink specifies port type of the process that is awaitedto be invoked by the partner attribute operation specifies operation of the port type that is awaitedto be invoked by the partnerSummer 2013 33. Process Definition receive attribute variable specifies variable where the arrival message willbe assigned attribute createInstance "yes"/"no" value if "yes" the activity creates new processinstanceSummer 2013 34. Process Definition receiveSummer 2013 35. Process Definition reply allows business process to send a message ina reply to a message that was received byreceive similar structure to invokeSummer 2013 36. Process Definition replySummer 2013 37. Process Definition receive/reply implements request/response messageexchange pattern it is a pair if there are more pairs, distinguish them byattribute messageExchangeSummer 2013 38. Process Definition assign allows updating values of variables with newdata copying data from one variable to another construct new data and copy them to a variable type validity checked element copy element from element toSummer 2013 39. Process Definition assign several variants of from and to:1. from variable to variableSummer 2013 40. Process Definition assign several variants of from and to:2. from variable part to variable$c1/lines/line[1]Summer 2013 41. Process Definition assign several variants of from and to:3. from XSLT script to variablebpel:doXslTransform(".../t.xsl", $c1)Summer 2013 42. Process Definition sequence specifies activities to be performedsequentiallySummer 2013 43. Process Definition sequence$PurchaseOrderMessage/creditCard...Summer 2013 46. Process Definition flow element link declares synchronization dependency for flow attribute name identifies dependency within flowSummer 2013 47. Process Definition flow...Summer 2013 48. Process Definition flow each activity may contain sources with one or moresource and targets with one or more target establish synchronization relations via links element source attribute linkName - specifies that the activity is sourceactivity of the link element target attribute linkName - specifies that the activity is targetactivity of the linkSummer 2013 49. Process Definition flow for a given link, its target activities must waituntil its source activities have finishedSummer 2013 50. Process Definition flow......Summer 2013 51. Process Definition flow......Summer 2013 52. Process Definition flow element joinCondition in targets contains logical expression specifying waitingconditionSummer 2013 53. Process Definition flow...$XtoW and $YtoW...Summer 2013 54. Process Definition flow element transitionCondition insource contains logical expression specifying condition forsetting the link to true (additional condition to"being finished")Summer 2013 55. Process Definition flow...$c > 1000$c 1000...Summer 2013 56. Process Definition scope allows definition of local partnerlinks, variables and activitiesSummer 2013 57. Process Definition if used to select exactly one activity from given branches branch = activity first branch is directly as child element condition contains logical expression condition for first branch activity element elseif element condition other branch activity under a condition element else last branchSummer 2013 58. Process Definition if...$PaymentMessage/price > 1000...$PaymentMessage/price>500...Summer 2013 59. Process Definition while used to define that the child activity is to berepeated as long as the specified condition istrue element condition contains logical expressionSummer 2013 60. Process Definition while$c1 > 1000......$c1Summer 2013 61. Process Definition forEach iterates its child scope exactly N+1 timeswhere N is given by finalCounterValuechild element minus startCounterValuechild element iterated activity is in the child scope attribute parallel "yes"/"no" value if "yes" iterations are performed in parallel flow with N+1 activities each for one iterationSummer 2013 62. Process Definition forEach1count($PurchaseOrder//item)... variable $n with actual counter value ...... iterated activity ...Summer 2013 63. Advanced Concepts not presented in this lecture: fault handling event handling terminating processes undoing completed work (i.e. compensations) message correlation dynamic partner resolution abstract processesSummer 2013