Листинг 1: BPEL partnerLinks и переменные для процесса осуществления заема
<process name = "LoanFlow" targetNamespace = http://samples.cxdn.com ...> <partnerLinks> <partnerLink name = "UnitedLoanService" partnerLinkType = "services:LoanService" myRole = "LoanServiceRequester" partnerRole = "LoanServiceProvider"/> <partnerLink name = "AmericanLoanService" partnerLinkType = "services:LoanService" myRole = "LoanServiceRequester" partnerRole = "LoanServiceProvider"/> </partnerLinks> <variables> <variable name = "loanApplication" messageType = "services:LoanServiceRequestMessage"/> <variable name = "loanOffer1" messageType = "services:LoanServiceResultMessage"/> <variable name = "loanOffer2" messageType = "services:LoanServiceResultMessage"/> </variables> <!Process definition follows --> ... </process>
Листинг 2: BPEL поток, последовательность, вызов и получение в процессе осуществления заема
<flow> <!-- Invoke 1st loan provider in parallel to the second --> <sequence> <invoke name="invokeUnitedLoan" partnerLink="UnitedLoanService" portType="services:LoanService" operation="initiate" inputVariable="loanApplication"/> <receive name="receive_invokeUnitedLoan" partnerLink="UnitedLoanService" portType="services:LoanServiceCallback" operation="onResult" variable="loanOffer1"/> </sequence> <sequence> <!-- Invoke the 2nd loan provider in parallel to the first --> <invoke name="invokeAmericanLoan" partnerLink="AmericanLoanService" portType="services:LoanService" operation="initiate" inputVariable="loanApplication"/> <receive name="receive_invokeAmericanLoan" partnerLink="AmericanLoanService" portType="services:LoanServiceCallback" operation="onResult" variable="loanOffer2"/> </sequence> </flow>