cancel
Showing results for 
Search instead for 
Did you mean: 

PI Mapping : Create extra node for text after 65 char

Former Member
0 Kudos

Hi Experts,

I am working on one of the interface were I need to cut the incoming text into 65 Char and send it to target Node , If the text is more than 65 Char I need create the another node for rest of the characters in text or up to 65char again if its more than 65 char and this will repeat every 65 char in text.

And for every node I have to add sequencing starting from 1.

Target result :

Text ---->Node (65 char ) 1 aaaaaaaaaaa

Node (65 char ) 2 bbbbbbbbbbb
Node (65 char ) 3 ccccccccccccc

...............

Really appreciate if their is any UDF that will help in achieving this requirement.

Thanks in advance.

Regards,

Pooja

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member186851
Active Contributor
0 Kudos

Use the below UDF(all values of queues),This will create and split target node for every 65 characters

String calc=var1[0];

String b[]=calc.split("(?<=\\G.{65})");

int leng = b.length;

for(int i=0;i<leng;i++)

{

result.addValue(b[i]);

res.addValue("");

}

Harish
Active Contributor
0 Kudos

Hi Pooja,

You can duplicate the target node in the message mapping and put the condition on the second node creation if the source field length is greater than 65.

regards,

Harish