Skip to Content
avatar image
Former Member

PI Mapping : Create extra node for text after 65 char

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jul 31, 2017 at 07:48 AM

    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("");

    }

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 31, 2017 at 07:38 AM

    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

    Add comment
    10|10000 characters needed characters exceeded