Apologies for long message. I am new to mule ESB and trying to elaborate my issue.
My requirment is
- Get the input in URL as query parameter like college name.
- Connect database and do select query using "college name" in where condition.
Get the result set(example - returns multiple department in the college with metadata) and iterate result set under for each loop.
a) Process the first row and construct the XML and add http headers.
b) hit the vendor service.
c) Receive response from vendor service.
d) Process the vendor service -- Kind of manipulating fees in the response.
c) Set the manupulated fees and against department in the array variable.
d) Remove the processed "rootMessage" to free up memory.
After processing all the five rows (limited 5 row selection in the select command). Now we will have five sets of variables. Each variable should have dept and fees.
Run a update command in database with "dept" and "fees".
To achieve above requirement, I have built below specified mule flow.
Here I am able to complete till step 3. I got struck in step 4 and step 5.
My query is
- how to set the values in array kind of variable in mule ESB /Data weave in the scope of 'for Each'. It should be incremented. My case it is keep overwritten by the next row/message. Since i could not create variable to increment itself.
Please show some light on this.
Thanks in advance!