0
votes

I am getting a iso8583 responce from server with some fields like 2,3,7,8 in payload. Now I want update a payload with second filed with different value. How can I do this in mule? I have tried to write a script in groovy but it is not executing..

this is my iso message (which is my payload):

ISO0160000751210B03080014E418000000000000000002897000000000000000000019916051912171405190620001809000000000614012837225UNI000000IDF331512135183102-0000001222358200-0000001222358200+0000000000000000+0000000000000000-0000001222358200INR              INR003FIG015117910100018219

Now i want to update the value in this payload. after parsing the payload it is split as a key value pair. If i use payload.get(2), second field value will come but I want to update the second field value in payload. How please help me.

1
Can you post the flow you already have or a simplified version of it ? It will help in understanding the question and we can just update the existing to give you what you need.Sudarshan

1 Answers

1
votes

What you are looking for is the Message Enricher, can be used as follows:

<enricher target="#[payload[2]]">
    <set-payload value="the new value to set"/>
</enricher>

This would set the value with key 2 in the map to what ever you define within the set-payload within the enricher. It is also possible to use multiple message processors within the enricher using <processor-chain>.