cancel
Showing results for 
Search instead for 
Did you mean: 

UDF - Insert 'suppress' in the first context

0 Kudos

Dear Experts,

I hope it's okay to get your inputs/advise in creating a UDF for PI mapping to insert a 'suppress' value in the first context.

Below is the sample data.

Current scenario:

xxxxxx

<contextChange>

zzzzzz

<contextChange>

Target:

SUPPRESS

<contextChange>

zzzzzz

<contextChange>



Thanks in advance!


Accepted Solutions (1)

Accepted Solutions (1)

former_member184720
Active Contributor
0 Kudos

Execution type : All values of Queue

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

{

if(i==0)

{

result.addValue(ResultList.SUPPRESS);

}

else

{

result.addValue(var1[i]);

}

}

0 Kudos

Thanks Hareesh for the code.

Would you be able to advise also for a code that will 'always' put SUPPRESS on every context except the last context?

Example #1:

xxxxxx

<contextChange>

yyyyyy

<contextChange>

zzzzzz

<contextChange>


Target #1:

SUPPRESS

<contextChange>

SUPPRESS

<contextChange>

zzzzzz

<contextChange>


Example #2:

xxxxxx

<contextChange>

yyyyyy

<contextChange>

qqqqq

<contextChange>

zzzzzz

<contextChange>


Target#2:

SUPPRESS

<contextChange>

SUPPRESS

<contextChange>

SUPPRESS

<contextChange>

zzzzzz

<contextChange>


Appreciate your help on this.

Thank you!



former_member184720
Active Contributor
0 Kudos

Did you try changing the if condition to if(i==var1.length-1) instead of if(i==0) ??

0 Kudos

Thanks Hareesh! It's working as expected!

Answers (1)

Answers (1)

pvishnuvardan_reddy
Active Contributor
0 Kudos

HI Frederick,

This can achieved using plain graphical functions itself. PFB sample screen shot for your reference.

Try this out and let me know if you struck anywhere.

Regards

Vishnu