cancel
Showing results for 
Search instead for 
Did you mean: 

message mapping logic help

Former Member
0 Kudos

Hi All

I have a source structure like this below. It's a big structure actually. I'm just pasting the relevant structure where I need your help.

</root>

---

---

     <storage> 

         <id>AB</id>

         <Type>TY</storType>

         <Temp>100</Temp>

    </storage>

------

-----

----</root>

My requirement is to check the value coming in <Type> and if it is TY, then the target structure will be the exactly the same

If it is XY, then the target structure will have one more field <celsius> and will look like this below.

</root>

---

---

     <storage> 

         <id>AB</id>

         <Type>TY</storType>

         <Temp>100</Temp>

         <celsius>922</celsius>

    </storage>

------

-----

----</root>

The <storage> complex element with elements can repeat as many times in the source XML. But the values of <Type> will be either TY or XY and I have to create the target structure accordingly. Pls help. I am using graphical message mapping

thx

mike

Accepted Solutions (1)

Accepted Solutions (1)

Harish
Active Contributor
0 Kudos

Hi Mike,

The target field celsius is from source message or constant?

If it is from source message then mapping of celsius field is

Type --> Equals (XY) --> If without else --> Map constant or source field to celsius.

Regards,

Harish

Answers (3)

Answers (3)

former_member192343
Active Contributor
0 Kudos

Hi Mike

here is example for your needs, I don't know how you convert to celsius, I made it from Temp assuming that it is in Kelvins.

But you also can change it to constant.

Regards, Mikhail

Former Member
0 Kudos

Hi Michael,

Please try below mapping

Regards,

Krupa

Former Member
0 Kudos

thanks all. I forgot to mention that target field is a constant. Not from source message

Former Member
0 Kudos

Thanks all. I got it now...

former_member182455
Active Contributor
0 Kudos

Hi,

please try this mapping.

Regards

srinivas