Skip to Content
author's profile photo Former Member
Former Member

How to work with MultiMapping

I need to map my message types

source

<PersonInputMessageType>
   <persons>
      <person>
         <name>Test1</name>
      </person>
      <person>
         <name>Test2</name>
      </person>
   </persons>
</PersonInputMessageType>

target

<PersonMessageType>
   <person>
      <name>Test1</name>
   </person>
</PersonMessageType>
<PersonMessageType>
   <person>
      <name>Test2</name>
   </person>
</PersonMessageType>

I created a visual mapping where I mapped fields

pesron->person, name -> name.

The result is

<PersonMessageType>
   <person>
      <name>Test1</name>
   </person>
</PersonMessageType>

What step did I miss?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2005 at 08:48 AM

    Hello Sergey,

    You could use the removeContexts function in case that there are more than one <persons> tags. I'd suggest the following:

    person -> removeContexts -> PersonMessageType,

    Constant -> person

    name ->name

    Best regards

    Joachim

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2005 at 07:51 AM

    Hi Sergey,

    YOu need to use the removeContexts() function.

    Regards

    Priyanka

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2005 at 08:22 AM

    Hello Sergey,

    You also have to create a mapping

    <person> -> <PersonMessageType>

    Since in a multi-mapping the occurrence of the result message is set to 0..unbounded, it will not be created automatically (0 occurrences are allowed!!!). By the mapping cited above, you create the same number of target messages, as there are <person> elements.

    In addition you also have to take care about the occurrences of the target element <person>. If it's set to 1..1, there is no problem. If it's set to 0..1, please assign a constant to it, to make sure it is built up at runtime.

    Best regards

    Joachim

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.