cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping issue

Former Member
0 Kudos

Hi guys!

I need to create mapping from source

<PART>

<ELEMENT></ELEMENT>

<ELEMENT></ELEMENT>

<ELEMENT></ELEMENT>

<ELEMENT></ELEMENT>

</PART>

to

<PART>

<EL1></EL1>

<EL2></EL2>

<EL3></EL3>

<EL4></EL4>

</PART>

How to achieve this?

Thanx a lot, Olian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Olian..

I got it..

you need to use constant function "copy value"

you need map like

element ->[copy value (0)] -> el1

element ->[copy value (1)] -> el2

element ->[copy value (2)] -> el3

element ->[copy value (3)] -> el4

some prob. lemme check once again..

Regards

Pushkar

Message was edited by:

pushkar anand

Answers (5)

Answers (5)

Former Member
0 Kudos

pretty simple

map target node "part" to element in the source message.

so occurance of part will be same as element.

Regards

Pushkar

Former Member
0 Kudos

So ultimately

element - > ele (for value )

element -> part (for occurancce )

Regards

Pushkar

Former Member
0 Kudos

Hi

I think you need to use removecontext, Which are the node functions.

As the source element which you are mapping and the target structure element which you are mapping does not fall in the same context, you need to use

node functions which are removecontext which will make the target element fall under the same context as the source structure. Message Mapping in XI works in the form of Queues.

Thanks

Rajanikanth

Former Member
0 Kudos

pushkar,

part element is in the both structures only once..

example:

.....

<part>

<element>This</element>

<element>is</element>

<element>test</element>

</part>

......

must be mapped to

....

<part>

<el1>This</el1>

<el2>is</el2>

<el3>test</el3>

</part>

O.

justin_santhanam
Active Contributor
0 Kudos

Olian,

Src

<Part>

<Element> [Occurrences - 4]

</Part>

Tgt

<Part>

<Element1>

<Element2>

<Element3>

<Element4>

</Part>

In your source structure are you sure ,that you will always get 4 Element nodes. If yes why can't you change the structure by creating 4 nodes in the source.

Ok if you are not satisfied with the above , then you have to comporomise on the other way. Is it ok for you to create 4 UDF.

Its nothing just get all the input values in queue.

Create 4 UDF :

UDF 1 : return " input[0]"

UDF 2 : return " input[1]"

UDF 3 : return " input[2]"

UDF 4 : return " input[3]"

<i>Mapping</i>

Element [Change context to one level higher] -->UDF1 --> Element1

Element [Change context to one level higher] -->UDF2 --> Element2

Element [Change context to one level higher] -->UDF3 --> Element3

Element [Change context to one level higher] -->UDF4 --> Element4

Hope it helps you!!!

Best Regards,

raj.

justin_santhanam
Active Contributor
0 Kudos

Olian,

Its great, use Pushkar suggesttion to achieve the same its working.

Great work, Pushkar!!!!.

Best regards,

raj.

Former Member
0 Kudos

Pushkar, you're right... Copy Value is the way..

Thanx to others!

O.

Former Member
0 Kudos

Hi Olian

What all u need to do is to create two message types. Structure of the message type for the sender side is as follows:

PART ( as node)

ELEMENT ( at the child level w.r.t PART)

E LEMENT ( at same level w.r.t. ELEMENT)

ELEMENT ( at same level w.r.t. ELEMENT)

ELEMENT ( at same level w.r.t. ELEMENT)

Structure of the message type for the receiver side is as follows:

PART ( as node)

EL1 ( at the child level w.r.t PART)

E L2 ( at same level w.r.t. EL1)

EL3 ( at same level w.r.t. EL2)

EL4 ( at same level w.r.t. EL3)

Now create a new instance of message mapping and drag and drop the corresponding message types in the sorce and target side and then you can map as follows :

ELEMENT -> EL1

ELEMENT -> EL2

ELEMENT ->EL3

ELEMENT ->EL4

Hope that it answers your query completely.

Thanks

Amit

Former Member
0 Kudos

))

Guys, thanx for answer!

But, I wrote it wrongly...

msg1

<part>

<element> ....with occurance 0..4

msg 2

<part>

<el1> occurance 0..1

<el2> occurance 0..1

<el3> occurance 0..1

<el4> occurance 0..1

It can't be done by simple drag n drop

Thanx O.

Former Member
0 Kudos

Hi,

Map node with node and part with part.

and also the element with element.

But use splitbyvalue function in node....

if doesnot work then use this function in Element.

Regards

Hemant

Former Member
0 Kudos

Hi;

You need to create 2 Data types with these structures resp.

2 Message types

2 Message interfaces

1 Message mapping

Mapping

<PART> <PART>

<ELEMENT></ELEMENT> -


<EL1></EL1>

<ELEMENT></ELEMENT> -


<EL2></EL2>

<ELEMENT></ELEMENT> -


<EL3></EL3>

<ELEMENT></ELEMENT> -


<EL4></EL4>

</PART>

Mudit

Award points if it helps

Former Member
0 Kudos

Hi Olian,

you can directly map all the elements of source to target using message mapping.

Create new message mapping in mapping objets in design and create the source and target structure and map them one to one.

Hope this helps,

cheers,

shivika

MichalKrawczyk
Active Contributor
0 Kudos

hi,

create a message mapping with both structures and just

root node to root node and

connect <ELEMENT> --> <EL1>

etc.

with drag and drop

that's all I guess

for reference:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/be05e290-0201-0010-e997-b6e...

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>