0 Replies Latest reply on Mar 1, 2013 3:28 PM by Sebastian Morales

    Use For Each in Bpel Process

    Sebastian Morales Newbie

      Hello,

       

      I'm trying to iterate a List from a Webservice SOAP with ForEach

       

      <bpel:forEach parallel="no" counterName="i" name="ForEach">

                  <bpel:startCounterValue>

                      <![CDATA[1]]>

                  </bpel:startCounterValue>

                  <bpel:finalCounterValue><![CDATA[count($SAPCCResponse.centroCostoResponse/return/zcoCecos/item)]]></bpel:finalCounterValue>

                  <bpel:scope>

                      <bpel:assign validate="no" name="Assign1">

                         

                         

                          <bpel:copy>

                              <bpel:from part="centroCostoResponse" variable="SAPCCResponse">

                                  <bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"><![CDATA[return/zcoCecos/item[$i]/Ceco]]></bpel:query>

                              </bpel:from>

                              <bpel:to part="payload" variable="CentroCostoLinkResponse">

                                  <bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">

                                      <![CDATA[ItabCecos/item[number($i)]/Ceco]]>

                                  </bpel:query>

                              </bpel:to>

                          </bpel:copy>

                      </bpel:assign>

                  </bpel:scope>

              </bpel:forEach>

       

       

      But when I consume de Bpel process throws an exception:

       

       

      I changue to 2.0   urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0

      16:18:36,254 INFO  [UDDIClerk] entityKey uddi:riftsaw.jboss.org:service

      _sapcentrocostosservicio was not found in the registry
        16:18:36,694 INFO  [ASSIGN] Assignment Fault: {http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure,lineNo=149,faultExplanation=No results for expression: 'ItabCecos/item[number($i)]/Ceco' against '<?xml version="1.0" encoding="UTF-8"?>
        <ZcoCecoGetResponse xmlns="http://SAPCentroCostos/wsdl"/>'

       

      I changue to 2.0   urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0 quitando el atributo number()
        16:20:06,308 INFO  [UDDIClerk] entityKey uddi:riftsaw.jboss.org:service_sapcentrocostosservicio was not found in the registry
      16:20:06,824 INFO  [ASSIGN] Assignment Fault: {http://docs.oasis-open.org/wsbpel/2.0/process/executable}subLanguageExecutionFault,lineNo=149,faultExplanation=An exception occured while evaluating "{OXPath10Expression return/zcoCecos/item[$i]/Ceco}": Error while executing an XPath expression:

       

      I changue to   urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0
      16:22:06,331 INFO  [UDDIClerk] entityKey uddi:riftsaw.jboss.org:service_sapcentrocostosservicio was not found in the registry
        16:22:06,785 INFO  [ASSIGN] Assignment Fault: {http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure,lineNo=149,faultExplanation=Multiple results for expression: {OXPath10Expression return/zcoCecos/item[$i]/Ceco}

       

       

      Any Idea why I get this error and the Bpel Process don't operate.

       

      Thanks