Correlation problem
turanyi Oct 2, 2008 10:51 AMI have simple process with two operations (process, push).
Process starts by operation "process" and reply with input+"started" then waits for operation "push" and reply input+name+"pushed".
It is example of correlations.
Process can be deployed without problems. But there is problem to start instances.
When I remove <bpws:correlations>...</bpws:correlations> from receive activities process works fine but instances don't correlate of course.
Please help me where I do mistake.
Thank you.
WSDL
<definitions name="correlwait" targetNamespace="http://eclipse.org/bpel/correlwait" xmlns:tns="http://eclipse.org/bpel/correlwait" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:bpel="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns="http://schemas.xmlsoap.org/wsdl/" > <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TYPE DEFINITION - List of types participating in this BPEL process The BPEL Designer will generate default request and response types but you can define or import any XML Schema type and use them as part of the message types. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <types> <schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://eclipse.org/bpel/correlwait" xmlns="http://www.w3.org/2001/XMLSchema"> <element name="correlwaitRequest"> <complexType> <sequence> <element name="ID" type="int"/> <element name="input" type="string"/> </sequence> </complexType> </element> <element name="correlwaitResponse"> <complexType> <sequence> <element name="result" type="string"/> </sequence> </complexType> </element> <element name="pushwaitRequest"> <complexType> <sequence> <element name="ID" type="int"/> <element name="name" type="string"/> </sequence> </complexType> </element> <element name="pushwaitResponse"> <complexType> <sequence> <element name="status" type="string"/> </sequence> </complexType> </element> </schema> </types> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MESSAGE TYPE DEFINITION - Definition of the message types used as part of the port type defintions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <message name="correlwaitRequestMessage"> <part name="payload" element="tns:correlwaitRequest"/> </message> <message name="correlwaitResponseMessage"> <part name="payload" element="tns:correlwaitResponse"/> </message> <message name="pushwaitRequestMessage"> <part name="payload" element="tns:pushwaitRequest"/> </message> <message name="pushwaitResponseMessage"> <part name="payload" element="tns:pushwaitResponse"/> </message> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PORT TYPE DEFINITION - A port type groups a set of operations into a logical service unit. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <!-- portType implemented by the correlwait BPEL process --> <portType name="correlwait"> <operation name="process"> <input message="tns:correlwaitRequestMessage" /> <output message="tns:correlwaitResponseMessage"/> </operation> <operation name="push"> <input message="tns:pushwaitRequestMessage" /> <output message="tns:pushwaitResponseMessage"/> </operation> </portType> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PARTNER LINK TYPE DEFINITION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <plnk:partnerLinkType name="correlwait"> <plnk:role name="correlwaitProvider" portType="tns:correlwait"/> </plnk:partnerLinkType> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROPERTY DEFINITION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <bpel:property name="IDproperty" type="int"/> <bpel:propertyAlias propertyName="tns:IDproperty" messageType="tns:correlwaitRequestMessage" part="payload" query="/tns:payload/ID"/> <bpel:propertyAlias propertyName="tns:IDproperty" messageType="tns:pushwaitRequestMessage" part="payload" query="/tns:payload/ID"/> </definitions>
BPEL
<?xml version="1.0" encoding="UTF-8"?> <bpws:process exitOnStandardFault="yes" name="correlwait" suppressJoinFailure="yes" targetNamespace="http://eclipse.org/bpel/correlwait" xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:ns="http://eclipse.org/bpel/correlwaitArtifacts" xmlns:tns="http://eclipse.org/bpel/correlwait"> <bpws:import importType="http://schemas.xmlsoap.org/wsdl/" location="correlwait.wsdl" namespace="http://eclipse.org/bpel/correlwait"/> <bpws:partnerLinks> <bpws:partnerLink myRole="correlwaitProvider" name="client" partnerLinkType="tns:correlwait"/> </bpws:partnerLinks> <bpws:variables> <bpws:variable messageType="tns:correlwaitRequestMessage" name="input"/> <bpws:variable messageType="tns:correlwaitResponseMessage" name="output"/> <bpws:variable messageType="tns:pushwaitRequestMessage" name="pushRequest"/> <bpws:variable messageType="tns:pushwaitResponseMessage" name="pushResponse"/> </bpws:variables> <bpws:correlationSets> <bpws:correlationSet name="IDCorrelationSet" properties="tns:IDproperty"/> </bpws:correlationSets> <bpws:sequence name="main"> <bpws:receive createInstance="yes" name="receiveInput" operation="process" partnerLink="client" portType="tns:correlwait" variable="input"> <bpws:correlations> <bpws:correlation set="IDCorrelationSet" initiate="yes"/> </bpws:correlations> </bpws:receive> <bpws:assign name="outputAssign" validate="no"> <bpws:copy> <bpws:from><bpws:expression>concat($input.payload/tns:input, ' started.')</bpws:expression></bpws:from> <bpws:to variable="output" part="payload" query="/tns:payload/result"/> </bpws:copy> </bpws:assign> <bpws:reply name="replyOutput" operation="process" partnerLink="client" portType="tns:correlwait" variable="output"/> <bpws:receive name="pushReceive" operation="push" partnerLink="client" portType="tns:correlwait" variable="pushRequest"> </bpws:receive> <bpws:assign name="pushAssign" validate="no"> <bpws:copy> <bpws:from> <bpws:expression>concat($input.payload/tns:input, ', ', $pushRequest.payload/tns:name, ' pushed.')</bpws:expression> </bpws:from> <bpws:to variable="pushResponse" part="payload" query="/tns:payload/status"/> </bpws:copy> </bpws:assign> <bpws:reply name="pushReply" operation="push" partnerLink="client" portType="tns:correlwait" variable="pushResponse"/> </bpws:sequence> </bpws:process>