Java Node BPEL variable shows no data to iterate

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Java Node BPEL variable shows no data to iterate

bsri81@gmail.com
This post has NOT been accepted by the mailing list yet.
Hi,

I have used Java to create XML node and assigned it to BPEL variable.
BPEL variable's XML node count shows 0 value, But I am getting that XML response.

Please suggest.

Regards,
Sri
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Java Node BPEL variable shows no data to iterate

Paul Perez
Administrator
Sri
I'm sorry I don't understand what is your issue.
Could you please formulate your request differently
regards

Paul
www.pymma.com The best services on OpenESB
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Java Node BPEL variable shows no data to iterate

bsri81@gmail.com
This post has NOT been accepted by the mailing list yet.
Thanks for Reply.

I have created a Java class which i used in Assign activity. Java returns Node object as below:
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();  
        DocumentBuilder builder;  
        String Xmldata = new String("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<DATA_DS>\n" +
"  <_1/>\n" +
"  <G_1>\n" +
"    <ITEM_NUMBER>str1234</ITEM_NUMBER>\n" +
"    <INVENTORY_ITEM_ID>123</INVENTORY_ITEM_ID>\n" +
"  </G_1>\n" +
"</DATA_DS>");
        builder = factory.newDocumentBuilder();  
            Document doc = builder.parse( new InputSource( new StringReader( Xmldata) ));
        org.w3c.dom.Node root = (org.w3c.dom.Node) doc.getDocumentElement();
        //System.out.println(param);
        return root;


When I print NodeSet count of "G_1", log has zero value.

PFA the java lib and Bpel Project.

Regards,
Sri
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Java Node BPEL variable shows no data to iterate

bsri81@gmail.com
This post has NOT been accepted by the mailing list yet.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Java Node BPEL variable shows no data to iterate

Akshay
This post has NOT been accepted by the mailing list yet.
Hello Siri,

This is happening because from your Java method, you are getting XML without any namespace, and then you are using this output to some variable in your BPEL to retrieve node count using seeded BPEL function, but this will not work because ESB will not able to understand nodes with empty namespaces, it will always give you zero.

I would suggest, you can write a simple XSL which will take your java method output and transform into correct XML structure with required namespace and then I am sure you get the node count.

Let me know in case you need any help.

You can share your BPEL project, I will correct it if you need to understand how to achieve this.

Akshay
Loading...