0
votes

Apologies for long message. I am new to mule ESB and trying to elaborate my issue.

My requirment is

  1. Get the input in URL as query parameter like college name.
  2. Connect database and do select query using "college name" in where condition.
  3. 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.

  4. 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.

  5. Run a update command in database with "dept" and "fees".

To achieve above requirement, I have built below specified mule flow.

enter image description here

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!

1
Can you post the mule XML representation of these flows and any log output showing exceptions?John Scattergood

1 Answers

0
votes

In the editor you can set a flow variable to store a list.

It should be initialized

flowVars.myList = []

then added to on each loop

flowVars.myList.add(element);flowVars.myLis