Мне нужно пройти через массив (входные данные для BPEL) в операции вставки java, и мне нужно сгенерировать ответ (выходную переменную) процесса BPEL.
Я использую Jdeveloper и SOA 11g
Следующее - мой xsd
<?xml version="1.0" encoding="UTF-8"?>
<schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xmlns.oracle.com/BPELInpuandOutPutArray_jws/Project1/BPEL_input_output_array" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="process">
<complexType>
<sequence>
<element name="simpleinput" type="string"/>
<element name="arrayofObjects" maxOccurs="unbounded" nillable="true">
<complexType>
<sequence>
<element name="input1" type="string"/>
<element name="input2" type="string"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element name="processResponse">
<complexType>
<sequence>
<element name="arrayofObjectsoutput" maxOccurs="unbounded" nillable="true">
<complexType>
<sequence>
<element name="output1" type="string"/>
<element name="output2" type="string"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</schema>
пока я могу управлять обходом во входном массиве
oracle.xml.parser.v2.XMLElement e1=
(oracle.xml.parser.v2.XMLElement)getVariableData("inputVariable","payload","/client:process/client:arrayofObjects[1]/client:input1");
System.out.println(e1.getFirstChild().getNodeValue());
Но мое бизнес-требование состоит в том, чтобы на основе некоторой логики установить значения в выходном массиве.
для этого я использовал следующий пример кода.
for(int i=1; i < 4 ;i++)
{
setVariableData("outputVariable","payload","/client:processResponse/client:arrayofObjectsoutput['i']/client:output1",i);
setVariableData("outputVariable","payload","/client:processResponse/client:arrayofObjectsoutput['i']/client:output2",i);
}
Мне кажется, что массив будет создан длиной 3, а значение будет установлено как (1,1) (2,2) (3,3), но на выходе будет только (3,3).
пожалуйста, скажите мне, как я могу добиться того же.
пример кода будет оценен.