IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Performance issue with xpath

    Posted 02/24/09 09:32 AM

    Originally posted by: SystemAdmin


    Hi all, I'm having a problem with xpath. The map i'm using creates an error file based on the audit log that another map creates and an xml file. When this xml is rather big (about 3 mb), it takes 7 hours to complete taking CPU usage to 100% the whole time and freezing everything, including the Command server window, for long periods of time.
    In one of the rules, I have several Xpath functions to search different fields in the xml, and I'm using it like this:

    xmllib->XPATH(PACKAGE(Global:Rejected),
    "/eims2:ProductDispositionBOD/eims2:DataArea/eims2:ProductDisposition/eims2:ProductDispositionHeader/oa9:Party/oa9:PartyIDs/oa9:ID","/")

    The first parameter is the complete xml file. It works perfectly for small xmls, but when the xml is big, the problems appear.
    I found that if I use something like PACKAGE(DataArea Comp:ElemDecl ProductDispositionBOD Element:Global:Rejected) instead of the whole xml, the command server doesn't freeze anymore but I'm not being able to get the parameters. The xpath doesn't return anything, and I've checked the path with an "xpath checker", so I know it's ok. I've also tried changing the context, but with no luck so far. Does anyone know what could be happening? I'll attach a sample xml if that helps to see what the problem is.
    Thanks in advance
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 2.  Re: Performance issue with xpath

    Posted 02/24/09 10:46 AM

    Originally posted by: phil2030


    I take it you are calling this function repeatedly. If so I would guess that every call to the XPATH function is parsing the Object passed as the first parameter into a DOM. It would certainly explain why the map works okay for small files but balks at large files as it will probably be swapping to disk a lot.

    I would suggest you either:
    a) build a type tree for the file you are creating and write a map that reads the xml document once and outputs the required structure or a simplified name/value pair set (or similar). You can then run this map from within your existing map.
    b) write some external process using Java/Perl/whatever to extract the key info. from your xml document.

    Are you planning on running this in production from the command server or under the event server?

    To be honest, when I did try to use these functions (a couple of years ago now) they were buggy as hell and gave different results on different platforms. I stayed well clear of them after that!
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender