4 Replies Latest reply on Dec 5, 2005 6:30 AM by Joshua Tree

    Correlation issue

    Joshua Tree Newbie

      Dear community,

      I hava a process that receives a processID as an input. I want to use that processID for correlation, because each process has a unique processID. The problem is that i cannot correlate my process instances. My process has an receive activity, followed by two invokes and then another receive operation.The second receive operation's input is the processID.

      My second receive operation is suppose to correlate the processID and continue the execution, in this case, finish the execution, but is not. It hangs in there and never ends.

      The problem is with the correlation. The process instances are not being correlated. So the process hangs in the second receive, because it never detects a call with the same processID.

      Should it work like that?
      Can i correlate the process instance like that?
      I do not have to use the sessionFactory from ATM do I?
      That was a solution for that specific problem, right?




      Process:

      <process name="helloWorld" targetNamespace="http://jbpm.org/examples/hello"
       xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
       xmlns:tns="http://jbpm.org/examples/hello"
       xmlns:bpel="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      
       xsi:schemaLocation="http://schemas.xmlsoap.org/ws/2003/03/business-process/
       http://schemas.xmlsoap.org/ws/2003/03/business-process/"
       xmlns:impl="http://myapp.com">
       <partnerLinks>
       <!-- realizes the abstract relationship with the caller -->
       <partnerLink name="caller" partnerLinkType="tns:ROinPLT"
       myRole="service"/>
      
       <partnerLink name="sendData"
       partnerLinkType="tns:ROInterfaceOM_PINOSLink"
       partnerRole="ROInterfaceOM_PINOSService"/>
      
       <partnerLink name="getData" partnerLinkType="tns:ROInterfaceOM_BDLink"
       partnerRole="ROInterfaceOM_BDService"/>
      
      
      
       </partnerLinks>
      
      
       <variables>
       <!-- holds the incoming message -->
       <variable name="processID" messageType="tns:processIDMessage"/>
       <variable name="return" messageType="tns:returnMessage"/>
       <variable name="getDataInput" messageType="impl:getDataRequest"/>
       <variable name="getDataOutput" messageType="impl:getDataResponse"/>
       <variable name="updateInput"
       messageType="impl:updateEstadoFaseRequest"/>
       <variable name="updateOutput"
       messageType="impl:updateEstadoFaseResponse"/>
       <variable name="sendInput" messageType="impl:sendDataRequest"/>
      
       <variable name="sendOutput" messageType="impl:sendDataResponse"/>
       <variable name="receiveNotification"
       messageType="tns:notificationMessage"/>
      
      
       <!-- -->
       </variables>
      
       <correlationSets>
       <correlationSet name="Processinteraction" properties="tns:ProcessOrderId"/>
       </correlationSets>
      
       <sequence name="mainSequence">
       <!-- receive a message carrying the name of a person -->
       <receive operation="initiate" partnerLink="caller"
       portType="tns:ROinPT" variable="processID" createInstance="yes">
      
       <correlations>
       <correlation set="Processinteraction" initiate="yes"/>
       </correlations>
      
       </receive>
      
      
       <assign name="copyID">
       <copy>
       <from
       expression="bpel:getVariableData('processID', 'processID')"/>
       <to variable="getDataInput" part="in0"/>
       </copy>
       </assign>
      
      
       <invoke name="getData" inputVariable="getDataInput"
       partnerLink="getData" operation="getData"
       portType="impl:ROInterfaceOM_BD" outputVariable="getDataOutput">
       </invoke>
      
       <assign name="copy2sendData">
       <copy>
       <from
       expression="bpel:getVariableData('getDataOutput', 'getDataReturn')"/>
       <to variable="sendInput" part="in0"/>
       </copy>
       </assign>
       <invoke name="sendData" inputVariable="sendInput"
       partnerLink="sendData" operation="sendData"
       portType="impl:ROInterfaceOM_PINOS" outputVariable="sendOutput">
       </invoke>
       <assign name="copy2update">
       <copy>
       <from expression="'C'"/>
       <to variable="updateInput" part="in0"/>
       </copy>
       </assign>
       <invoke name="getData" inputVariable="updateInput"
       partnerLink="getData" operation="updateEstadoFase"
       portType="impl:ROInterfaceOM_BD" outputVariable="updateOutput">
       </invoke>
      
      
       <!-- Second receive -->
      
       <scope name="waiting4CadRede">
       <sequence name="response">
      
       <variable name="return" messageType="tns:returnMessage"/>
      
       <receive name="receiveFromCadRede" partnerLink="caller" portType="tns:ROinPT"
       operation="receiveNotification" variable="receiveNotification" createInstance="no">
       <correlations>
       <correlation set="Processinteraction" initiate="no"/>
       </correlations>
      
       </receive>
      
      
       <assign name="copy2return">
       <copy>
       <from
       expression="bpel:getVariableData('getDataOutput', 'getDataReturn')"/>
       <to variable="return" part="return"/>
       </copy>
       </assign>
      
      
      
      
      
       </sequence>
       </scope>
      
      
      
      
      
       <!-- reply with a message carrying the greeting -->
       <reply operation="initiate" partnerLink="caller" portType="tns:ROinPT"
       variable="return"/>
       </sequence>
      </process>
      


      wsdl:
      <definitions
       targetNamespace="http://jbpm.org/examples/hello"
       xmlns:tns="http://jbpm.org/examples/hello"
       xmlns:impl="http://myapp.com"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://schemas.xmlsoap.org/wsdl/"
       xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
       xmlns:bpel="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
       xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/">
      
      
       <!-- getData WS -->
       <import namespace="http://myapp.com"
       location="http://runner:8080/ROInterfaceOM_BD/exactpath/jse?wsdl"/>
      
      
       <!-- sendData WS -->
       <import namespace="http://myapp.com"
       location="http://runner:8080/ROInterfaceOM_PINOS/exactpath/jse?wsdl"/>
      
      
       <bpel:property name="ProcessOrderId" type="xsd:string"/>
      
       <bpel:propertyAlias propertyName="tns:ProcessOrderId"
       messageType="tns:processIDMessage" part="processID"/>
       <bpel:propertyAlias propertyName="tns:ProcessOrderId"
       messageType="tns:notificationMessage" part="processID"/>
      
      
      
      
      
      
       <plt:partnerLinkType name="ROInterfaceOM_PINOSLink">
       <plt:role name="ROInterfaceOM_PINOSService">
       <plt:portType name="impl:ROInterfaceOM_PINOS"/>
       </plt:role>
       </plt:partnerLinkType>
      
      
      
       <plt:partnerLinkType name="ROInterfaceOM_BDLink">
       <plt:role name="ROInterfaceOM_BDService">
       <plt:portType name="impl:ROInterfaceOM_BD"/>
       </plt:role>
       </plt:partnerLinkType>
      
      
      
       <!-- characterizes the relationship between the process and its caller -->
       <plt:partnerLinkType name="ROinPLT">
       <plt:role name="service">
       <plt:portType name="tns:ROinPT"/>
       </plt:role>
       </plt:partnerLinkType>
      
      
      
      
       <message name="processIDMessage">
       <part name="processID" type="xsd:string"/>
       </message>
      
       <message name="notificationMessage">
       <part name="processID" type="xsd:string"/>
       </message>
      
      
       <message name="returnMessage">
       <part name="return" type="xsd:string"/>
       </message>
      
      
       <portType name="ROinPT">
       <operation name="initiate">
       <input message="tns:processIDMessage"/>
       <output message="tns:returnMessage"/>
       </operation>
       <operation name="receiveNotification">
       <input message="tns:notificationMessage"/>
       <output message="tns:returnMessage"/>
       </operation>
      
       </portType>
      
      
       <!-- carries the name of a person -->
       <!-- carries the greeting -->
       <!-- describes the interface presented to callers -->
      </definitions>
      
      




        • 1. Re: Correlation issue
          Alejandro Guizar Master

          Sorry, I missed this one. I'll answer it during the weekend!

          • 2. Re: Correlation issue
            Joshua Tree Newbie

            Hi Alex,

            I kind of solve the problem. I had a process activity like that:


            receive (correlated)
            invoke
            invoke
            receive (correlate)
            reply (the first receive)

            This structure does not work, i do not know why. But if i use the reply after the receive for both receives it works.

            receive (correlated)
            reply

            invoke
            invoke

            receive (correlate)
            reply


            Fromt the example files that i posted before, you can see that i have a bug in the operation receiveNotification. This operation has an output message and i was not replying to it. I fixed that by removing the output message from the operation and it still didnt work.

            Apparantely, it only worked if i use receive-reply (one after the other) during the process. I i use receive and then another receive and then reply to the first receive i cannot correlate. Maybe i am doing something wrong...

            Anyway, thanks a lot for having me ;)

            • 3. Re: Correlation issue
              Alejandro Guizar Master

              The ATM example process contains receive-reply pairs that have other activities between them, so that's not the problem.

              I think the problem resides in having more than one outstanding request, tough. Please send your zipped project to me through e-mail. I'll post an answer here when I find something.

              • 4. Re: Correlation issue
                Joshua Tree Newbie

                Alex, thanks for your pacience.

                You will see in the *.wsdl and *.bpel that i am importing a schema file that contains the complex types that will be use in the operations. I can do the deploy, but when i try to run the (src/HelloTest) i get a :


                ------------- Standard Output ---------------
                 [junit] 11:28:26,333 ERROR Service : Invalid byte 2 of 3-byte UTF-8 sequence.
                 [junit] java.io.UTFDataFormatException: Invalid byte 2 of 3-byte UTF-8 sequence.
                 [junit] at org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown Source)
                 [junit] at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
                 [junit] at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
                 [junit] at org.apache.xerces.impl.XMLEntityScanner.scanContent(Unknown Source)
                 [junit] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unknown Source)
                 [junit] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
                 [junit] at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
                 [junit] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
                 [junit] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
                 [junit] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
                 [junit] at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
                 [junit] at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
                 [junit] at org.jboss.axis.utils.XMLUtils.newDocument(XMLUtils.java:274)
                 [junit] at org.jboss.axis.utils.XMLUtils.newDocument(XMLUtils.java:322)
                 [junit] at org.jboss.axis.utils.XMLUtils.newDocument(XMLUtils.java:304)
                 [junit] at org.jboss.axis.wsdl.symbolTable.SymbolTable.lookForImports(SymbolTable.java:729)
                 [junit] at org.jboss.axis.wsdl.symbolTable.SymbolTable.lookForImports(SymbolTable.java:734)
                 [junit] at org.jboss.axis.wsdl.symbolTable.SymbolTable.lookForImports(SymbolTable.java:734)
                 [junit] at org.jboss.axis.wsdl.symbolTable.SymbolTable.lookForImports(SymbolTable.java:734)
                 [junit] at org.jboss.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:608)
                 [junit] at org.jboss.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:629)
                 [junit] at org.jboss.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:629)
                 [junit] at org.jboss.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:464)
                 [junit] at org.jboss.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:450)
                 [junit] at org.jboss.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:433)
                 [junit] at org.jboss.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:273)
                 [junit] at java.lang.Thread.run(Thread.java:595)
                 [junit] ------------- ---------------- ---------------
                 [junit] Testcase: testSayHello(org.jbpm.bpel.tutorial.hello.HelloTest): Caused an ERROR
                 [junit] Could not dereference object
                 [junit] javax.naming.NamingException: Could not dereference object [Root exception is javax.xml.rpc.ServiceException: Error processing WSDL document:
                 [junit] java.io.UTFDataFormatException: Invalid byte 2 of 3-byte UTF-8 sequence.]
                 [junit] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1135)
                 [junit] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:690)
                 [junit] at org.jboss.naming.client.java.javaURLContextFactory$EncContextProxy.invoke(javaURLContextFactory.java:120)
                 [junit] at $Proxy0.lookup(Unknown Source)
                 [junit] at javax.naming.InitialContext.lookup(InitialContext.java:351)
                 [junit] at org.jbpm.bpel.tutorial.hello.HelloTest.setUp(HelloTest.java:28)
                 [junit] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
                 [junit] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
                 [junit] Caused by: javax.xml.rpc.ServiceException: Error processing WSDL document:
                 [junit] java.io.UTFDataFormatException: Invalid byte 2 of 3-byte UTF-8 sequence.
                 [junit] at org.jboss.axis.client.Service.initService(Service.java:289)
                 [junit] at org.jboss.axis.client.Service.<init>(Service.java:191)
                 [junit] at org.jboss.webservice.client.ServiceImpl.<init>(ServiceImpl.java:110)
                 [junit] at org.jboss.webservice.client.ServiceObjectFactory.getObjectInstance(ServiceObjectFactory.java:158)
                 [junit] at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
                 [junit] at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1110)
                 [junit] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1127)
                 [junit] ... 25 more
                 [junit] Test org.jbpm.bpel.tutorial.hello.HelloTest FAILED
                


                Thanks, joshua