Skip to Content
avatar image
Former Member

Mapping same fields which appear a few times

Hi experts.

My source and target structure is:

Field1

Field2

Field3

___Child1

___Child2

___Child3

Field4

-


Field3 may appear a few times in the source message.

For example:

Field1

Field2

Field3

___Child1

___Child2

___Child3

Field3[1]

___Child1

___Child2

___Child3

Field3[2]

___Child1

___Child2

___Child3

Field4

I need to pass to the target structure the "Field3" who's "Child1" is bigger than 5.

My problem is that the condition is executed only once for the first "Field3",

and if the check returns

"True" all the "Field3" are copied.

if "False" is returns no one of the "Field3" is passed.

How do I make it check each of the "Field3" elements?

Regards Max.

Edited by: Udi Dekel on May 12, 2010 7:58 AM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    May 12, 2010 at 06:02 AM
    i need to pass to the target structure the "Field3" who's "Child1" is bigger than 5.
    
    My problem is that the condition is executed only once for the first "Field3",
    and if the check returns
    "True" all the "Field3" are copied.
    if "False" is returns no one of the "Field3" is passed.

    You have not hendled Context of the source field.

    Regards,

    Abhishek.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 12, 2010 at 06:36 AM

    You have not hendled Context of the source field.

    I thought about it.

    But what context should I chose?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      You can explicitly change the context of child1 or use Remove context after child1, this way it would pass the values greater than 5 to the target.

      Thanks,

      Uaruna

  • avatar image
    Former Member
    May 12, 2010 at 06:59 AM

    I changed the context to the top most node and still same result.

    The condition looks like this:

    If Child1(Context to highest node) > 5 then create Field3.

    cant get it to work properly...

    Thanks for helping.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      If Child1(Context to highest node) > 5 then create Field3.

      For this case use ifWithoutElse function. Check the context should be at the next highest node level. Also u can try using remove context. If Child1(remove context) >5 then Field3.

      Thanks,

      Uaruna

  • avatar image
    Former Member
    May 12, 2010 at 09:54 AM

    Hi Udi,

    Please try as follows:-

    If the structure is like below -


    parent segment

    --Field1

    --Field2

    Field3 -


    mapping--->Targetsegment

    ___Child1

    ___Child2

    ___Child3

    --Field4

    where Targetsegment is like

    Targetsegment

    ---child1

    ---child2

    ---chilld3

    So to achieve ur requirment map the TargetSegment first as follows and then the do the mapping for child of Feild3-

    Child1---> check for value >5 -


    > cretae if (Node funtcion) ---> Targetsegment

    Where the context of the child1 should be changed to the parent segment of the Feild3.

    Try this , i hope it works.

    Regards,

    Jyoti

    Add comment
    10|10000 characters needed characters exceeded