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.  Breaking out of a loop step

    Posted Wed August 21, 2002 12:01 PM

    We are new to webMethods Enterprise Integrator.
    In our application we are processing records retrieved from an oracle RDBMS using a configured select operation.
    We are looping over these records using loop step in the integration component.
    On a specific condition we want to break out of the loop.
    How do we achieve this ? Do we open the code of the integration component and go to the code for the loop step and put a break statement ? Is there any other elegant method to achieve this ?

    Thanks
    Harish


    #Integration-Server-and-ESB
    #webMethods
    #broker
    #Universal-Messaging-Broker


  • 2.  RE: Breaking out of a loop step

    Posted Wed August 21, 2002 01:06 PM

    What is thespecific condition that you are checking for? Is it possible to just configure your SELECT configured operation with a WHERE clause?

    I would not recommend changing the script generated by EI because you may inadvertantly cause other problems to pop up – especially because you are new to the product and may not fully understand what you are looking at.


    #Universal-Messaging-Broker
    #webMethods
    #Integration-Server-and-ESB
    #broker


  • 3.  RE: Breaking out of a loop step

    Posted Thu August 29, 2002 03:02 PM

    If you look at the script (code) for a loop step it’s just a basic for loop.

        for (loopStep = 0; loopStep  would probably be replaced with the name of the configured operation that is doing the select.
    

    #Integration-Server-and-ESB
    #broker
    #webMethods
    #Universal-Messaging-Broker


  • 4.  RE: Breaking out of a loop step

    Posted Thu August 29, 2002 03:03 PM

    NOT SURE WHAT HAPPENED BUT PART OF MY RESPONSE GOT ZAPPED IN THE FIRST ATTEMPT


    If you look at the script (code) for a loop step it’s just a basic for loop.

        for (loopStep = 0; loopStep < inputStep.header.length; loopStep++)  
    

    So somewhere inside the loop you would put a branch step with the condition to test, and then either in the true or false side, depending upon your logic, add a custom step.

    Inside the script (code) for the custom step set the loopStep variable

    loopStep = loopStep < inputStep.header.length;

    In your case ‘inputStep’ would probably be replaced with the name of the configured operation that is doing the select.


    #broker
    #Universal-Messaging-Broker
    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: Breaking out of a loop step

    Posted Fri August 30, 2002 01:56 PM

    Thanks for the suggestions.

    We cannot use the where clause directly in the SELECT operation since the condition is derived by calculating values based on the input document to the integration component at run-time.

    Will try with the suggestion posted by aww (sorry for the abbreviation-not able to view your full name).
    Thanks a lot


    #Integration-Server-and-ESB
    #webMethods
    #Universal-Messaging-Broker
    #broker


  • 6.  RE: Breaking out of a loop step

    Posted Fri August 30, 2002 02:43 PM

    That’s perfect, Harish. You can pass in the value from run-time into your WHERE clause as needed.

    In the SELECT configuration, go to the WHERE tab and select the appropriate column. Then, select the “=”, “” or whatever you need, and then leave the default value in the next column over.

    (Apologies but I am not in front of my system right now – I am doing this from memory)

    The default value will resemble ${COLUMN_NAME}. In your component, you can call your configured operation and map your input value into this field (which is underneath the component name on the right-side of the screen).

    I hope this helps.


    #Universal-Messaging-Broker
    #broker
    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: Breaking out of a loop step

    Posted Fri August 30, 2002 06:26 PM

    Harish

    You can break out of a loop in two ways.
    Though EI does not support conditional looping directly, there is a work around. In the loop brach, insert a condition step. In one of the branches of if step depending on your logic, insert a custom step to modify your loop variable.

    Another solution is to create a dynamic sql query.
    Have a custom sql operation. You can construct the SQL query dynamically during run time. If you need help on this I can send you an adl.

    Hope this resolves your problem


    #webMethods
    #Universal-Messaging-Broker
    #broker
    #Integration-Server-and-ESB


  • 8.  RE: Breaking out of a loop step

    Posted Tue September 03, 2002 03:35 PM

    Dang, I need to proof my posts a little better!! Setting the loop step value should look like this:

    loopStep = inputStep.header.length;


    #broker
    #Universal-Messaging-Broker
    #webMethods
    #Integration-Server-and-ESB