bpel: business process execution language for web services dr. yuhong yan nrc-iit-fredericton...
DESCRIPTION
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 satisfiedTRANSCRIPT
![Page 1: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/1.jpg)
BPEL: Business Process Execution Language for Web Services
Dr. Yuhong YanNRC-IIT-Fredericton
Internet logic
![Page 2: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/2.jpg)
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.
![Page 3: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/3.jpg)
The description of a workflow
Buy coffee machine Install Operate Fill cup Drink
Thirst quenched
Satisfy thirst with coffee
Go to coffee shopOrder
Make and serveDrink
Tangible good + self service
Service
Need Process to satisfy need Need satisfied
![Page 4: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/4.jpg)
The description of workflowLoan Request
Send to Risk Assessor Send to Approver
Prepare the answer Reply
request.amount>=1000request.amount <1000
risk.level=lowrisk.level!=low
![Page 5: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/5.jpg)
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
![Page 6: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/6.jpg)
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
ABC
D
E
APPLICATION
BusinessProcessWSDL
WSDL
WSDL
WSDL
WSDL
![Page 7: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/7.jpg)
BPEL Process Model
A Business Process:1. Comprises choreography
elements to define behavior2. Exposes operations with
constraints as Web services3. Uses other Web services to
do its job
1
2
3
A
D
BC
E
Service logic
External Service
Dynamic Partner/Service Selection
WSDL portType
![Page 8: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/8.jpg)
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/">
<partnerLinks> <partnerLink name="caller"
partnerLinkType="tns:echoPLT" myRole="service"/> </partnerLinks> <variables> <variable name="request" messageType="tns:StringMessageType"/> </variables>
<sequence name="EchoSequence"> <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"/> </sequence></process>
![Page 9: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/9.jpg)
How BPEL looks like?
• <process>: root element of bpel• <partnerLink>: external partners• <variables>: variables in the process• <sequence>: a sequence scope• <receive>, <reply>: basic activities
![Page 10: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/10.jpg)
BPEL basic activities
• <receive> allows the business process to do a blocking wait for a matching message to arrive.
• <reply> allows the business process to send a message in reply to a message that was received through a <receive>. The combination of a <receive> and a <reply> forms a request-response operation for the process.
• <invoke> allows the business process to invoke a one-way or request-response operation on a portType offered by a partner.
![Page 11: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/11.jpg)
BPEL basic activities (Cont’d)
• <assign> is used to copy data from one place to another.
• <throw> generates a fault from inside the business process.
• <terminate>: terminate the entire service instance. It is only available in executable processes.
• <wait> allows you to wait for a given time period or until a certain time has passed.
• <empty> allows you to insert a “do nothing” instruction to the process.
![Page 12: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/12.jpg)
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/business-process/">
<partnerLinks> <partnerLink name="caller"
partnerLinkType="tns:echoPLT" myRole="service"/> </partnerLinks> <variables> <variable name="request"
messageType="tns:StringMessageType"/> </variables>
<sequence name="EchoSequence"> <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"/> </sequence></process>
<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/">
<message name="StringMessageType"> <part name="echoString" type="xsd:string"/> </message>
<portType name="echoPT"> <operation name="echo"> <input message="tns:StringMessageType"/> <output message="tns:StringMessageType"/> </operation> </portType>
<plnk:partnerLinkType name="echoPLT"> <plnk:role name="service"> <plnk:portType name="tns:echoPT"/> </plnk:role> </plnk:partnerLinkType> <!-- The service name and the TNS represent my service ID QName
--> <service name="echoServiceBP"> </service>
</definitions>
![Page 13: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/13.jpg)
The structure of activities
• <sequence>: an ordered sequence of steps
• <switch>: “case-statement” approach• <while>: loop• <pick>: execute one of several alternative
paths• <flow>: parallel steps
![Page 14: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/14.jpg)
Partners
• For <invoke>– Invoke an operation at an external web service– The external web service is Process partner
• For <receive> and <reply>– The client sends message to invoke a local
web service– The client is client partner
• <partnerLinks> : The different parties involved in the business process
![Page 15: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/15.jpg)
<partnerLinks> in BPEL
<partnerLinks> <partnerLink name="caller"
partnerLinkType="tns:echoPLT" myRole="service"/></partnerLinks>
<plnk:partnerLinkType name="echoPLT"> <plnk:role name="service"> <plnk:portType name="tns:echoPT"/> </plnk:role> </plnk:partnerLinkType>
<partnerLinkType> in WSDL
![Page 16: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/16.jpg)
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/business-process/">
<partnerLinks> <partnerLink name="caller"
partnerLinkType="tns:echoPLT" myRole="service"/> </partnerLinks> <variables> <variable name="request"
messageType="tns:StringMessageType"/> </variables>
<sequence name="EchoSequence"> <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"/> </sequence></process>
<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/">
<message name="StringMessageType"> <part name="echoString" type="xsd:string"/> </message>
<portType name="echoPT"> <operation name="echo"> <input message="tns:StringMessageType"/> <output message="tns:StringMessageType"/> </operation> </portType>
<plnk:partnerLinkType name="echoPLT"> <plnk:role name="service"> <plnk:portType name="tns:echoPT"/> </plnk:role> </plnk:partnerLinkType> <!-- The service name and the TNS represent my service ID QName
--> <service name="echoServiceBP"> </service>
</definitions>
![Page 17: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/17.jpg)
<variables>
• Data variables used by activities– <variable messagetype=“...”>: WSDL message;– <variable type=“…”>: XML Schema simple
type;– <variable element=“…”>: XML Schema
element.• Variables associated with message types can be
specified as input or output variables for invoke, receive and reply activities.
![Page 18: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/18.jpg)
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/business-process/">
<partnerLinks> <partnerLink name="caller"
partnerLinkType="tns:echoPLT" myRole="service"/> </partnerLinks> <variables> <variable name="request"
messageType="tns:StringMessageType"/> </variables>
<sequence name="EchoSequence"> <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"/> </sequence></process>
<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/">
<message name="StringMessageType"> <part name="echoString" type="xsd:string"/> </message>
<portType name="echoPT"> <operation name="echo"> <input message="tns:StringMessageType"/> <output message="tns:StringMessageType"/> </operation> </portType>
<plnk:partnerLinkType name="echoPLT"> <plnk:role name="service"> <plnk:portType name="tns:echoPT"/> </plnk:role> </plnk:partnerLinkType> <!-- The service name and the TNS represent my service ID QName
--> <service name="echoServiceBP"> </service>
</definitions>
![Page 19: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/19.jpg)
<faultHandlers>
• 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.
![Page 20: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/20.jpg)
EachString: BPEL vs. WSDL
<process name="echoString" targetNamespace="urn:echo:echoService" xmlns:tns="urn:echo:echoService"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
<partnerLinks> <partnerLink name="caller"
partnerLinkType="tns:echoPLT" myRole="service"/> </partnerLinks> <variables> <variable name="request"
messageType="tns:StringMessageType"/> </variables>
<sequence name="EchoSequence"> <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"/> </sequence></process>
<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/">
<message name="StringMessageType"> <part name="echoString" type="xsd:string"/> </message>
<portType name="echoPT"> <operation name="echo"> <input message="tns:StringMessageType"/> <output message="tns:StringMessageType"/> </operation> </portType>
<plnk:partnerLinkType name="echoPLT"> <plnk:role name="service"> <plnk:portType name="tns:echoPT"/> </plnk:role> </plnk:partnerLinkType> <!-- The service name and the TNS represent my service ID QName
--> <service name="echoServiceBP"> </service>
</definitions>
![Page 21: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/21.jpg)
Echo Sample
<partnerLinks> <partnerLink name="caller“ partnerLinkType="tns:echoPLT“ myRole="service"/> </partnerLinks>
<plnk:partnerLinkType xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" name="echoPLT">
<plnk:role name="service"> <plnk:portType name="tns:echoPT"/> </plnk:role> </plnk:partnerLinkType>
<PartnerLinks> in BEPL
<partnerLinkType> in WSDL
![Page 22: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/22.jpg)
<sequence name="EchoSequence"> <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"/> </sequence>
Activities in BEPL
<portType name="echoPT"> <operation name="echo"> <input message="tns:StringMessageType"/> <output message="tns:StringMessageType"/> </operation> </portType>
PortType in WSDL
![Page 23: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/23.jpg)
Simple sample
<partnerLinks> <partnerLink name="caller" partnerLinkType="tns:StockQuotePLT"/> <partnerLink name="provider" partnerLinkType="tns-utils:StockQuotePLT"/> </partnerLinks>
<partners> <partner name="invoker"> <partnerLink name="caller"/> </partner> <partner name="serviceProvider"> <partnerLink name="provider"/> </partner> </partners>
<PartnerLinks> and <Partners> in BEPL
another Web Service defined in
stockquote.wsdl
![Page 24: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/24.jpg)
<variable name="request" messageType="tns:request"/><variable name="response" messageType="tns:response"/>…<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 name="request"> <part name="symbol" type="xsd:string"/> </message> <message name="response"> <part name="quote" type="xsd:float"/> </message> <portType name="StockQuotePT"> <operation name="gimmeQuote"> <input message="tns:request"/> <output message="tns:response"/> </operation> </portType>
Message and portType in WSDL
Simple: StockQute Sample
![Page 25: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/25.jpg)
Invoke external WSDL
<invoke name="invoke" partnerLink="provider" portType="sqp:StockQuotePT" operation="getQuote" inputVariable="invocationrequest" outputVariable="invocationresponse"/>
<Invoke> in BEPL
<portType name="StockquotePT"> <operation name="getQuote"> <input message="tns:GetQuoteInput"/> <output message="tns:GetQuoteOutput"/> </operation> </portType>
PortType in external stockquote.wsdl
![Page 26: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/26.jpg)
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
![Page 27: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/27.jpg)
<plnk:partnerLinkType xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" name="loanApprovalLinkType"> <plnk:role name="approver"> <plnk:portType name="apns:loanApprovalPT"/> </plnk:role> </plnk:partnerLinkType>
<PartnerLinkType> in WSDL
<portType name="loanApprovalPT"> <operation name="approve"> <input message="loandef:creditInformationMessage"/> <output message="tns:approvalMessage"/> <fault name="loanProcessFault" message="loandef:loanRequestErrorMessage"/> </operation> </portType>
portType in loanapprover.wsdl
![Page 28: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/28.jpg)
<plnk:partnerLinkType xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" name="riskAssessmentLinkType"> <plnk:role name="assessor"> <plnk:portType name="asns:riskAssessmentPT"/> </plnk:role> </plnk:partnerLinkType>
<PartnerLinkType> in WSDL
<portType name="riskAssessmentPT"> <operation name="check"> <input message="loandef:creditInformationMessage"/> <output message="tns:riskAssessmentMessage"/> <fault name="loanProcessFault" message="loandef:loanRequestErrorMessage"/> </operation> </portType>
portType in loanassessor.wsdl
![Page 29: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/29.jpg)
Links defined for dependencies between the activities in BEPL
<links> <link name="receive-to-assess"/> <link name="receive-to-approval"/> <link name="approval-to-reply"/> <link name="assess-to-setMessage"/> <link name="setMessage-to-reply"/> <link name="assess-to-approval"/> </links>
![Page 30: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/30.jpg)
<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"/> </receive>
<portType name="loanApprovalPT"> <operation name="approve"> <input message="loandef:creditInformationMessage"/> <output message="tns:approvalMessage"/> <fault name="loanProcessFault" message="loandef:loanRequestErrorMessage"/> </operation> </portType>
portType in loanapprover.wsdl
Receive in BEPL
<link name="receive-to-assess"/> <link name="receive-to-approval"/>
condition
![Page 31: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/31.jpg)
<invoke name="invokeAssessor" partnerLink="assessor" portType="asns:riskAssessmentPT" operation="check" inputVariable="request" outputVariable="riskAssessment"> <target linkName="receive-to-assess"/> <source linkName="assess-to-setMessage" transitionCondition="bpws:getVariableData('riskAssessment', 'risk')='low'"/> <source linkName="assess-to-approval" transitionCondition="bpws:getVariableData('riskAssessment', 'risk')!='low'"/> </invoke>
<Invoke> in BEPL
<portType name="riskAssessmentPT"> <operation name="check"> <input message="loandef:creditInformationMessage"/> <output message="tns:riskAssessmentMessage"/> <fault name="loanProcessFault" message="loandef:loanRequestErrorMessage"/> </operation> </portType>
portType in loanassessor.wsdl
<link name="receive-to-assess"/><link name="assess-to-setMessage"/><link name="assess-to-approval"/>
condition
![Page 32: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/32.jpg)
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">
• <variables>• <variable name="request" • messageType="loandef:creditInformationMessage"/>• <variable name="riskAssessment" • messageType="asns:riskAssessmentMessage"/>• <variable name="approvalInfo" • messageType="apns:approvalMessage"/>• <variable name="error" • messageType="loandef:loanRequestErrorMessage"/>• </variables>
![Page 33: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/33.jpg)
• <partnerLinks>• <partnerLink name="customer" • partnerLinkType="lns:loanApprovalLinkType"• myRole="approver"/>• <partnerLink name="approver" • partnerLinkType="lns:loanApprovalLinkType"• partnerRole="approver"/>• <partnerLink name="assessor" • partnerLinkType="lns:riskAssessmentLinkType"• partnerRole="assessor"/>• </partnerLinks>• <faultHandlers>• <catch faultName="lns:loanProcessFault" • faultVariable="error">• <reply partnerLink="customer"• portType="apns:loanApprovalPT" • operation="approve"• variable="error" • faultName="invalidRequest"/>• </catch>• </faultHandlers>
![Page 34: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/34.jpg)
• <flow>• <links>• <link name="receive-to-assess"/>• <link name="receive-to-approval"/>• <link name="approval-to-reply"/>• <link name="assess-to-setMessage"/>• <link name="setMessage-to-reply"/>• <link name="assess-to-approval"/> • </links>• <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"/>• </receive>
![Page 35: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/35.jpg)
• <invoke name="invokeAssessor" partnerLink="assessor" • portType="asns:riskAssessmentPT" • operation="check"• inputVariable="request" • outputVariable="riskAssessment">• <target linkName="receive-to-assess"/>• <source linkName="assess-to-setMessage" • transitionCondition="bpws:getVariableData('riskAssessment',
'risk')='low'"/>• <source linkName="assess-to-approval" • transitionCondition="bpws:getVariableData('riskAssessment',
'risk')!='low'"/>• </invoke>
• <assign name="assign">• <target linkName="assess-to-setMessage"/>• <source linkName="setMessage-to-reply"/>• <copy>• <from expression="'yes'"/>• <to variable="approvalInfo" part="accept"/>• </copy>• </assign>
![Page 36: BPEL: Business Process Execution Language for Web Services Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic](https://reader036.vdocument.in/reader036/viewer/2022062905/5a4d1ad27f8b9ab059971bd8/html5/thumbnails/36.jpg)
• <invoke name="invokeapprover" • partnerLink="approver" portType="apns:loanApprovalPT" • operation="approve" • inputVariable="request" • outputVariable="approvalInfo">• <target linkName="receive-to-approval"/>• <target linkName="assess-to-approval"/>• <source linkName="approval-to-reply" />• </invoke>
• <reply name="reply" partnerLink="customer" portType="apns:loanApprovalPT"
• operation="approve" variable="approvalInfo">• <target linkName="setMessage-to-reply"/>• <target linkName="approval-to-reply"/>• </reply>• </flow>• </process>