Download presentation
Presentation is loading. Please wait.
Published byMaurice Gaines Modified over 9 years ago
1
BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic
2
What is BPEL It is positioned to become a standard for Web service composition. a notation for specifying business process behavior based on Web services. a joint specification of IBM, BEA, Microsoft, SAP, and Siebel OASIS ( Organization for the Advancement of Structured Information Standards e-business standards) standard.
3
The description of a workflow Buy coffee machine InstallOperateFill cupDrink Thirst quenched Satisfy thirst with coffee Go to coffee shop Order Make and serve Drink Tangible good + self service Service NeedProcess to satisfy needNeed satisfied
4
The description of workflow Loan Request Send to Risk AssessorSend to Approver Prepare the answer Reply request.amount>=1000 request.amount <1000 risk.level=low risk.level!=low
5
BPEL: describe the business logic The sequence of the activities (operations in WSDL) The triggering conditions of the activities The consequences of executing the activities The partners for the external activities The composition of Web Services The binding to WSDL
6
Business Process (what) versus WSDL (how) Business Process: what to do Modeled as a sequence of activities Tools aid to define, monitor, and manage business processes WSDL: how to execute activities An activity can be an internal or external Web service (SOAP/WSDL) A business process can be exposed for consumption by a client app or another business process A B C D E APPLICATION Business Process WSDL
7
BPEL Process Model A Business Process: 1. Comprises choreography elements to define behavior 2. Exposes operations with constraints as Web services 3. Uses other Web services to do its job 1 2 3 A D B C E Service logic External Service Dynamic Partner/ Service Selection WSDL portType
8
BPEL4WS supports: BPEL4WS only uses and supports input-only and input-output (request- response) operations of WSDL; output-only (notification) and output-input (solicit- response) operations are not required nor supported
9
How BPEL looks like? <process name="echoString" targetNamespace="urn:echo:echoService" xmlns:tns="urn:echo:echoService" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"> <partnerLink name="caller" partnerLinkType="tns:echoPLT" myRole="service"/> <receive partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" createInstance="yes" name="EchoReceive"/> <reply partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" name="EchoReply"/>
10
How BPEL looks like? : root element of bpel : external partners : variables in the process : a sequence scope, : basic activities
11
BPEL basic activities allows the business process to do a blocking wait for a matching message to arrive. allows the business process to send a message in reply to a message that was received through a. The combination of a and a forms a request- response operation for the process. allows the business process to invoke a one-way or request-response operation on a portType offered by a partner.
12
BPEL basic activities (Cont’d) is used to copy data from one place to another. generates a fault from inside the business process. : terminate the entire service instance. It is only available in executable processes. allows you to wait for a given time period or until a certain time has passed. allows you to insert a “do nothing” instruction to the process.
13
<receive partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" createInstance="yes" name="EchoReceive"/> <reply partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" name="EchoReply"/> Activities in BEPL PortType in WSDL
14
Activities in BPEL vs.portType in WSDL <process name="echoString" targetNamespace="urn:echo:echoService" xmlns:tns="urn:echo:echoService" xmlns="http://schemas.xmlsoap.org/ws/2003/03/busin ess-process/"> <partnerLink name="caller" partnerLinkType="tns:echoPLT" myRole="service"/> <receive partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" createInstance="yes" name="EchoReceive"/> <reply partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" name="EchoReply"/> <definitions targetNamespace="urn:echo:echoService" xmlns:tns="urn:echo:echoService" xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner- link/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">
15
The structure of activities : an ordered sequence of steps : “case-statement” approach : loop : execute one of several alternative paths : parallel steps
16
Partners For –Invoke an operation at an external web service –The external web service is Process partner For and –The client sends message to invoke a local web service –The client is client partner : The different parties involved in the business process
17
in BPEL <partnerLink name="caller" partnerLinkType="tns:echoPLT" myRole="service"/> in WSDL
18
PartnerLink in BPEL vs.partnerLinkType in WSDL <process name="echoString" targetNamespace="urn:echo:echoService" xmlns:tns="urn:echo:echoService" xmlns="http://schemas.xmlsoap.org/ws/2003/03/busin ess-process/"> <partnerLink name="caller" partnerLinkType="tns:echoPLT" myRole="service"/> <receive partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" createInstance="yes" name="EchoReceive"/> <reply partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" name="EchoReply"/> <definitions targetNamespace="urn:echo:echoService" xmlns:tns="urn:echo:echoService" xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner- link/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">
19
Business Partner A partner link represents a conversational relationship between two partner processes. Relationships between a business partner in general require more than a single conversational relationship to be established. To represent the capabilities required from a business partner, BPEL4WS use the element. A partner is defined as a subset of the partner links of the processes.
20
Endpoint Reference WSDL makes an important distinction between portTypes and ports. PortTypes define abstract functionality by using abstract messages. Ports provide actual access information, including communication endpoints and other deployment-related information (such as public key for encryption). Bindings provide the glue between them. The fundamental use of endpoint references is to serve as the mechanism for dynamic communication of port-specific data for services. An endpoint reference make it possible in BPEL4WS to dynamically select a provider for a particular type of service and to invoke their operations.
21
Data variables used by activities – : WSDL message; – : XML Schema simple type; – : XML Schema element. Variables associated with message types can be specified as input or output variables for invoke, receive and reply activities.
22
Variables in BPEL vs.Messages in WSDL <process name="echoString" targetNamespace="urn:echo:echoService" xmlns:tns="urn:echo:echoService" xmlns="http://schemas.xmlsoap.org/ws/2003/03/busin ess-process/"> <partnerLink name="caller" partnerLinkType="tns:echoPLT" myRole="service"/> <receive partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" createInstance="yes" name="EchoReceive"/> <reply partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" name="EchoReply"/> <definitions targetNamespace="urn:echo:echoService" xmlns:tns="urn:echo:echoService" xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner- link/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">
23
In response to faults Defines the recovery actions when faults occur Its sole aim is to undo the partial and unsuccessful work of a scope in which a fault has occurred.
24
Samples Echo: simplest EchoComplex: transfer complex objects Simple: I modified to call remote service Market place: communication without server objects ATM: session ID to control transaction Loanapproval: use the link to set up complex business logic
25
EachString: BPEL vs. WSDL <process name="echoString" targetNamespace="urn:echo:echoService" xmlns:tns="urn:echo:echoService" xmlns="http://schemas.xmlsoap.org/ws/2003/03/busin ess-process/"> <partnerLink name="caller" partnerLinkType="tns:echoPLT" myRole="service"/> <receive partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" createInstance="yes" name="EchoReceive"/> <reply partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" name="EchoReply"/> <definitions targetNamespace="urn:echo:echoService" xmlns:tns="urn:echo:echoService" xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner- link/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">
26
Echo Sample <partnerLink name="caller“ partnerLinkType="tns:echoPLT“ myRole="service"/> in BEPL in WSDL
27
<receive partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" createInstance="yes" name="EchoReceive"/> <reply partnerLink="caller" portType="tns:echoPT" operation="echo" variable="request" name="EchoReply"/> Activities in BEPL PortType in WSDL
28
Simple sample and in BEPL another Web Service defined in stockquote.wsdl
29
… <receive name="receive" partnerLink="caller" portType="tns:StockQuotePT" operation="gimmeQuote" variable="request" createInstance="yes"/> <reply name="reply" partnerLink="caller" portType="tns:StockQuotePT" operation="gimmeQuote" variable="response"/> Variable, Receive and Reply in BPEL Message and portType in WSDL Simple: StockQute Sample
30
Invoke external WSDL <invoke name="invoke" partnerLink="provider" portType="sqp:StockQuotePT" operation="getQuote" inputVariable="invocationrequest" outputVariable="invocationresponse"/> in BEPL PortType in external stockquote.wsdl
31
LoanApproval Sample <import namespace="http://tempuri.org/services/loandefinitions" location="http://localhost:8080/bpws4j-samples/loanapproval/loandefinitions.wsdl"/> LoanApprover Web Service: <import namespace="http://tempuri.org/services/loanapprover" location="http://localhost:8080/bpws4j-samples/loanapproval/loanapprover.wsdl"/> LoanAssessor Web Service: <import namespace="http://tempuri.org/services/loanassessor" location="http://localhost:8080/bpws4j-samples/loanapproval/loanassessor.wsdl"/> Import two external Web Services plus one external definition file in WSDL
32
<plnk:partnerLinkType xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" name="loanApprovalLinkType"> in WSDL <fault name="loanProcessFault" message="loandef:loanRequestErrorMessage"/> portType in loanapprover.wsdl
33
in WSDL <fault name="loanProcessFault" message="loandef:loanRequestErrorMessage"/> portType in loanassessor.wsdl
34
Links defined for dependencies between the activities in BEPL
35
<receive name="receive1" partnerLink="customer" portType="apns:loanApprovalPT" operation="approve" variable="request" createInstance="yes"> <source linkName="receive-to-assess" transitionCondition="bpws:getVariableData('request', 'amount')<10000"/> <source linkName="receive-to-approval" transitionCondition="bpws:getVariableData('request', 'amount')>=10000"/> <fault name="loanProcessFault" message="loandef:loanRequestErrorMessage"/> portType in loanapprover.wsdl Receive in BEPL condition
36
<invoke name="invokeAssessor" partnerLink="assessor" portType="asns:riskAssessmentPT" operation="check" inputVariable="request" outputVariable="riskAssessment"> <source linkName="assess-to-setMessage" transitionCondition="bpws:getVariableData('riskAssessment', 'risk')='low'"/> <source linkName="assess-to-approval" transitionCondition="bpws:getVariableData('riskAssessment', 'risk')!='low'"/> in BEPL <fault name="loanProcessFault" message="loandef:loanRequestErrorMessage"/> portType in loanassessor.wsdl condition
37
A Sample – LoanApproval.bepl <process name="loanApprovalProcess" targetNamespace="http://acme.com/loanprocessing" suppressJoinFailure="yes" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:lns="http://loans.org/wsdl/loan-approval" xmlns:loandef="http://tempuri.org/services/loandefinitions" xmlns:asns="http://tempuri.org/services/loanassessor" xmlns:apns="http://tempuri.org/services/loanapprover"> <variable name="request" messageType="loandef:creditInformationMessage"/> <variable name="riskAssessment" messageType="asns:riskAssessmentMessage"/> <variable name="approvalInfo" messageType="apns:approvalMessage"/> <variable name="error" messageType="loandef:loanRequestErrorMessage"/>
38
<partnerLink name="customer" partnerLinkType="lns:loanApprovalLinkType" myRole="approver"/> <partnerLink name="approver" partnerLinkType="lns:loanApprovalLinkType" partnerRole="approver"/> <partnerLink name="assessor" partnerLinkType="lns:riskAssessmentLinkType" partnerRole="assessor"/> <catch faultName="lns:loanProcessFault" faultVariable="error"> <reply partnerLink="customer" portType="apns:loanApprovalPT" operation="approve" variable="error" faultName="invalidRequest"/>
39
<receive name="receive1" partnerLink="customer" portType="apns:loanApprovalPT" operation="approve" variable="request" createInstance="yes"> <source linkName="receive-to-assess" transitionCondition="bpws:getVariableData('request', 'amount')<10000"/> <source linkName="receive-to-approval" transitionCondition="bpws:getVariableData('request', 'amount')>=10000"/>
40
<invoke name="invokeAssessor" partnerLink="assessor" portType="asns:riskAssessmentPT" operation="check" inputVariable="request" outputVariable="riskAssessment"> <source linkName="assess-to-setMessage" transitionCondition="bpws:getVariableData('riskAssessment', 'risk')='low'"/> <source linkName="assess-to-approval" transitionCondition="bpws:getVariableData('riskAssessment', 'risk')!='low'"/>
41
<invoke name="invokeapprover" partnerLink="approver" portType="apns:loanApprovalPT" operation="approve" inputVariable="request" outputVariable="approvalInfo"> <reply name="reply" partnerLink="customer" portType="apns:loanApprovalPT" operation="approve" variable="approvalInfo">
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.