1 Reply Latest reply on Sep 21, 2008 9:31 AM by Fabiana Valandro

    Using Correlations in JBPM-BPEL

    Dhanush Gopinath Newbie

      Hi,

      I assume I can post queries regarding JBPM-BPEL here.

      I am using jBPM-BPEL 1.1.GA with JBOSS 4.2.0.GA. I am having correlation sets in my process. But I am not able to deploy the process. Deployment throws a hibernate exception

      org.jbpm.JbpmException: problem closing services {persistence=org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.ibm.wsdl.MessageImpl}
       org.jbpm.svc.Services.close(Services.java:245)
       org.jbpm.JbpmContext.close(JbpmContext.java:139)
       org.jbpm.bpel.web.DeploymentServlet.deployProcessDefinition(DeploymentServlet.java:195)
      
      
      root cause
      
      org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.ibm.wsdl.MessageImpl
       org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
      
      


      This happens only when I use correlation sets. If I remove the reference to the correlation sets, it works fine and gets deployed. Any idea how to solve this? has anyone come across such an error? I googled and didn't find many answers

      I am attaching the bpel and wsdl files here

      process file:
      <?xml version="1.0" encoding="UTF-8"?>
      <bpel:process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:corr="http://www.example.org/HTCorrelations/" xmlns:data="http://www.example.org/HTDataSchema/" xmlns:ns1="http://www.example.org/HTCreateAssembly/" xmlns:ns2="http://www.example.org/HTAssignUsersPT/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      name="HTCreateAssembly" suppressJoinFailure="yes" targetNamespace="http://HTCreateAssembly">
       <bpel:import importType="http://schemas.xmlsoap.org/wsdl/" location="HTCreateAssembly.wsdl" namespace="http://www.example.org/HTCreateAssembly/"/>
       <bpel:import importType="http://schemas.xmlsoap.org/wsdl/" location="HTAssignUsersPT.wsdl" namespace="http://www.example.org/HTAssignUsersPT/"/>
       <bpel:import importType="http://schemas.xmlsoap.org/wsdl/" location="HTCorrelations.wsdl" namespace="http://www.example.org/HTCorrelations/"/>
       <bpel:partnerLinks>
       <bpel:partnerLink myRole="StartAssemblyServiceODE" name="StartAssemblyPL" partnerLinkType="ns1:StartAssemblyLT"/>
       <bpel:partnerLink myRole="AssignUserServiceResponseODE" name="AssignUserServicePL" partnerLinkType="ns2:AssignUserServiceLT" partnerRole="AssignUserServiceODE"/>
       </bpel:partnerLinks>
       <bpel:variables>
       <bpel:variable name="inputUser" messageType="ns1:StartAssemblyRequest"/>
       <bpel:variable name="assignUserResponse" messageType="ns2:AssignUsersResponse"/>
       <bpel:variable name="assignedUser" messageType="ns2:AssignUsersRequest"/>
       </bpel:variables>
       <bpel:correlationSets>
       <bpel:correlationSet name="CS1" properties="corr:UserID"/>
       </bpel:correlationSets>
       <bpel:sequence>
       <bpel:receive createInstance="yes" name="Start" operation="StartAssembly" partnerLink="StartAssemblyPL" variable="inputUser">
      
       </bpel:receive>
       <bpel:invoke inputVariable="assignedUser" name="InvokeAssignUsers" operation="AssignUsers" partnerLink="AssignUserServicePL">
       <bpel:correlations>
       <bpel:correlation initiate="yes" pattern="request" set="CS1"/>
       </bpel:correlations>
       </bpel:invoke>
       <bpel:receive name="ReceiveResponse" operation="GetAssignUsersResponse" partnerLink="AssignUserServicePL" variable="assignUserResponse">
       <bpel:correlations>
       <bpel:correlation initiate="no" set="CS1"/>
       </bpel:correlations>
       </bpel:receive>
      
       <bpel:assign>
       <bpel:copy>
       <bpel:from>
       <bpel:literal>
       <sref:service-ref xmlns:sref="http://docs.oasis-open.org/wsbpel/2.0/serviceref">
       <soap:address location="http://localhost:8090/AssignUsersWSODE2/AssignUserServiceODE"/>
       </sref:service-ref>
       </bpel:literal>
       </bpel:from>
       <bpel:to partnerLink="AssignUserServicePL"/>
       </bpel:copy>
       </bpel:assign>
      
       <bpel:assign>
       <bpel:copy>
       <bpel:from>
       <bpel:literal>
       <data:AssignUsers>
       <data:userid>A3</data:userid>
       </data:AssignUsers>
       </bpel:literal>
       </bpel:from>
       <bpel:to>$assignedUser.assinguserIP</bpel:to>
       </bpel:copy>
       </bpel:assign>
       <bpel:assign>
       <bpel:copy>
       <bpel:from>$assignedUser.assinguserIP</bpel:from>
       <bpel:to>$assignUserResponse.assinguserRespIP</bpel:to>
       </bpel:copy>
       </bpel:assign>
       </bpel:sequence>
      </bpel:process>
      


      wsdl files:
      
      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions xmlns:tns="http://www.example.org/HTCreateAssembly/"
       xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HTCreateAssembly"
       xmlns:data="http://www.example.org/HTDataSchema/"
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
       targetNamespace="http://www.example.org/HTCreateAssembly/">
      
       <plnk:partnerLinkType name="StartAssemblyLT"
       xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
       <plnk:role name="StartAssemblyServiceODE"
       portType="tns:StartAssemblyPT" />
       </plnk:partnerLinkType>
      
       <wsdl:types>
       <xsd:schema>
       <xsd:import namespace="http://www.example.org/HTDataSchema/"
       schemaLocation="HTDataSchema.xsd">
       </xsd:import>
       </xsd:schema>
       </wsdl:types>
       <wsdl:message name="StartAssemblyRequest">
       <wsdl:part element="data:AssignUsersReq" name="startAssemblyIP" />
       </wsdl:message>
       <wsdl:portType name="StartAssemblyPT">
       <wsdl:operation name="StartAssembly">
       <wsdl:input message="tns:StartAssemblyRequest" />
       </wsdl:operation>
       </wsdl:portType>
      
       <wsdl:binding name="StartAssemblyBinding" type="tns:StartAssemblyPT">
       <soap:binding style="document"
       transport="http://schemas.xmlsoap.org/soap/http" />
       <wsdl:operation name="StartAssembly">
       <soap:operation
       soapAction="http://www.example.org/HTCreateAssembly/StartAssembly" />
       <wsdl:input>
       <soap:body use="literal" />
       </wsdl:input>
       </wsdl:operation>
       </wsdl:binding>
      
       <wsdl:service name="StartAssemblyServiceODE">
       <wsdl:port name="StartAssemblyPort" binding="tns:StartAssemblyBinding">
       <soap:address location="http://localhost:8080/ode/processes/StartAssembly"/>
       </wsdl:port>
       </wsdl:service>
      
      </wsdl:definitions>
      
      ______________________________________
      
      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions xmlns:tns="http://www.example.org/HTAssignUsersPT/"
       xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HTAssignUsersPT"
       xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
       targetNamespace="http://www.example.org/HTAssignUsersPT/"
       xmlns:data="http://www.example.org/HTDataSchema/"
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
      
      
       <plnk:partnerLinkType name="AssignUserServiceLT"
       xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
       <plnk:role name="AssignUserServiceODE" portType="tns:AssignUserPT" />
       <plnk:role name="AssignUserServiceResponseODE"
       portType="tns:AssignUserResponsePT" />
       </plnk:partnerLinkType>
      
       <wsdl:types>
       <xsd:schema>
       <xsd:import namespace="http://www.example.org/HTDataSchema/"
       schemaLocation="HTDataSchema.xsd">
       </xsd:import>
       </xsd:schema>
       </wsdl:types>
      
       <wsdl:message name="AssignUsersRequest">
       <wsdl:part element="data:AssignUsersReq" name="assinguserIP" />
       </wsdl:message>
       <wsdl:message name="AssignUsersResponse">
       <wsdl:part element="data:AssignUsersReply"
       name="assinguserRespIP" />
       </wsdl:message>
      
       <wsdl:portType name="AssignUserPT">
       <wsdl:operation name="AssignUsers">
       <wsdl:input message="tns:AssignUsersRequest" />
       </wsdl:operation>
       </wsdl:portType>
       <wsdl:portType name="AssignUserResponsePT">
       <wsdl:operation name="GetAssignUsersResponse">
       <wsdl:input message="tns:AssignUsersResponse" />
       </wsdl:operation>
       </wsdl:portType>
      
       <wsdl:binding name="AssignUserBinding" type="tns:AssignUserPT">
       <soap:binding style="document"
       transport="http://schemas.xmlsoap.org/soap/http" />
       <wsdl:operation name="AssignUsers">
       <soap:operation
       soapAction="http://www.example.org/HTAssignUsersPT/AssignUsers" />
       <wsdl:input>
       <soap:body use="literal" />
       </wsdl:input>
       </wsdl:operation>
       </wsdl:binding>
      
       <wsdl:binding name="AssignUserResponseBinding" type="tns:AssignUserResponsePT">
       <soap:binding style="document"
       transport="http://schemas.xmlsoap.org/soap/http" />
       <wsdl:operation name="GetAssignUsersResponse">
       <soap:operation
       soapAction="http://www.example.org/HTAssignUsersPT/GetAssignUsersResponse" />
       <wsdl:input>
       <soap:body use="literal" />
       </wsdl:input>
       </wsdl:operation>
       </wsdl:binding>
      
       <wsdl:service name="AssignUserServiceODE">
       <wsdl:port name="AssignUserServicePort"
       binding="tns:AssignUserBinding">
       <soap:address
       location="http://localhost:8090/AssignUserWsODE/AssignUserServiceODE"></soap:address>
       </wsdl:port>
       <wsdl:port name="AssignUserResponseServicePort"
       binding="tns:AssignUserResponseBinding">
       <soap:address location="http://localhost:8080/ode/processes/AssignUserResponse"></soap:address>
       </wsdl:port>
       </wsdl:service>
      </wsdl:definitions>
      
      


      Correlation WSDL:

      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions xmlns:tns="http://www.example.org/HTCorrelations/"
       xmlns:usrmsg="http://www.example.org/HTAssignUsersPT/"
       xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HTCorrelations"
       xmlns:data="http://www.example.org/HTDataSchema/"
       xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop"
       targetNamespace="http://www.example.org/HTCorrelations/">
      
       <wsdl:import location="HTAssignUsersPT.wsdl" namespace="http://www.example.org/HTAssignUsersPT/"/>
       <wsdl:types>
       <xsd:schema>
       <xsd:import namespace="http://www.example.org/HTDataSchema/"
       schemaLocation="HTDataSchema.xsd">
       </xsd:import>
       </xsd:schema>
       </wsdl:types>
      
       <vprop:property name="UserID" type="xsd:string"/>
      
       <vprop:propertyAlias messageType="usrmsg:AssignUsersRequest"
       part="assinguserIP" propertyName="tns:UserID">
       <vprop:query>/data:AssignUsersReq/data:userid</vprop:query>
       </vprop:propertyAlias>
      
       <vprop:propertyAlias messageType="usrmsg:AssignUsersResponse"
       part="assinguserRespIP" propertyName="tns:UserID">
       <vprop:query>/data:AssignUsersReply/data:userid</vprop:query>
       </vprop:propertyAlias>
      
      </wsdl:definitions>
      


      Is there any document explaining the usage of correlation sets in Jboss jbpm bpel?


      Thanks
      Dhanush Gopinath