Skip to Content
avatar image
Former Member

Mapping problem

Hi guys,

I'm trying to satisfy following mapping condition but I can't achieve it:

if NodaA(1..1) exists, repeat per each NodeX, else repeat it per each NodeY.

The problem is EXISTS function returns only one item in the queue and NodeX and NodeY have different number of occurence. If these would be the same I could use OneAsMany, byt if NodeX is there 5times and NodeY 7, I'm not able to do it.

Any ideas, how to acjieve this?

Thanks a lot,

Peter

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 03, 2008 at 10:32 AM

    Hi Peter,

    You can do this using a ADVANCED UDF. Try this.

    The UDF will have three inputs:

    1. NodeX >Remove Context >

    2. NodeY >Remove Context >UDF

    3. NodeA > Exist >

    The UDF Cache Value will be queue.

    Public Sample(String[] NodeX,String[] NodeY,String[] NodeA Container.....) {

    if(NodeA[0].equals("true"))

    {

    for (int i=0;i<NodeX.length;i++)

    result.addValue(NodeX<i>);

    }

    else

    {

    for (int j=0;j<NodeX.length;j++)

    result.addValue(NodeY[j]);

    }

    }// end of class

    Thanks,

    Bhargav

    Note:Award Points if found useful

    Edited by: Bhargav Srinadh Gundabolu on Sep 3, 2008 12:43 PM

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      DSP boys, sorry, my mistake - the occurence is 0..1.

      Bhargav, this is what I needed. I tried so hard to work with standard functions that I forgot this option 😊

      Thanks,

      Peter

  • avatar image
    Former Member
    Sep 03, 2008 at 09:51 AM

    Hi!

    Have you tried to change the context of NodaA?

    Regards,

    Radek

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 03, 2008 at 10:23 AM

    Hi Peter,

    There is no need to check if NodaA exists because its occurence is already 1..1 (Mandatory). I hope this helps...

    Regards

    Add comment
    10|10000 characters needed characters exceeded