cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping issue with if else

Former Member
0 Kudos

Src. Structure:

A (0-unbounded)

within A-> p

B (0-unbounded)

within B-> p

NOTE: at a given instant either A/B can occur, # of K(Target)should b same as # of A/B

Target structure

K(0-unbounded)

within K---> z(1)

now i have done A/B -> K mapping,

question comes when i try to map the p to Z field within K,

depending on weather A/ B exists i need to map the P in A/B to the Z field in K,

here is what i have done so far:A/B->K mapping

A --> exists -->OR createif --> SplitByValue -->K

B --> exists -->

for mapping p-> Z (i used if then else function)

A --> exists -->if then --> A.p --> K.z

else-> B.p-> K.z

Here is the test scenario i am doing:

I send a test without A's only 3 Bs

I get 1 K element with 1 z in it.

the remainder of the elements of B in other contexts don't show up.

When i do a display queue: for my p->z mapping at the if-then-else function i can see only 1 output from it though there are 3 p fields, this is because in my K structure z field can occur max only once,

HOW CAN I HAVE seperate Z elements, each within different K elements?

Your help is very much appreciated, this sounds so complicated i hope not, i m sure im not doing something correct, can some1 help me understand this?

Thanks,

Hank

Accepted Solutions (1)

Accepted Solutions (1)

former_member200962
Active Contributor
0 Kudos

If you have not got the solution, then consider this logic:

K is 0..unbounded so in the MM duplicate the subtree for K (so now you will have 2 K nodes)

A -


> exists -


> createIf ---> K ........K will occur when A node exists in the source...to one of the two K nodes

To map A.p to K.p

A.p -


> K.p ....... you may need to increase the Context of the A.p node....K.p should be the first K node to which the above exists logic (A exists) is applied.

B ---> exists ---> createIf ---> K .........K will occur when B node exists in the source...to second K node

To map B.p to K.p

B.p ---> K.p....... you may need to increase the Context of the B.p node....K.p should be the second K node to which the above exists logic (B exists) is applied.

Regards,

Abhishek.

Former Member
0 Kudos

Thank you ,

your logic works , its simply amazing.

Thank you very much

Former Member
0 Kudos

Is there a way around other than this logic thoug? can you see my latest question here? can u chck and tellme if i am not setting the context right?

Answers (0)