cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping question

Former Member
0 Kudos

I have this question in mappnig:

Source Structure:

-> A(NODE) 0- unbounded

->B(NODE) 0-unbounded

Target Structure

-> K NODE(0-unbounded)

i need to create K when ever A / B is created, at a given instant (In one messge either A/B will occur both can't occur)

but the target should always occur and it shoud b based on A/B

Thanks for the help

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Will follow up on your suggestions thanks

udo_martens
Active Contributor
0 Kudos

Hi,

you need to do (nearly) nothing:

Just map A to K AND B to K (by doublicating K).

If either A or B occurs you always get a K.

Regards,

Udo

Edited by: Udo Martens on Jun 23, 2009 5:56 PM

Former Member
0 Kudos

>>but the target should always occur and it should b based on A/B

Means occurence of K is same as occurence of either A or B?

If yes,then you can implement this via If-Else standard function.


If A Exist,Map A to K 
Else If B Exist,Map B to K 
Else Map Constant to K 

Note:The above is Not a UDF,its a logic to implement If-Else via standard functions.

Thanks

Aamir

Former Member
0 Kudos

Thanks every1,

pretty much cose to the solution,

Thank you

Former Member
0 Kudos

Aamir,

I use the if - else std function like this:

if A exists then map a to K

else map B to K ,

Now when i do a test with only B's in the message: only 1st value of B gets created. ie only value in 1st context

i see only 1 K for the first value of B.

Whereas, with the same logic when i test only with 2 A;s i get 2 Ks

Former Member
0 Kudos

Check the queue by right clicking mapping condition steps and also give a try by putting the removeContexts after if condition and check

Rajesh

Edited by: Rajesh on Jun 23, 2009 11:39 PM

Former Member
0 Kudos

Hey

Condition is same for both A and B


If A Exist, map A to K
ElseIf B Exist,map B to K
Else map Constant to K

Could you please check if the context is same for both A and B.

Thanks

Aamir

Former Member
0 Kudos

Hello,

Since the source can have mulitple rows, you have to use the splitbyvalue function to create the target structure. So that it explicitly creates contexts in the target sructure and populates the remaining rows.

Regards,

Akshay

Former Member
0 Kudos

Aamir,

I quite understand what u are saying,

I have used the If-Else function in PI, (K needs to occur as many # of times as A/B)

A-> EXISTS? (YES) A->K

-> (NO) B->K

Contexts of A and B are the same,

Test Case

1. 2 A's no Bs output is 2 Ks

2. 2 B's no As output is 1 K only the first B value is shown here...

Former Member
0 Kudos

Rajesh, that din do the trick ..

thanks thou

Former Member
0 Kudos

Aamir,

Please help me understand:

u have posted:

If A Exist,Map A to K

Else If B Exist,Map B to K

Else Map Constant to K

Here is what i have done can you tellme if this implements your logic? If not can you tellme how i can implement yourlogic?

Now i use the function If-Then Else , i chck if A exists? if yes in the then i map A to K and in the else i put B.

A and B are both in the same contexts.

Former Member
0 Kudos

Hello,

Use he 'exist' and 'createIf' in the Node functions. If any of the source node exists, then create the target node using creatif.

Regards,

Akshay