开发者

Problem: BPEL Array population

开发者 https://www.devze.com 2023-03-04 03:42 出处:网络
I created a BPEL process which doing some business logic(lets have fetching data from Department list). and on next activity I have to use the same fetched list.

I created a BPEL process which doing some business logic(lets have fetching data from Department list). and on next activity I have to use the same fetched list.

then I created one xsd for department list and want to add element in that, in this way I will put the fetched list in array and then I can use the same array in next activity(Java embed).

On my first java Embed Activity I have used following code for populating the array.

for(int i=0; i<10;i++ )

{

setVariableData("department","/ns1:department/ns1:Dept/ns1['i']:DeptName","value"); }

while execution I am getting following exception.

<May 9, 2011 6:47:11 PM SGT> <Error> <oracle.soa.bpel.engine> <BEA-000000> <<BPELXExecLet::setVariableData>
java.lang.ClassCastException: java.lang.Integer cannot be cast to org.w3c.dom.Element
        at com.collaxa.cube.engine.ext.bpel.v1.nodes.BPELXExecLet.setVariableData(BPELXExecLet.java:750)

Will any one please tell me why I am getting error. and is there any alternative way for achieving the goal.

I am using Jdeveloper11.1.1.3.0 and SOA 11.1.1.3.0.

following is my xsd for Department.

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://www.example.org"
            targetNamespace="http://www.example.org"
    开发者_StackOverflow        elementFormDefault="qualified">

            <xsd:element name="department" type="DeptCollection">
            </xsd:element>
  <xsd:complexType name="DeptCollection">
    <xsd:sequence >
       <xsd:element name="Dept" type="Dept" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="Dept">
    <xsd:sequence>
      <xsd:element name="DeptName" type="xsd:string" />
      <xsd:element name="HOD" type="xsd:string" />
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>


I don't believe the i in setVariableData("department","/ns1:department/ns1:Dept/ns1['i']:DeptName","value"); is being expanded as you think. You would have to build up the second parameter as a string first using the value of i, then pass it to setVariableData.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号