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

How to pass documentlist inside a document to a loop

  • 1.  How to pass documentlist inside a document to a loop

    Posted Thu June 26, 2003 07:03 PM

    Hai,

    How to pass a document list inside a triggering document as a in-array to a loop.
    Please not that the document list is inside a document.

    Thanks for your time
    Prasad.V


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


  • 2.  RE: How to pass documentlist inside a document to a loop

    Posted Thu June 26, 2003 08:24 PM

    place a map step and directly map the source documentlist to the target document/documentlist (child).and check the pipleline after executing…whole documentlist will be replicate on target side…

    I hope this is what you might be expecting,if not pls elobarate us more on this…

    HTH.


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


  • 3.  RE: How to pass documentlist inside a document to a loop

    Posted Fri June 27, 2003 05:59 AM

    Hai,
    Thanks for your response.
    Actually I am trying to insert a documentlist inside a document into a table using insert template of jdbc adapter.
    But whenever i give the above documentlist as a in-array,the loop is not getting executed.
    Any inputs.

    Thanks for your time
    Prasad.V


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


  • 4.  RE: How to pass documentlist inside a document to a loop

    Posted Fri June 27, 2003 04:08 PM

    Hi GuruPrasad,

          You are little bit confusing us.I understood from you  
    

    you have documentList coming from out .Using JDBC ADAPTER input
    you have to insert all documents in your list in to Your data base.
    Is it Correct?

       If it is correct,First you have to loop over Your input 
    

    recordList(Ex : EMPDetails is record list it contains EMPID,ENAME fields).Take loop in-Array property as EMPDetails.
    Now come into Loop.Inside loop EMPDetails record list
    contains Record of EMPDetails.It contains fields (EMPID,ENAME fields).

           Next you create Service Insert from JDBC Adapter.Take 
    

    input values EMPID,ENAME as input parameters for this service.
    Do insert.
    Now invoke this service into your main flow.
    (inside loop).Now map fields in EMPDetails record inside loop
    to input parameters of this service.After loop call map then clean
    unwanted thing.Hope this helps you.

    Thanks,
    SriniK


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


  • 5.  RE: How to pass documentlist inside a document to a loop

    Posted Fri June 27, 2003 04:12 PM

    Hi Guru,

           Your problem is Loop in-array parameter you have not  
    

    given properly.Put cursor over RecordList ex(EMPDetails)Rigt click
    then copy.Now paste it int in-array parameter of loop.

    Thanks,
    SriniK


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


  • 6.  RE: How to pass documentlist inside a document to a loop

    Posted Fri June 27, 2003 06:07 PM

    Hai,

    I am using webmethods6

    I will brief my process clearly:

    1.I am creating a flatfile schema and reading from a flat file and publishing a docuement.

    2.The document is getting published with the values from the flat file exactly.

    3.Now I am trying to insert the values from this published document to oracle database for which i am using insertsql template of jdbc adapter.

    4.As the documentlist inside a published document cannot be given as a inarray to a loop,i am creating a map step and mapping it to another documentlist.

    5.This newly created document list is given as a inarray to a loop and calling insertsql service inside the loop.

    6.Due to some problem,though they are 15 records in the flatfile,only one record is getting inserted into the database.

    My sincere thanks for all those who responded.

    Thanks for your time
    Guruprasd.V


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


  • 7.  RE: How to pass documentlist inside a document to a loop

    Posted Fri June 27, 2003 07:10 PM

    Hi Guru,

    You are published document into broker.O.k,Then There is trigger
    which pushes document from Broker to Integration server.So you
    have to create Trigger.Specify the document you published into
    Broker.Then select Subscription service that takes document from
    broker for further processing say insert into Database.

                Now go to your subscription service which(ex:folder.subfolder:subscriptionService).Click on input/output 
    

    button.specify scope folder.subfolder:subscribeServiceName.
    then come into click on flow button, take map then make process
    say take recordlist & then loop over it then do what ever i said
    in earlier posting.

    Thanks,
    sriniK


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


  • 8.  RE: How to pass documentlist inside a document to a loop

    Posted Fri June 27, 2003 07:42 PM

    Hi Guru,

     Sorry!! While talking to my friend in Phone,I sent wrong information,(Click on input/output  
    

    button.specify scope folder.subfolder:subscribeServiceName)
    Click on input/output tab,select document reference
    select your publishing document,give name as (scope where the document
    resided ex:Package.folder.subfolder…:document name)then follow rest
    of the procedure.

         Once again Extremely Sorry. 
    

    Thanks,
    SriniK


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


  • 9.  RE: How to pass documentlist inside a document to a loop

    Posted Thu July 01, 2004 07:35 AM

    Hello Professionals,
    I am working on webmethods6.0. I am trying to generate an XML file with the data which is available in oracle database. I am using the following sequence of steps.

    1. getdata

    2. execSQL
      From this step i am getting the result as documentList. It contains some documents and each docuement contain some fields.

    3. Mapping that documentList to userdefine DT

    4. documentListTodocument.

    5. documentToXMLValues.

      But at the 4th step That service asking the inputs for documentList, name, value. I am mapping documentList to documentList, but i don’t what i have to give for name and value parameter.
      I will thankful to you all if you give me the suggestion in this regard.

    with regards,
    Nani

    FOUR duplicate copies of this post were deleted by the moderator. One sure way of getting NO HELP at WM Users is to post your question all over the forums!!!

    (Message edited by mcarlson on July 01, 2004)


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


  • 10.  RE: How to pass documentlist inside a document to a loop

    Posted Thu July 01, 2004 04:31 PM

    Nani,

    In spite of your spamming us with this question, I’m going to help you anyway.

    Use pub.xml.DocumentToXMLString to convert your document list to an XML string. Map your document list into the document input parameter. You may want to paste a copy of the document list under the document input parameter and indent it before mapping it to preserve the top-level tag as shown in the illustration below.

    Mark


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


  • 11.  RE: How to pass documentlist inside a document to a loop

    Posted Mon July 05, 2004 08:05 AM

    Hello Mark,
    Thank you for your response, but at the same time sorry for my repeated mails. Actually i am trying to generated an XML file for the data which is exists in oracle database. For that i followed below steps.
    1.getdata
    2.execSQL
    Here i got output as documentList
    3.Loop
    documentToXMLString
    appendToStringList
    But as an output i am getting multiple XML files rather than single XML file which contains all records. I want single XML file that contains all records. I am really thankful to you, if you proved me a solution for this.

    with regards
    nani


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


  • 12.  RE: How to pass documentlist inside a document to a loop

    Posted Tue July 06, 2004 12:17 AM

    Nani,

    The pub.xml:documentToXMLString service will convert a documentList to an XML string. If you need to map your “results” documentList to some other structure do that inside your loop.

    After transforming as desired, then map the transformed documentList into the “document” input of pub.xml\documentToXMLString as shown in the attached image in my post above.

    Mark


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


  • 13.  RE: How to pass documentlist inside a document to a loop

    Posted Fri November 19, 2004 06:10 PM

    Hello,

    I am converting a FF into an XML. As part of the conversion, I have created a LOOP to read all the order items from the input document. The problem is that at the end of the loop, I am getting only the latest record (e.g. out of 10 order items, the 10th order item) as output. I need to get all the records. I tried using pub.list:appendToDocumentList inside the loop but still I get only the latest record (as changes to the fromList affect the results in toList).

    I also tried using the Output Array, but even the output array provides only the latest record - whereas I need all the records in the output document

    Can you please let me know how to process a documentlist inside a Loop and get all the records as output.

    Thanks

    Regards
    Abhijeet


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


  • 14.  RE: How to pass documentlist inside a document to a loop

    Posted Fri November 19, 2004 07:04 PM

    abhijeet,

    Check this thread link,this helps how to use of the appendToDocumentList techinque,its tricky though

    [url=“wmusers.com”]wmusers.com

    HTH,
    RMG.


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


  • 15.  RE: How to pass documentlist inside a document to a loop

    Posted Fri November 19, 2004 07:57 PM

    Hello RMG,

    Thanks for your excellent inputs! It worked! To summarize, I did the following steps:

    (1) Created a Temp Document (which should be mapped to fromItem in pub.list:appendToDocumentList)
    (2) Created the LOOP
    (3) Mapped the required fields
    (4) Added the pub.list:appendToDocumentList in the LOOP
    (5) Mapped required fields
    (5) Dropped the toList, fromList and the Temp Document from Pipeline Out in pub.list:appendToDocumentList

    Thanks again

    Regards

    Abhijeet


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


  • 16.  RE: How to pass documentlist inside a document to a loop

    Posted Thu November 03, 2005 02:16 AM

    Hi,

    Here is my question. I did the following steps:
    (1) Called select adapter service
    (2) Created a Temp Document (which should be mapped to fromItem in pub.list:appendToDocumentList)
    (3) Created the LOOP
    (4) Mapped the required fields-----(Question area)
    (5) Added the pub.list:appendToDocumentList in the LOOP and mapped toList, fromItem and the Temp Document.
    (6) Dropped the toList, fromItem and the Temp Document from Pipeline Out in pub.list:appendToDocumentList

    The question is
    If any of the mapped fields / one of the mapped field in fromItem is empty I get an exception. Is there a work around for that.

    Thanks again

    Regards
    Ram


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