cancel
Showing results for 
Search instead for 
Did you mean: 

UDF to Create multiple nodes

Former Member
0 Kudos

Hello All,

I have a requirement to create multiple nodes.

The source message will have a values in one particular field sent as follows: 11,22,33

And at Target i need to create 3 nodes.

I have written following UDF, but it returns the output as string, i need help in how to get the values in diff context:

====================================================================

int commas=0;

String s=new String();

s="";

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

{

if(input.charAt(i)==',')

{

commas++;

s=s+"true";

}

}

return s;

===================================================================

currently i am getting the output of this udf as truetruetrue

And i need to get it as below , in diff context:

true

true

true


so that i can create 3 nodes at target side.

please help!

Thanks,

Jane

Accepted Solutions (1)

Accepted Solutions (1)

RaghuVamseedhar
Active Contributor
0 Kudos

Jane,

Please create a UDF with Execution Type : "All Values in Queue"


for(int i=0;i<input[0].length();i++)

{

  if(input[0].charAt(i)==',')

  {

   result.addValue("true");

result.addContextChange(); 

  }

}

Former Member
0 Kudos

Thank You Raghu, It worked!

Regards,

Jane

Answers (0)