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
  • 1.  How to know list key of document type in java service

    Posted Wed May 15, 2019 12:02 PM

    Hello

    I search in java API a function who return key list of a document type.
    this function exist ?

    How can i do that ?


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


  • 2.  RE: How to know list key of document type in java service

    Posted Wed May 15, 2019 12:56 PM

    Hi Clement,

    can you provide an example of what you are trying, please?

    Additionally provide your wM version, please.

    Regards,
    Holger


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


  • 3.  RE: How to know list key of document type in java service

    Posted Thu May 16, 2019 05:57 AM

    Hi,

    We use 9.12.

    I want know all élement in a doc type reference, and return a list of this element.

    Example i pass in entry a String who represent mypackage.doc:mydoc

    mydoc type is :
    Doc

    • firstElement
    • firstNumber
    • otherElement

    the list return :

    • firstElement
    • firstNumber
    • otherElement

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


  • 4.  RE: How to know list key of document type in java service

    Posted Sun May 19, 2019 01:08 AM

    Use the below code to get the NS and loop over “nodedata/rec_fields”, within the loop use “pub.list:appendToStringList” to populate the stringList which will return “field names”

     IDataCursor ic = pipeline.getCursor();
    String strName = IDataUtil.getString(ic, "nsName");
    if (strName == null) {
    throw new ServiceException("Missing required param 'nsName'");
    }
    NSName nsname = NSName.create(strName);
    IData data = NSNodeHelper.getNodeInfo(nsname);
    ic.insertAfter("nodedata", data);

    Let me know if you are unable to follow instructions or not make it work.


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


  • 5.  RE: How to know list key of document type in java service

    Posted Tue May 21, 2019 10:30 AM

    Thx for your reply.

    But i can t find class “NSNodeHelper”
    I search for install package wmDoc. but in this package i have other java problem like WmDocBundle cannot be resolved to a type …

    Can you help me to find this class and solved this problem ?


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


  • 6.  RE: How to know list key of document type in java service

    Posted Wed May 22, 2019 07:45 AM

    Use the attached package as-is

    OR

    Copy the java service (GetNodeData:getNodeData) to your package folder on designer and the folder “pub” which is present under “GetNodeData\code\classes” to your \code\classes, compile the java service and it should work.

    Else, you need to create a jar from the NSNodeHelper.class (present in WmDoc) and copy the same under packages<yourpackagename>\code\jars

    Let me know how it goes, feel free to contact me on my below email if you still have issues.
    GetNodeData.zip (12.4 KB)


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