cancel
Showing results for 
Search instead for 
Did you mean: 

Multiply occurrences in the source to different nodes in the target

pi_consultant1
Participant
0 Kudos

Hi experts,

I've a scenario where I get different values in the queue with context change from the source and I have to map that to different target fields in the target...

The XSD from the source has one tag with occurrences 3..3 and the target XSD has three different fields...

My source XML looks like this:

<DTM>1</DTM>

<DTM>2</DTM>

<DTM>3</DTM>

My target XML looks like this:

<DTM1>1</DTM1>

<DTM2>2</DTM2>

<DTM3>3</DTM3>

Can you tell me how to solve this? Do I need an UDF or I can solve this with standard PI functionalities? If I need an UDF please provide me the java code...

Your help would be greatly appreciated,

Thank you in advance,


Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

You could use the predefined Constant function called copyValue e.g

DTM -> copyValue[0] -> DTM1

DTM -> copyValue[1] -> DTM2

DTM -> copyValue[2] -> DTM3

Hope this helps,

Mark

pi_consultant1
Participant
0 Kudos

Thank you very much Mark,

This helped my problem...

Regards,

Answers (1)

Answers (1)

former_member184681
Active Contributor
0 Kudos

Hi,

It all depends on the conditions. If the sequence is the key, you can use the function mendioned by Mark. If there are other conditions for putting values to fields, like value "1" always put to DTM1, no matter what is the sequence - then you can build a set of standard functions to meet your requirement.

Regards,

Greg