cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping Task

Former Member
0 Kudos

Hi,

I have following Problem.

with a source message like:


<main>
 <element>
  <id>Z10</id>
  <value>Test10</value>
  <value>Test11</value>
 </element>
 <element>
  <id>Z20</id>
  <value>Test20</value>
  <value>Test21</value>
  <value>Test22</value>
 </element>
 <element>
  <id>Z30</id>
  <value>Test30</value>
 </element>
 <element>
  <id>Z40</id>
  <value>Test40</value>
  <value>Test41</value>
  <value>Test42</value>
 </element>
</main>

I want to select only the value of the element with ID = Z30.

In my message Mapping i have a customer function where loop over ID and than i select the value where ID equals "Z30".

But because i have several value tags the queues have different length.

That means the third entry in ID queue is "Z30" but the third entry in value queue is "Test20".

So i get the wrong value. Any Idea how i can synchronise the queues.. so that the ID and the values all on the right position ?

Regards,

Robin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Robin,

I would'nt use a UDF.

I would use a condition (if) for

- <id>

- <value>

This should work

Regards Mario

Former Member
0 Kudos

Hi Mario,

but than i have the same problem with this different queues because the value queue is longer.

I try to do this:

ID = "Z30" -> than i become a queue like ... false, false, false, true.

Than i use the condition IfwithoutElse and on THEN i put the VALUE queue but this one is much longer so on position 4, where i get true in ID queue is not the VALUE entry i want.

Regards,

Robin

Former Member
0 Kudos

Hi Robin,

try using the removeContext function after the IfwithoutElse node.

Regards

Dominic

Former Member
0 Kudos

Hi,

Here you want your ELEMENT tag to be created only if id is Z30

<element>

<id>Z10</id>

<value>Test10</value>

<value>Test11</value>

</element>

<element>check if id = Z30 then CREATEIF node else don't do anything<element>

The CREATEIF standard function creates the node of the segment . So if the value is true the node will be created else not.

I think the rest will work with one to one mapping ro u might try with just context change.

Regards

Vijaya

Former Member
0 Kudos

Mine works OK:

/ns0:mt_test1/element=/ns0:mt_test1/element= /ns0:mt_test1/element/id=ifWithoutElse([keepss=false]stringEquals(/ns0:mt_test1/element/id=, const([value=Z30])), /ns0:mt_test1/element/id=) /ns0:mt_test1/element/value=ifWithoutElse([keepss=false]stringEquals(/ns0:mt_test1/element/id=, const([value=Z30])), /ns0:mt_test1/element/value=)

Regards Mario

Former Member
0 Kudos

Hi,

this works but i dont get the value.

i have one target field which should fill with the value of the Z30 element.

There is always only one Z30 Element with has the value i need.

I just have to find the right value from the source structure over the ID.

But when i map the value field i always get a queue with all values.

i want a target structure like:


<main>
<status>AN HERE THE VALUE FROM Z30</status>
<...rest of the document..>
<...rest of the document..>
<...rest of the document..>
</main>

Regards,

Robin

Former Member
0 Kudos

Hi,

Thanks .. it works now.

I change my data type to

<Status>

<value></value>

<Status>

For Value i just map the source Value. And for the Status tag i use createelf function.

After playing a little bit with the Kontext of ID and value it seems to work now.

Thanks again,

Robin

Answers (0)