cancel
Showing results for 
Search instead for 
Did you mean: 

mapping issue

former_member232455
Participant
0 Kudos

Hi All.

need your help in one mapping logic. Based on the sender field value i want to repeat target field. if suppose sender field value is 100 then target field should create 100 times.

Regards,

Janardhan

Accepted Solutions (1)

Accepted Solutions (1)

manoj_khavatkopp
Active Contributor
0 Kudos

Try this :

Execution type : All values of Queue/Context.

Input : var1


for(int i=0 ; i<var1[0] ; i++)

{

result.addValue("");

}

Map this UDF as SourceFiled---->UDF---->TargetNode.

But make sure you have target node occurrence to 0..N.

Br,

Manoj

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Jana,

Please find the attached images which describes the logic in details and its working fine to generate a target field n no of time when source field value is n.

Thanks

Sagarika

former_member232455
Participant
0 Kudos

Thank you so much sagarika, the code is working perfect. but since we still need to put some filter on this logic.. it is till under discussion...

But the code which u provided is really helpful..

former_member186851
Active Contributor
0 Kudos

Hello Jana,

If you wish to repeat the nodes and pass the values as well,Try the below logic

Output For single Value:

Output For Multiple Values:

If you wish to repeat the nodes with no values in it,Try the below logic

Output:

former_member190293
Active Contributor
0 Kudos

Hi Janardhan!

Maybe you could tell us more about your mapping logic? I just try to understand the aim of simple repeating the node n times. I guess that next question will be about filling that cloned nodes with some data.

Regards, Evgeniy.

former_member187587
Contributor
0 Kudos

Can you share your structure of the surce message?

former_member186851
Active Contributor
0 Kudos

Hello Janaradhan,

Create

Source(0-Unbounded)----createif-------Target(O-unbounded)

Hope this will repeat the target based on source.

former_member232455
Participant
0 Kudos

Hi Raghu,

but in source structure the field comes only one time. the field value will come 10 then target node should create 10 times.

Regards,

Janardhan

former_member186851
Active Contributor
0 Kudos

Guess it will work Jana.as the occurrence is unbounded.

did you try the logic?

former_member182412
Active Contributor
0 Kudos

Again blind guess, did you try before give the answer?? if you are not sure better dont give the answer.

anupam_ghosh2
Active Contributor
0 Kudos

Dear Raghu,

                 I have been following your answers for a while now. Before I  comment anything further let me confess that I know very little of PI and I am sure my knowledge of the subject is less than most members in the forum.Therefore  when ever i try to respond to a thread, I ensure practically my solution works. To increase quality of content in each thread of the forum it is essential  that we test each solution  our self and then respond to the thread. Guess work and assumptions do not work in projects as well as in forum. I support what Praveen Gandepalli   is trying to convey to you. Please do not see this as if we are trying to correct you. This is a forum and we are trying to increase quality of content within forum. People open threads only when they are in trouble , so let us try to provide solution which will help them and not waste their time depending on guess work. Please do not take this as a criticism, we are here to help each other. keep smiling and keep posting

Regards

Anupam

former_member186851
Active Contributor
0 Kudos

Alright Anupam and Praveen..Will take care of it.

I use the word guess to ensure that let them try and come .Even If am 100% sure i wont say this is correct as there could be other way or sometimes I might be wrong.

Thanks and will learn from experts as usual as I am a beginner.