webMethods step by step flow services loop
TASK: Creation of Flow Services - Loop
Platform: webMethods 7.1.2
Now we will create a flow service to process a list of employees using a Loop step in a Flow service.
Ã¨ Create a Package and folder structure like below and create a flow service loopEx in work folder.
Define a document type in docs folder with the following Document, document list and variables:
Ã¨ Set the input of the Document Reference to â¦.docs:Department called Dept, and set the output to a string variable called count
Ã¨ On the input or output tab of your loopEx service expand the Dept variable and find Dept/department/employee and right click to copy
In our service add a loop statement and in the input array property , paste in Dept/department/employee. Press enter to see the input array displayed in the loop.
Ã¨ Add a MAP statement under the loop step (be sure it is indented under the Loop). Map $iteration to count.
Ã¨ Add a pub.flow:debugLog below the MAP step(make sure it is NOT indented under the Loop). Map count variable to message variable
Note: When a loop statement is added, a new variable called $iteration appears in the Pipeline. This variable keeps track of the number of iterations of the loop.
Ã¨ Save and run the service. To run the service, choose Test|Run or click on the Run icon. Expand the input box, and use the Add Row button to add two employees. Type some data for each employee. Click the OK button. You should see a count of 2 in the Server log.