<!-- HRLDAPProces BPEL Process [Generated by the Eclipse BPEL Designer] -->
<!-- Date: Mon Mar 05 12:13:11 IST 2012 -->
<bpel:process name="HRLDAPProces"
targetNamespace="http://ldap.ecis.police.uk/Person/process"
suppressJoinFailure="yes"
xmlns:tns="http://ldap.ecis.police.uk/Person/process"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:ldap="http://webservices.hrldaplookup.ecis.police.uk/" xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://uk.police.ecis.police.uk/athena/services/ConstrainedValueService" xmlns:ns="http://webservices.cvmanagement.athena.ecis.police.uk/">
<!-- Import the client WSDL -->
<bpel:import namespace="http://webservices.cvmanagement.athena.ecis.police.uk/" location="ConstrainedValueService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
<bpel:import namespace="http://uk.police.ecis.police.uk/athena/services/ConstrainedValueService" location="ConstrainedValueService_1.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
<bpel:import namespace="http://webservices.hrldaplookup.ecis.police.uk/" location="LDAPLookupServiceImpl.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
<bpel:import location="HRLDAPProcesArtifacts.wsdl" namespace="http://ldap.ecis.police.uk/Person/process"
importType="http://schemas.xmlsoap.org/wsdl/" />
<!-- ================================================================= -->
<!-- PARTNERLINKS -->
<!-- List of services participating in this BPEL process -->
<!-- ================================================================= -->
<bpel:partnerLinks>
<!-- The 'client' role represents the requester of this service. -->
<bpel:partnerLink name="client"
partnerLinkType="tns:HRLDAPProces"
myRole="HRLDAPProcesProvider"
/>
<bpel:partnerLink name="LDAPLookupPL" partnerLinkType="tns:LDAPLookupPLT" partnerRole="LDAPLookupServiceRole"></bpel:partnerLink>
<bpel:partnerLink name="CVServicePL" partnerLinkType="tns:CVServicePLT" partnerRole="CVServiceRole"></bpel:partnerLink>
</bpel:partnerLinks>
<!-- ================================================================= -->
<!-- VARIABLES -->
<!-- List of messages and XML documents used within this BPEL process -->
<!-- ================================================================= -->
<bpel:variables>
<!-- Reference to the message passed as input during initiation -->
<bpel:variable name="input"
messageType="tns:HRLDAPProcesRequestMessage"/>
<!--
Reference to the message that will be returned to the requester
-->
<bpel:variable name="output"
messageType="tns:HRLDAPProcesResponseMessage"/>
<bpel:variable name="LDAPLookupResponse" messageType="ldap:getPersonnelResponse"></bpel:variable>
<bpel:variable name="LDAPLookupRequest" messageType="ldap:getPersonnel"></bpel:variable>
<bpel:variable name="rankCVInput" type="ns1:string"><from></from></bpel:variable>
<bpel:variable name="forceCVInput" type="ns1:string"><from></from></bpel:variable>
<bpel:variable name="CVServiceResponse" messageType="ns:getCVResponse"></bpel:variable>
<bpel:variable name="CVServiceRequest" messageType="ns:getCV"></bpel:variable>
</bpel:variables>
<!-- ================================================================= -->
<!-- ORCHESTRATION LOGIC -->
<!-- Set of activities coordinating the flow of messages across the -->
<!-- services integrated within this business process -->
<!-- ================================================================= -->
<bpel:sequence name="main">
<!-- Receive input from requester.
Note: This maps to operation defined in HRLDAPProces.wsdl
-->
<bpel:receive name="receiveInput" partnerLink="client"
portType="tns:HRLDAPProces"
operation="process" variable="input"
createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<bpel:sequence name="LDAPLookupSequence">
<bpel:assign validate="no" name="VariableAssign">
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve"><ldap:getPersonnel xmlns:ldap="http://webservices.hrldaplookup.ecis.police.uk/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<forceNumber></forceNumber>
<attributes title=""></attributes>
<attributes title=""></attributes>
<attributes title=""></attributes>
<attributes title=""></attributes>
<attributes title=""></attributes>
<attributes title=""></attributes>
<attributes title=""></attributes>
<attributes title=""></attributes>
<attributes title=""></attributes>
<attributes title=""></attributes>
<serverName></serverName>
<baseNode></baseNode>
</ldap:getPersonnel></bpel:literal>
</bpel:from>
<bpel:to variable="LDAPLookupRequest" part="parameters"></bpel:to>
</bpel:copy>
<bpel:copy keepSrcElementName="no">
<bpel:from part="payload" variable="input">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[tns:input]]>
</bpel:query>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[forceNumber]]>
</bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">LDAP8.xxx.xxx.uxxx:389</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[serverName]]></bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">dc=ecis</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[baseNode]]></bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">Fullname</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[attributes[1]]]>
</bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">FULLNAME</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[attributes[1]/@title]]></bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">First Name</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[attributes[2]]]>
</bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">givenName</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[attributes[2]/@title]]></bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">Last Name</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[attributes[3]]]>
</bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">sn</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[attributes[3]/@title]]></bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">Collar Number</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[attributes[4]]]>
</bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">cn</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[attributes[4]/@title]]></bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">Force Number</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[attributes[5]]]>
</bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">uid</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[attributes[5]/@title]]></bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">Email address</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[attributes[6]]]>
</bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">mail</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[attributes[6]/@title]]></bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">Location</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[attributes[7]]]>
</bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">l</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[attributes[7]/@title]]></bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">Managers Name</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[attributes[8]]]>
</bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">MANAGERNAME</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[attributes[8]/@title]]></bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">Managers Force Number</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[attributes[9]]]>
</bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">MANAGERCN</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[attributes[9]/@title]]></bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">Rank</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[attributes[10]]]>
</bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">employeeType</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="LDAPLookupRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[attributes[10]/@title]]></bpel:query>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">046</bpel:literal>
</bpel:from>
<bpel:to variable="forceCVInput"></bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:invoke name="LDAPLookupInvoke" partnerLink="LDAPLookupPL" operation="getPersonnel" portType="ldap:LDAPLookupServiceImpl" inputVariable="LDAPLookupRequest" outputVariable="LDAPLookupResponse"></bpel:invoke>
<bpel:assign validate="no" name="CVVariableAssign">
<bpel:copy>
<bpel:from>
<bpel:literal>
<tns:getCV xmlns:tns="http://webservices.cvmanagement.athena.ecis.police.uk/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><forceId>046</forceId>
<sourceSystemId>hr</sourceSystemId>
<targetSystemId>Athena</targetSystemId>
<sourceCV>PSE</sourceCV>
</tns:getCV>
</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="CVServiceRequest"></bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from part="parameters" variable="LDAPLookupResponse">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[ldap:personnelData/ldap:detail/ldap:item[1]/@title]]>
</bpel:query>
</bpel:from>
<bpel:to part="parameters" variable="CVServiceRequest">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[sourceCV]]></bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:invoke name="CVRankInvoke" partnerLink="CVServicePL" operation="getCV" portType="ns:ConstrainedValueService" inputVariable="CVServiceRequest" outputVariable="CVServiceResponse"></bpel:invoke>
<bpel:assign validate="no" name="ResultsAssign">
<bpel:copy>
<bpel:from>
<bpel:literal>
<tns:HRLDAPProcesResponse xmlns:tns="http://ldap.ecis.police.uk/Person/process" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><tns:result>tns:result</tns:result>
</tns:HRLDAPProcesResponse>
</bpel:literal>
</bpel:from>
<bpel:to variable="output" part="payload"></bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<![CDATA[$LDAPLookupResponse.parameters//item[1]]]>
</bpel:from>
<bpel:to>$output.payload/tns:result</bpel:to>
</bpel:copy>
</bpel:assign>
</bpel:sequence>
<bpel:reply name="replyOutput"
partnerLink="client"
portType="tns:HRLDAPProces"
operation="process"
variable="output"
/>
</bpel:sequence>
</bpel:process>