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.

 View Only
Expand all | Collapse all

Index needed when referencing variables in a list?

  • 1.  Index needed when referencing variables in a list?

    Posted Tue March 28, 2006 11:55 PM

    Does anyone know of an issue when upgrading from 4.x to 6.x that requires you to reference documents in a document list using the element index?

    I have a service in 4.6 that branches on a field in a document (in a document list) and references the field as ‘/documentListName/fieldName’.

    Once this code was placed in a 6.5 IS and I attempted to execute it, the branch statements always resolve to the $null sequence. After steping through the code, I noticed the data in the pipeline is named ‘/documentListName/documentName[index]/fieldName’ and the branch statement is not able to locate ‘/documentListName/fieldName’.

    I digged into this issue deeper and stepped through the original code on a 4.6 IS and noticed the data in the pipeline has always been named ‘/documentListName/documentName[index]/fieldName’ and works as expected. If there are no documents in the document list, I would like to execute the $null sequence option - otherwise, execute the $default option.

    Was a change made to the way variables should be referenced somewhere between the 4.6 and 6.5 releases?


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


  • 2.  RE: Index needed when referencing variables in a list?

    Posted Fri March 31, 2006 07:41 PM

    I hope I understand your question clearly… So… you have a document list, which may or may not have documents in it. Each of these cases, you want to deal with differently. What you can do is to use ‘pub.list:sizeOfList’ to check if the documentList has any child nodes or is empty. If the result of ‘sizeOfList’ is ‘0’ (zero), you can execute the null sequence, else, you can call the branch on the document/variable.

    I don’t know if it happens in the scenario you are working on, but, you might want to consider a null value for the documentList.

    HTH, Rohit


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


  • 3.  RE: Index needed when referencing variables in a list?

    Posted Mon April 03, 2006 04:08 PM

    Hello,
    If you only did a branch before, you may want to loop over the document with the branch inside. That want you don’t have to worry of implicit indexing. You can also branch on the $iteration field that available to only operate on certain elements.

    Other than that, use an explicit index if you only want operate on certain elements and never interact with others. Good day.

    Yemi Bedu


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