Skip to Content
0

Combine Single Values and replace the values in Incoming Message

Jan 19 at 10:32 PM

103

avatar image

Hello Experts,

I have a scenario where i need to replace string Value from different branches in the main message.

Branch 1: Single Value :

MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0B BwGggCSABEpDWjcyMDgwMDQzfDE4MXwwMC8yNTM1L0NONTh8MC8yNDgyL0lFMjV8 MjAxNi0xMi0wN1QyMjowMTowMCswMTowMHw4Nzk4OC4wMAAAAAAAADGCAr0wggK5

Branch 2: Single Value:

MSBQbGF5Z3JvdW5kAgR0c5cnMA0GCWCGSAFlAwQC

Branch 3: Main Message

http://schemas.xmlsoap.org/soap/envelope/">

<Header></Header>

<Data>

<urceno_cerp_zuct>343.00</urceno_cerp_zuct>

<cerp_zuct>237.00</cerp_zuct>

<rezim>1</rezim>

<pkp>CZ72080043|181|00/2535/CN58|0/2482/IE25|2016-12-07T22:01:00+01:00|87988.00</pkp>

<bkp>XXXXX|181|00/2535/CN58|0/2482/IE25|2016-127T22:01:00+01:00|87988.00</bkp>

</Data>

</ns0:EETRequest>

I need to replace the String Values with node <pkp> and <bkp> in the main message payload.

Can anybody please advice how it can be done.

Regards,

Rajesh

image1.jpg (33.5 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Ashish Goel Jan 23 at 08:19 AM
0

Hi,

You can store single values from branch 1 & 2 in property/header of a content modifier. And then create branch 3 message body using that property/header inside a second content modifier.

capture.jpg

<pkp>${header.string1}</pkp>

Thanks,

Ashish


capture.jpg (25.3 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Ashish,

Thanks for the sharing the info.

0
Kevin Teeling
Jan 30 at 11:29 AM
0

Another more complex solution, if the other one doesn't work:

With the incoming data - You could store one value in a message header, one value in a message exchange property and one value in the body to keep them separate. To replace the string values you could use a Groovy Script and manipulate the properties using the tags:

def message_body = message.getBody();

def message_headers= message.getHeaders();

branch1Val = flow_headers.get("branch1Val");

def message_properties = message.getProperties();

branch2Val = flow_properties.get("exprop2");

Then combine them within the script as you please. Using a substring function to find and replace the text between <pkp> </pkp> , and <bkp> </bkp>

Share
10 |10000 characters needed characters left characters exceeded