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 ?
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.
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.
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
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).
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.