cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping help

Former Member
0 Kudos

Hi Experts,

If the source field value is "ONE" then the target segment will occur only once, otherwise as many time as that of source segment.

How to do this mapping?

Regards

Sara

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

are you talking about the value in the source field or the occurance of the source field?

if it is the occurance then you can directly map the segment to the target. Note that the source and target segments sud have the occurance as unbounded in such a case.

Answers (5)

Answers (5)

former_member193376
Active Contributor
0 Kudos

Hi

You will have to use IF THEN condition and check if ur input is equal to "ONE".

if its not equal to "ONE" then you will have to use the standard function USE ONE AS MANY.

Note: while using USE ONE AS MANY standard function, be sure to set the context properly else u will get an error.

This will help you.

Thanks

Saiyog

dharamveer_gaur2
Active Contributor
0 Kudos

Hi

Use UseOneAsMany function.

look this blog to use it

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii (point 7)

former_member200962
Active Contributor
0 Kudos

Hi,

<SRC>
<node1>ONE</node1>
<node2></node2>........(0..unbounded)
</SRC>

If I got your req right then proceed as follows:

1) Check if source field = ONE....use constant(with value ONE) and EqualS function.

2) give the output of EqualS function to If (With else)

3) give the source field (here node1) as input to the then part..

4) Now for the else part use the segment as input according to which you want your target to repeat (here node2)....

5) output of If-else should be given to the respective target element....

6) set the context properly...

7) make sure that target is repeating....if the else part has to be executed.

Regards,

Abhishek.

Edited by: abhishek salvi on Dec 1, 2008 2:43 PM

Edited by: abhishek salvi on Dec 1, 2008 2:45 PM

Former Member
0 Kudos

Please find my revised question

When any of the repeated segment value has field value "ONE" then the target segment will occur only once, otherwise as many time as that of source segment.

Please provide your suggestion.

Regards

Sara

SudhirT
Active Contributor
0 Kudos

Hi,

Pass that field value(one or two) to the UDF and write this code in UDF

for(int i =0;i<a.length;i++)
result.addValue("");

Thanks!

dharamveer_gaur2
Active Contributor
0 Kudos

It depend on your Scenario,could u explain in detail your requirement.

Generally For One source Message , one target message would be generate.