Sebastian Morales [
https://community.jboss.org/people/smorales] created the discussion
"Use For Each in Bpel Process"
To view the discussion, visit:
https://community.jboss.org/message/800393#800393
--------------------------------------------------------------
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%7DselectionFailu...
http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure...
results for expression: 'ItabCecos/item[number($i)]/Ceco' against '<?xml
version="1.0" encoding="UTF-8"?>
<ZcoCecoGetResponse xmlns="
http://SAPCentroCostos/wsdl
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%7DsubLanguageExe...
http://docs.oasis-open.org/wsbpel/2.0/process/executable}subLanguageExecu...
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%7DselectionFailu...
http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure...
results for expression: {OXPath10Expression return/zcoCecos/item[$i]/Ceco}
Any Idea why I get this error and the Bpel Process don't operate.
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/800393#800393]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]