0 Replies Latest reply: Dec 11, 2009 10:45 AM by 843830 RSS

    Using the same counter on two foreach

    843830
      i am develpoing a bpel that gets info from two differents web services, so it ends up with two output variables filled with elements inside a sequence. the elements that came from the web services are of the same type.

      i placed a forEach in my bpel process so i started looping through the first output variable to get the elements from the sequence, i collected them succesfully ...then i placed another forEach to do the same task, but this time with the second out put. the problem is that i want to keep adding to the same output variable (the one the bpel is returning to the front partner link) this elements ......but i only get them to replace the ones i got in the first forEach

      how can i share de counter between two forEach or something that lets me add both responses from the ws in the same variable


      here is the first forEach, notice that i am sending all to the same variable that i will use in the next for each (ListarUsuariosSSOOut.output</strong>)

      <forEach name="ForEachUsuarios" parallel="no" counterName="ForEachUsuariosCounter">
      <startCounterValue>1</startCounterValue>
      <finalCounterValue>count($OperacioinLDAPSearchOperationOut.response/ns6:ResponseEntries)</finalCounterValue>
      <scope name="Scope1">
      <assign name="AsignarRespuestaConsultarUsuario">
      <copy>
      <from>$OperacioinLDAPSearchOperationOut.response/ns7:ResponseEntries[$ForEachUsuariosCounter]/ns7:colsubsidioPerson.colsubsidio-tipo-                    persona</from>
      <to>$ListarUsuariosSSOOut.output/ns0:usuarioSSO[$ForEachUsuariosCounter]/ns0:tipoPersona</to>
      </copy>
      </assign>
      </scope>
      </forEach>

      here is the other forEach, using the same outputvariable to hold all the elements from boths ws responses (ListarUsuariosSSOOut.output</strong>)

      <forEach name="ForEachEmpresa" parallel="no" counterName="ForEachEmpresaCounter">
      <startCounterValue>1</startCounterValue>
      <finalCounterValue>count($OperacoinLDAPEmpresaSearchOperationOut.response/ns14:ResponseEntries)</finalCounterValue>
      <completionCondition>
      <branches></branches>
      </completionCondition>
      <scope name="Scope2">
      <assign name="AsignarRespuestaConsultarEmpresa">
      <copy>
      <from>$OperacoinLDAPEmpresaSearchOperationOut.response/ns14:ResponseEntries[$ForEachEmpresaCounter]/ns14:colsubsidioPerson.colsubsidio-               tipo-persona</from>
      <to>$ListarUsuariosSSOOut.output/ns0:usuarioSSO[$ForEachEmpresaCounter]/ns0:tipoPersona</to>
      </copy>
      </assign>
      </scope>
      </forEach>

      like a said before this only gets me an overwriting of the elements gotten in the first forEach ....by the elementos gotten on the second forEach