IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

movingwindow on nested iterators

  • 1.  movingwindow on nested iterators

    Posted Wed July 08, 2015 01:56 PM

    hi

    when i am setting movingwindow flag on nested iterators the 2nd getNextIterator is throwing error saying it should be only true when iterating on nodes. :shock:

    Ex: xml structure is like xmltag1->xmltag2. Passing tag1’s iterable node to tag2’s getNextIterator causes this error.

    Does any one have faced this situation and resolved it? :roll:

    thanks
    vijay


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 2.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 10:10 AM

    Hi Vijay,
    Are you talking about “pub.xml:getXMLNodeIterator” service.
    If so,then I think you no need to pass movingWindow values.If you have more then one node then pass criteria.Then use “pub.xml:getNextXMLNode” in some repeated step to get the next node.

    Please let us know if you face any difficulty in implementing the same or you can pass your exact xml structure.

    Thanks
    Baharul Islam


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 11:41 AM

    We use moving window input while handling large xml file.

    Can you attach your xml, for your reference reference the link below


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 4.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 12:47 PM

    Hi Mahesh

    The file is huge and cannnot attach, I can give a sample example as below

    <rootnode>
    <nodeparent>
    <parentname>ParentOfNode_1_2</parentname>
    <childnode>
    <name>Node 1</name>
    <price>100</price>
    </childnode>
    <childnode>
    <name>Node 2</name>
    <price>23</price>
    </childnode>
    </nodeparent>
    <nodeparent>
    <parentname>ParentOfNode_3_4</parentname>
    <childnode>
    <name>Node 3</name>
    <price>100</price>
    </childnode>
    <childnode>
    <name>Node 4</name>
    <price>23</price>
    </childnode>
    </nodeparent>
    <childnode>
    <name>Node 5</name>
    <price>4353</price>
    </childnode>
    <childnode>
    <name>Node 6</name>
    <price>23.4</price>
    </childnode>
    <childnode>
    <name>Node 7</name>
    <price>12.4</price>
    <resources>
    <resource type="test">This will be in the output</resource>
    <resource type="test1">This won't be in the output</resource>
    </resources>
    </childnode>
    </rootnode>

    As can be seen above, the nodeparent tag is repeating and I want to iterate on this and subsequently get the iterator of childnode under it and process each childnode individually.

    However for the service getXMLNodeIterator if I give criteria nodeparent and childnode then it loads all “childnode” under each “nodeparent” while iterating on nodeparent, which doesn’t make sense as I am telling to iterate on childnode also but it loads all childnode at once while iterating on nodeparent. So I have to explicitly get each iterator one by one by calling getXMLNodeIterator twice using parent child relationship.

    During the first call of getXMLNodeIterator with criteria nodeparent and movingWindow to true, I get first node of this iterator and pass it to get the second iterator with criteria childnode and movingWindow set to true again then it throws an error saying that this flag can only be used once.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 12:48 PM

    Hi Mahesh

    The file is huge and cannnot attach, I can give a sample example as below

    <rootnode>
    <nodeparent>
    <parentname>ParentOfNode_1_2</parentname>
    <childnode>
    <name>Node 1</name>
    <price>100</price>
    </childnode>
    <childnode>
    <name>Node 2</name>
    <price>23</price>
    </childnode>
    </nodeparent>
    <nodeparent>
    <parentname>ParentOfNode_3_4</parentname>
    <childnode>
    <name>Node 3</name>
    <price>100</price>
    </childnode>
    <childnode>
    <name>Node 4</name>
    <price>23</price>
    </childnode>
    </nodeparent>
    <childnode>
    <name>Node 5</name>
    <price>4353</price>
    </childnode>
    <childnode>
    <name>Node 6</name>
    <price>23.4</price>
    </childnode>
    <childnode>
    <name>Node 7</name>
    <price>12.4</price>
    <resources>
    <resource type="test">This will be in the output</resource>
    <resource type="test1">This won't be in the output</resource>
    </resources>
    </childnode>
    </rootnode>

    As can be seen above, the nodeparent tag is repeating and I want to iterate on this and subsequently get the iterator of childnode under it and process each childnode individually.

    However for the service getXMLNodeIterator if I give criteria nodeparent and childnode then it loads all “childnode” under each “nodeparent” while iterating on nodeparent, which doesn’t make sense as I am telling to iterate on childnode also but it loads all childnode at once while iterating on nodeparent. So I have to explicitly get each iterator one by one by calling getXMLNodeIterator twice using parent child relationship.

    During the first call of getXMLNodeIterator with criteria nodeparent and movingWindow to true, I get first node of this iterator and pass it to get the second iterator with criteria childnode and movingWindow set to true again then it throws an error saying that this flag can only be used once.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 12:49 PM

    Hi Mahesh

    The file is huge and cannnot attach, I can give a sample example as below

    <rootnode>
    <nodeparent>
    <parentname>ParentOfNode_1_2</parentname>
    <childnode>
    <name>Node 1</name>
    <price>100</price>
    </childnode>
    <childnode>
    <name>Node 2</name>
    <price>23</price>
    </childnode>
    </nodeparent>
    <nodeparent>
    <parentname>ParentOfNode_3_4</parentname>
    <childnode>
    <name>Node 3</name>
    <price>100</price>
    </childnode>
    <childnode>
    <name>Node 4</name>
    <price>23</price>
    </childnode>
    </nodeparent>
    <childnode>
    <name>Node 5</name>
    <price>4353</price>
    </childnode>
    <childnode>
    <name>Node 6</name>
    <price>23.4</price>
    </childnode>
    <childnode>
    <name>Node 7</name>
    <price>12.4</price>
    <resources>
    <resource type="test">This will be in the output</resource>
    <resource type="test1">This won't be in the output</resource>
    </resources>
    </childnode>
    </rootnode>

    As can be seen above, the nodeparent tag is repeating and I want to iterate on this and subsequently get the iterator of childnode under it and process each childnode individually.

    However for the service getXMLNodeIterator if I give criteria nodeparent and childnode then it loads all “childnode” under each “nodeparent” while iterating on nodeparent, which doesn’t make sense as I am telling to iterate on childnode also but it loads all childnode at once while iterating on nodeparent. So I have to explicitly get each iterator one by one by calling getXMLNodeIterator twice using parent child relationship.

    During the first call of getXMLNodeIterator with criteria nodeparent and movingWindow to true, I get first node of this iterator and pass it to get the second iterator with criteria childnode and movingWindow set to true again then it throws an error saying that this flag can only be used once.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 02:21 PM

    I see your sample xml is not correct. Just have a close look at line 24 it is starting with - Is it normal

    Should it be like this: inside a root tag. If yes I can share you the code. Contact me on my email.

        <nodeparent>
    <parentname>ParentOfNode_1_2</parentname>
    <childnode>
    <name>Node 1</name>
    <price>100</price>
    </childnode>
    <childnode>
    <name>Node 2</name>
    <price>23</price>
    </childnode>
    </nodeparent>
    <nodeparent>
    <parentname>ParentOfNode_3_4</parentname>
    <childnode>
    <name>Node 3</name>
    <price>100</price>
    </childnode>
    <childnode>
    <name>Node 4</name>
    <price>23</price>
    </childnode>
    </nodeparent>
    

    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 8.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 02:21 PM

    I see your sample xml is not correct. Just have a close look at line 24 it is starting with - Is it normal

    Should it be like this: inside a root tag. If yes I can share you the code. Contact me on my email.

        <nodeparent>
    <parentname>ParentOfNode_1_2</parentname>
    <childnode>
    <name>Node 1</name>
    <price>100</price>
    </childnode>
    <childnode>
    <name>Node 2</name>
    <price>23</price>
    </childnode>
    </nodeparent>
    <nodeparent>
    <parentname>ParentOfNode_3_4</parentname>
    <childnode>
    <name>Node 3</name>
    <price>100</price>
    </childnode>
    <childnode>
    <name>Node 4</name>
    <price>23</price>
    </childnode>
    </nodeparent>
    

    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 02:49 PM

    It’s just a sample file to explain abt the issue . Don’t worry too much about the semantics of the file. If you really could solve the issue email me the code to kalyan.cdev@gmail.com I will take a look at it.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 10.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 03:03 PM

    Yes, I know it might be a typo or copy paste error I want you to confirm on the same and I am not worrying about it :slight_smile:

    Check the code sample I have attached it here.
    X.zip (6.77 KB)


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 11.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 03:05 PM

    The code can look simpler if you use moving window=false. You can try it out. Ask me if any questions.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 12.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 03:06 PM

    The code can look simpler if you use moving window=false. You can try it out. Ask me if any questions.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 13.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 03:26 PM

    Thanks for sharing the code…the 3 steps just after the first branch will consume memory and will not work in my case. I have attached the scrshot for ur reference.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 14.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 03:42 PM

    Yes, let me see if I find any alternative solution. What is your xml file size?


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 15.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 03:47 PM


  • 16.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 03:48 PM


  • 17.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 03:57 PM

    Good deal and interesting. I will keep you posted if I find any alternate solution. Let me know if you find something.

    For handling large xml file I assume you should even take in to effect of your JVM MAX and MIN memory assigned to IS? Is it?


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 18.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 03:57 PM

    Good deal and interesting. I will keep you posted if I find any alternate solution. Let me know if you find something.

    For handling large xml file I assume you should even take in to effect of your JVM MAX and MIN memory assigned to IS? Is it?


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 19.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 04:08 PM

    yep ofcourse its all about memory when handling large files…i will let u know if i find anything that works…appreciate ur efforts on this

    thanks :smiley:


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 20.  RE: movingwindow on nested iterators

    Posted Sat July 11, 2015 04:08 PM

    yep ofcourse its all about memory when handling large files…i will let u know if i find anything that works…appreciate ur efforts on this

    thanks :smiley:


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 21.  RE: movingwindow on nested iterators

    Posted Sun July 12, 2015 10:29 AM

    Ok, few more points on this subject. It might help you I guess

    1> If you are loading the large xml via FS using getFile Svc load the file as stream data instead of bytes for better performance
    2> You can pass the stream data directly to xmlStirng to Node service
    3> Also you can do a performance test with movingWindow=false.
    4> What is your JVM min and max memory maintained in prod environment. As I would recommend you to test with the same JVM memory on your dev/test environments.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 22.  RE: movingwindow on nested iterators

    Posted Mon July 13, 2015 01:15 AM

    I already tried it but of no use. Looks like the movingWindow is the key here, if thats not set then it accumulates all the previous nodes and is causing out of memory error.

    I tried just one iterator with this flag set to true and it works fine with small memory footprint.

    If I use nested iterators then it fails with memory heap space error. :-?


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 23.  RE: movingwindow on nested iterators

    Posted Mon July 13, 2015 03:30 AM

    I think I some how managed to code it as per your requirement with moving window=true. Install the package and just run once and see the server.log file.

    X.zip (8.26 KB)


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 24.  RE: movingwindow on nested iterators

    Posted Mon July 13, 2015 03:31 AM

    I think I some how managed to code it as per your requirement with moving window=true. Install the package and just run once and see the server.log file.

    X.zip (8.26 KB)


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 25.  RE: movingwindow on nested iterators

    Posted Mon July 13, 2015 05:39 AM

    this one doesn’t quite meet the req. as the second iterator is independent of first one since u r passing main_node try passing next/node and see if it works.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 26.  RE: movingwindow on nested iterators

    Posted Sat July 18, 2015 02:06 AM

    i tried all the possible things, could not make this work in webM IS, its a shame that webMethods is unable to handle this


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 27.  RE: movingwindow on nested iterators

    Posted Sat July 18, 2015 06:32 AM

    LOL :slight_smile: Lets keep trying, did you talk to support (not sure if they can help). And we can also try using the enhanced xml parsing if you are on version 9 (but we need to try if this works or not).


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 28.  RE: movingwindow on nested iterators

    Posted Sat July 18, 2015 06:32 AM

    LOL :slight_smile: Lets keep trying, did you talk to support (not sure if they can help). And we can also try using the enhanced xml parsing if you are on version 9 (but we need to try if this works or not).


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 29.  RE: movingwindow on nested iterators

    Posted Sat July 18, 2015 06:33 AM

    LOL :slight_smile: Lets keep trying, did you talk to support (not sure if they can help). And we can also try using the enhanced xml parsing if you are on version 9 (but we need to try if this works or not).


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 30.  RE: movingwindow on nested iterators

    Posted Sat July 18, 2015 06:33 AM

    LOL :slight_smile: Lets keep trying, did you talk to support (not sure if they can help). And we can also try using the enhanced xml parsing if you are on version 9 (but we need to try if this works or not).


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 31.  RE: movingwindow on nested iterators

    Posted Sun July 19, 2015 02:00 AM

    i don’t have access to empower site. so have to take help of someone who has access and raise an incident about this issue…


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 32.  RE: movingwindow on nested iterators

    Posted Mon July 20, 2015 06:21 AM

    Hi Mahesh

    Is it possible for you to open a support ticket with SAG regarding this issue? I would really appreciate it if you can do this.

    Thanks,
    Vijay


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 33.  RE: movingwindow on nested iterators

    Posted Mon July 20, 2015 07:40 AM

    Nope, I don’t have access privileges to raise incident against SAG. Only my onsite counterpart has this access.

    Can you get in-touch with your onsite team. They can do it for your just like that.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 34.  RE: movingwindow on nested iterators

    Posted Mon July 20, 2015 07:40 AM

    Nope, I don’t have access privileges to raise incident against SAG. Only my onsite counterpart has this access.

    Can you get in-touch with your onsite team. They can do it for your just like that.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 35.  RE: movingwindow on nested iterators

    Posted Mon July 20, 2015 07:41 AM

    Nope, I don’t have access privileges to raise incident against SAG. Only my onsite counterpart has this access.

    Can you get in-touch with your onsite team. They can do it for your just like that.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB