Loan approval case for BPEL (2)
We copy the business process definition of this example below for instructions:
<Process name = "loanapprovalprocess"
Targetnamespace = "http://acme.com/loanprocessing"
Xmlns = "http://schemas.xmlsoap.org/ws/2003/03/business-process"
Xmlns: lNS = "http://loans.org/wsdl/loan-approval"
Suppressjoinfailure = "yes">
<Partnerlinks>
<Partnerlink name = "customer"
Partnerlinktype = "lNS: loanpartnerlinktype"
Myrole = "loanservice"/>
<Partnerlink name = "approver"
Partnerlinktype = "lNS: loanapprovallinktype"
Partnerrole = "approver"/>
<Partnerlink name = "assessor"
Partnerlinktype = "lNS: riskassessmentlinktype"
Partnerrole = "assessor"/>
</Partnerlinks>
<Variables>
<Variable name = "request"
Messagetype = "lNS: creditinformationmessage"/>
<Variable name = "risk"
Messagetype = "lNS: riskassessmentmessage"/>
<Variable name = "approval"
Messagetype = "lNS: approvalmessage"/>
<Variable name = "error"
Messagetype = "lNS: errormessage"/>
</Variables>
<Faulthandlers>
<Catch faultname = "lNS: loanprocessfault"
Faultvariable = "error">
<Reply partnerlink = "customer"
Porttype = "lNS: loanservicept"
Operation = "request"
Variable = "error"
Faultname = "unabletohandlerequest"/>
</Catch>
</Faulthandlers>
<Flow>
H: <flow> indicates that a set of steps should be executed in parallel. In a group of activities that are executed in parallel, you can use links to specify constraints on the execution sequence.
<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>
H: each step of the process is called an activity. There are some basic activities:
H: receive waits for a message to respond to the operation of a service interface called by someone from outside
<Receive partnerlink = "customer"
Porttype = "lNS: loanservicept"
Operation = "request"
Variable = "request" createinstance = "yes">
H: Transfer and conditions
<Source linkname = "receive-to-assess"
Transitioncondition =
"Bpws: getvariabledata ('request', 'amount') <10000"/>
<Source linkname = "receive-to-approval"
Transitioncondition =
"Bpws: getvariabledata ('request', 'amount')> = 10000"/>
</Receive>
H: invoke calls operations on a Web Service
<Invoke partnerlink = "assessor"
Porttype = "lNS: riskassessmentpt"
Operation = "check"
Inputvariable = "request"
Outputvariable = "risk">
<Target linkname = "receive-to-assess"/>
<Source linkname = "assess-to-setmessage"
Transitioncondition =
"Bpws: getvariabledata ('risk', 'level') = 'low'"/>
<Source linkname = "assess-to-approval"
Transitioncondition =
"Bpws: getvariabledata ('risk', 'level ')! = 'Low' "/>
</Invoke>
H: Assign copies data from one place to another
<Assign>
<Target linkname = "assess-to-setmessage"/>
<Source linkname = "setmessage-to-reply"/>
<Copy>
<From expression = "'Yes'"/>
<To variable = "approval" part = "accept"/>
</Copy>
</Assign>
H: invoke calls operations on a Web Service
<Invoke partnerlink = "approver"
Porttype = "lNS: loanapprovalpt"
Operation = "approve"
Inputvariable = "request"
Outputvariable = "approval">
<Target linkname = "receive-to-approval"/>
<Target linkname = "assess-to-approval"/>
<Source linkname = "Approval-to-reply"/>
</Invoke>
H: reply to generate input/output operation responses
<Reply partnerlink = "customer"
Porttype = "lNS: loanservicept"
Operation = "request"
Variable = "approval">
<Target linkname = "setmessage-to-reply"/>
<Target linkname = "Approval-to-reply"/>
</Reply>
</Flow>
</Process>