SSCC: Service Scenario-based Consistency Checker
Introduction Download Case Study - LAS Contact

Case Study

The case study code is taken from the ActiveBPEL Engine examples and which is taken from the Example section of WS-BPEL specification.

This example consists of a simple loan approval service. Customers of the service send loan requests, including personal information and amount being requested. Using this information, the loan service executes a simple process resulting in either a "loan approved" message or a "loan rejected" message. The decision is based on the amount requested and the risk associated with the customer. For low amounts of less than $10,000 a streamlined process is used. In the streamlined process low-risk customers are approved automatically. For higher amounts, or medium and high-risk customers, the credit request requires further processing. For each request, the loan service uses the functionality provided by two other services. In the streamlined process, used for low amount loans, a risk assessment service is used to obtain a quick evaluation of the risk associated with the customer. A full loan approval service (possibly requiring direct involvement of a loan expert) is used to obtain assessments when the streamlined approval process is not applicable.

The verification process is illustrated in the following figure. Firstly, we take theWS-BPEL files of Web Services as input. Then we simplify theWS-BPEL code and transform the WS-BPEL process to the Petri net models. After that we get the simplified Petri net models by doing the simplification for the Petri net models in last step. The simplified Petri net models are used for the consistency verification against the input scenario specification expressed by the UML Sequence Diagrams. Finally the verification result is given.

The WS-BPEL file is firstly simplified. The aim of simplification is to remove all fault, compensation and termination handlings (FCT-handling), empty activities and merge immediately assignments. The original WS-BPEL code and simplified WS-BPEL code is listed as follows.

The original WS-BPEL codeThe simplified WS-BPEL code
<process name="loanApprovalProcess" targetNamespace="http://example.com/loan-approval/" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:lns="http://example.com/loan-approval/wsdl/" suppressJoinFailure="yes"> <import importType="http://schemas.xmlsoap.org/wsdl/" location="loanServicePT.wsdl" namespace="http://example.com/loan-approval/wsdl/" /> <partnerLinks> <partnerLink name="customer" partnerLinkType="lns:loanPartnerLT" myRole="loanService" /> <partnerLink name="approver" partnerLinkType="lns:loanApprovalLT" partnerRole="approver" /> <partnerLink name="assessor" partnerLinkType="lns:riskAssessmentLT" partnerRole="assessor" /> </partnerLinks> <variables> <variable name="request" messageType="lns:creditInformationMessage" /> <variable name="risk" messageType="lns:riskAssessmentMessage" /> <variable name="approval" messageType="lns:approvalMessage" /> </variables> <faultHandlers> <catch faultName="lns:loanProcessFault" faultVariable="error" faultMessageType="lns:errorMessage"> <reply partnerLink="customer" portType="lns:loanServicePT" operation="request" variable="error" faultName="unableToHandleRequest" /> </catch> </faultHandlers> <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 partnerLink="customer" portType="lns:loanServicePT" operation="request" variable="request" createInstance="yes"> <sources> <source linkName="receive-to-assess"> <transitionCondition> $request.amount &lt; 10000 </transitionCondition> </source> <source linkName="receive-to-approval"> <transitionCondition> $request.amount >= 10000 </transitionCondition> </source> </sources> </receive> <invoke partnerLink="assessor" portType="lns:riskAssessmentPT" operation="check" inputVariable="request" outputVariable="risk"> <targets> <target linkName="receive-to-assess" /> </targets> <sources> <source linkName="assess-to-setMessage"> <transitionCondition> $risk.level='low' </transitionCondition> </source> <source linkName="assess-to-approval"> <transitionCondition> $risk.level!='low' </transitionCondition> </source> </sources> </invoke> <assign> <targets> <target linkName="assess-to-setMessage" /> </targets> <sources> <source linkName="setMessage-to-reply" /> </sources> <copy> <from> <literal>yes</literal> </from> <to variable="approval" part="accept" /> </copy> </assign> <invoke partnerLink="approver" portType="lns:loanApprovalPT" operation="approve" inputVariable="request" outputVariable="approval"> <targets> <target linkName="receive-to-approval" /> <target linkName="assess-to-approval" /> </targets> <sources> <source linkName="approval-to-reply" /> </sources> </invoke> <reply partnerLink="customer" portType="lns:loanServicePT" operation="request" variable="approval"> <targets> <target linkName="setMessage-to-reply" /> <target linkName="approval-to-reply" /> </targets> </reply> </flow> </process> <?xml version="1.0" encoding="UTF-8"?> <bpel:process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:lns="http://example.com/loan-approval/wsdl/" name="loanApprovalProcess" suppressJoinFailure="yes" targetNamespace="http://example.com/loan-approval/"> <bpel:import importType="http://schemas.xmlsoap.org/wsdl/" location="loanServicePT.wsdl" namespace="http://example.com/loan-approval/wsdl/"/> <bpel:partnerLinks> <bpel:partnerLink myRole="loanService" name="customer" partnerLinkType="lns:loanPartnerLT"/> <bpel:partnerLink name="approver" partnerLinkType="lns:loanApprovalLT" partnerRole="approver"/> <bpel:partnerLink name="assessor" partnerLinkType="lns:riskAssessmentLT" partnerRole="assessor"/> </bpel:partnerLinks> <bpel:variables> <bpel:variable messageType="lns:creditInformationMessage" name="request"/> <bpel:variable messageType="lns:riskAssessmentMessage" name="risk"/> <bpel:variable messageType="lns:approvalMessage" name="approval"/> </bpel:variables> <bpel:flow name="ACT1"> <bpel:links> <bpel:link name="receive-to-assess"/> <bpel:link name="receive-to-approval"/> <bpel:link name="approval-to-reply"/> <bpel:link name="assess-to-setMessage"/> <bpel:link name="setMessage-to-reply"/> <bpel:link name="assess-to-approval"/> </bpel:links> <bpel:receive createInstance="yes" name="ACT2" operation="request" partnerLink="customer" portType="lns:loanServicePT" variable="request"> <bpel:sources> <bpel:source linkName="receive-to-assess"> <bpel:transitionCondition> $request.amount &lt; 10000 </bpel:transitionCondition> </bpel:source> <bpel:source linkName="receive-to-approval"> <bpel:transitionCondition> $request.amount &gt;= 10000 </bpel:transitionCondition> </bpel:source> </bpel:sources> </bpel:receive> <bpel:invoke inputVariable="request" name="ACT3" operation="check" outputVariable="risk" partnerLink="assessor" portType="lns:riskAssessmentPT"> <bpel:targets> <bpel:target linkName="receive-to-assess"/> </bpel:targets> <bpel:sources> <bpel:source linkName="assess-to-setMessage"> <bpel:transitionCondition> $risk.level='low' </bpel:transitionCondition> </bpel:source> <bpel:source linkName="assess-to-approval"> <bpel:transitionCondition> $risk.level!='low' </bpel:transitionCondition> </bpel:source> </bpel:sources> </bpel:invoke> <bpel:assign name="ACT4"> <bpel:targets> <bpel:target linkName="assess-to-setMessage"/> </bpel:targets> <bpel:sources> <bpel:source linkName="setMessage-to-reply"/> </bpel:sources> <bpel:copy> <bpel:from> <bpel:literal>yes</bpel:literal> </bpel:from> <bpel:to part="accept" variable="approval"/> </bpel:copy> </bpel:assign> <bpel:invoke inputVariable="request" name="ACT5" operation="approve" outputVariable="approval" partnerLink="approver" portType="lns:loanApprovalPT"> <bpel:targets> <bpel:target linkName="receive-to-approval"/> <bpel:target linkName="assess-to-approval"/> </bpel:targets> <bpel:sources> <bpel:source linkName="approval-to-reply"/> </bpel:sources> </bpel:invoke> <bpel:reply name="ACT6" operation="request" partnerLink="customer" portType="lns:loanServicePT" variable="approval"> <bpel:targets> <bpel:target linkName="setMessage-to-reply"/> <bpel:target linkName="approval-to-reply"/> </bpel:targets> </bpel:reply> </bpel:flow> </bpel:process>

The simplified WS-BPEL file is then transformed into Petri net model and the Petri net is also simplified to remove redundant places and transitions. In the following figure, the Petri net is presented. And you can download the generated PNML file here.

Three Rational Rose UML Sequence Diagrams are provided as scenario-based specifications for verification. The files are assessorUSD.mdl, approvalUSD.mdl and replyUSD.mdl in the archive file of the case study (can be downloaded in the download page). These three sequence diagrams can either be used for existential consistency checking or mandatory consistency checking. Here we give results of two examples. Scenario 1 is to check the existence of invoking the loan approver service and receiving reply from it, i.e. to perform existential consistency checking of approvalUSD.mdl. Scenario 2 is to check wheter replying the customer immediately follows the invocation of assesment service (and receiving reply from it), i.e. to perform forward mandatory consistency checking of assessorUSD.mdl (as SD1) and replyUSD.mdl (as SD2).

The checking result of Scenario 1:
Three paths are presented here, note that only the id of transitions are shown:
E.g. 1:   (φ0)t0 ^ (φ1)t1 ^ (φ2)t3 ^ (φ3)t4 ^ (φ4)t5 ^ (φ5)t12 ^ (φ6)t13 ^ (φ7)t14
E.g. 2:   (φ0)t0 ^ (φ1)t1 ^ (φ2)t3 ^ (φ3)t16 ^ (φ4)t17 ^ (φ5)t12 ^ (φ6)t13 ^ (φ7)t14
E.g. 3:   (φ0)t0 ^ (φ1)t1 ^ (φ2)t3 ^ (φ3)t4 ^ (φ4)t5 ^ (φ5)t6 ^ (φ6)t7 ^ (φ7)t12 ^ (φ8)t13 ^ (φ9)t14
And if the scenario is satisfied, transitions t0, t1, t3, t12, t13, t14 must be fired, while transitions t0, t1, t3, t4, t5, t6, t12, t7, t13, t14, t11, t16, t17 can possibly be fired in some order.

The checking result of Scenario 2:
Three paths are presented here, note that only the id of transitions are shown:
E.g. 1:   (φ0)t0 ^ (φ1)t1 ^ (φ2)t3 ^ (φ3)t4 ^ (φ4)t5 ^ (φ5)t6 ^ (φ6)t7 ^ (φ7)t12 ^ (φ8)t15 ^ (φ9)t8 ^ (φ10)t9
E.g. 2:   (φ0)t0 ^ (φ1)t1 ^ (φ2)t3 ^ (φ3)t4 ^ (φ4)t5 ^ (φ5)t6 ^ (φ6)t11 ^ (φ7)t12 ^ (φ8)t15 ^ (φ9)t8 ^ (φ10)t9
E.g. 3:   (φ0)t0 ^ (φ1)t1 ^ (φ2)t3 ^ (φ3)t4 ^ (φ4)t5 ^ (φ5)t12 ^ (φ6)t15 ^ (φ7)t6 ^ (φ8)t7 ^ (φ9)t8 ^ (φ10)t9
And if the scenario is satisfied, transitions t0, t1, t3, t4, t5, t12, t6, t15, t8, t9 must be fired, while transitions t0, t1, t3, t4, t5, t12, t6, t15, t11, t8, t9, t7 can possibly be fired in some order.


©2007 SEG NJU Homepage IntroductionDownloadCase StudyContact