<!-- approval BPEL Process [Generated by the Eclipse BPEL Designer] -->
<!-- Date: Thu Aug 06 16:47:38 CEST 2009 -->
<bpel:process name="riskAssessment"
         targetNamespace="http://orchestra.ow2.org/loanApproval/riskAssessment"
         suppressJoinFailure="yes"
         xmlns:tns="http://orchestra.ow2.org/loanApproval/riskAssessment"
         xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
         xmlns:ns="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://orchestra.ow2.org/loanApproval/common">
         
    <!-- ================================================================= -->         
    <!-- PARTNERLINKS                                                      -->
    <!-- List of services participating in this BPEL process               -->
    <!-- ================================================================= -->         
    <bpel:import namespace="http://orchestra.ow2.org/loanApproval/common" location="../common.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
    <bpel:import namespace="http://orchestra.ow2.org/loanApproval/riskAssessment" location="riskAssessment.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
   
    <bpel:partnerLinks>
        <bpel:partnerLink name="riskAssessmentPLNK" partnerLinkType="tns:riskAssessmentLT" myRole="assessor"></bpel:partnerLink>
    </bpel:partnerLinks>
    <bpel:variables>
        <bpel:variable name="name" type="ns:string"></bpel:variable>
        <bpel:variable name="result" type="ns:string"></bpel:variable>
    </bpel:variables>
    <bpel:sequence>
        <bpel:receive name="Receive" partnerLink="riskAssessmentPLNK" operation="check" createInstance="yes">
            <bpel:fromParts>
                <bpel:fromPart part="name" toVariable="name"></bpel:fromPart>
            </bpel:fromParts>
        </bpel:receive>
        <bpel:if name="If">
            <bpel:condition><![CDATA[$name='Dupont' or $name='McDonalds']]></bpel:condition>
            <bpel:assign validate="no" name="Assign">
                <bpel:copy>
                    <bpel:from>
                        <bpel:literal>medium</bpel:literal>
                    </bpel:from>
                    <bpel:to variable="result"></bpel:to>
                </bpel:copy>
            </bpel:assign>
        <bpel:elseif>
                <bpel:condition><![CDATA[$name='Kent' or $name='Martin']]></bpel:condition>
                <bpel:assign validate="no" name="Assign1">
                    <bpel:copy>
                        <bpel:from>
                            <bpel:literal>high</bpel:literal>
                        </bpel:from>
                        <bpel:to variable="result"></bpel:to>
                    </bpel:copy>
                </bpel:assign>
            </bpel:elseif><bpel:else>
                <bpel:assign validate="no" name="Assign2">
                    <bpel:copy>
                        <bpel:from>
                            <bpel:literal>low</bpel:literal>
                        </bpel:from>
                        <bpel:to variable="result"></bpel:to>
                    </bpel:copy>
                </bpel:assign>
            </bpel:else></bpel:if>
        <bpel:reply name="Reply" partnerLink="riskAssessmentPLNK" operation="check" portType="tns:riskAssessmentPT">
            <bpel:toParts>
                <bpel:toPart part="level" fromVariable="result"></bpel:toPart>
            </bpel:toParts>
        </bpel:reply>
    </bpel:sequence>    
</bpel:process>

