1 Reply Latest reply on Jan 3, 2013 5:32 PM by oracledigger

    BPEL, Assign loop from multiple nodes, how to do ?


      In a BPEL process, there is a call to a partnerlink that sends the following result :

      <part name="payload" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <MyResponse xmlns:ns0="http://my.model.com"

      Then I must loop through all the <ns0:OOP> nodes to get each values (AAAA,1111) (BBBB,2222) ... and affect these values to another input variable that will be sent to another partnerlink...

      Question is : How to loop through each node ?

      I use an index that is in a BPEL variable (from 1 to 4) but I don't know how to put this index in the Assign, Eg :

      <from expression="bpws:getVariableData('Invoke_PartnerLink1_OutputVariable','payload','/ns0:MyResponse/ns0:OOP[bpws:getVariableData('MyIndexVariable')]/ns0:SI')"/>

      But there is an error saying that the XPATH query is not ok. I tried by replacing the single quotes with double quotes everywhere in the from expression apart around the 'MyIndexVariable' but I'm still stuck and don't see any way to do that...

      Thanks if any clues!

      Edited by: oracledigger on Jan 3, 2013 4:26 PM
        • 1. Re: BPEL, Assign loop from multiple nodes, how to do ?
          Wow I did not thought that it was so hard to do this !! (<=> iterate through incoming xml nodes, assign values from one xml node to another variable, and calling another partnerlink...).

          What I did :

          - Create a XSD file with an "element" called "parameters" that is a complexType that contains another element named "item" that is also a complexType that contains a sequence with my own variable names (2).

          - Assign my needed values to a variable based on the preceding XSD file (amongst these : My Incremental Index !!).

          - Create a transform activity with my needed input values :
          ---> The xml variable with the nodes I need to go through
          ---> The index

          - In the transform activity I acces my variables with such this code :
          <xsl:value-of select="/ns0:OOR/ns0:OOP[number($XsltParams/p:parameters/p:item/p:OOPIndex)]/ns0:SI"/>

          This was hard to understand, but as everything, once one has done it once, then everything rulez !

          The links that "saved" me are :


          Have fun with SCA lol !!!!!

          Edited by: oracledigger on Jan 3, 2013 6:31 PM