Skip to Content
author's profile photo Former Member
Former Member

UDF is not working properly in PI ( Message mapping )

Hi Experts ,

I am trying to split a string array of length 42 (which can vary in future if a new entry is added) . The code i used was checked in Java it works absolutely fine however, the same in PI is throwing me a value like "Ljava.lang.String;@5b275936 " when i try to print in trace . It is not printing all the 42 value's . Please help me on where i have gone wrong. I am using PI 7.40 dual stack.

Code below is the code i have used in my message mapping.

try

{

String s3 = Arrays.toString(StrCC).replaceAll("\\[|\\]|\\s","");

String CC[] = s3.split(";");

getTrace().addInfo(" value if split cc is"+CC.length);

getTrace().addInfo(" value of split cc is"+CC);

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

{

getTrace().addInfo(" value if split cc is"+CC.length);

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

{

StrEntitycode[j] = StrEntitycode[j].substring(0,3);

if(CC[i].matches(StrEntitycode[j]))

{

result.addValue("TRUE");

}else

{

result.addValue("FALSE");

}

}

}

}

catch(Exception e)

{

e.printStackTrace();

}

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 02, 2016 at 12:12 PM

    Hi All,

    Thanks for the suggestions. My issue was resolved . The reason for this error was while binding the parameter in Operation mapping. The value was given as 'value' once the quotes were removed they worked perfectly fine and my values are getting displayed.

    Thanks ,

    Sukanya Srinivasan.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 28, 2016 at 06:55 AM

    Hi Sukanya,

    You are printing the object directly. So you are getting object reference.

    getTrace().addInfo(" value of split cc is"+CC);

    Change like below.

    getTrace(" value of split cc is" + Arrays.toString(CC));

    Regards,

    Praveen.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Praveen Gandepalli

      Hi Praveen,

      This worked , but now my values are being printed in Message mapping , but the same is not getting reflected in Moni , when i tried to check the trace .

      when i checked my operation mapping , the test turned out to be successful , but my result was not printed in the receiver message mapping part , in the operation mapping. Just to add , my receiver is Standard receiver from SAP in the namespace http://sap.com/xi/XI/System ( Receivers). This has an extended receiver determination in the ID side to determine to which receiver the flow should go .

      The receiver is getting determined in message mapping when i tested but not in operation mapping.

      Capture1.PNG (6.7 kB)
  • Posted on Apr 28, 2016 at 06:50 AM
    • getTrace().addInfo(" value of split cc is"+CC); --> This line will definitely return Ljava.lang.String;@5b275936


    • If you do a System.out.println(" value of split cc is"+CC); in your standalone java code -> the output will be similar.

    Regards

    Bhavesh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 28, 2016 at 06:51 AM

    Hello Sukanya,

    Guess your trying to split a single array,

    And no need to go for queue/contexts.

    Let us know if you wish to split the string based on ,(comma).

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Sritharan,

      I have to split the string based on ; because i have given an Signature value in my message mapping . That value holds the single array. I have to compare the value one by one to print the result. Will it work if i use a "," ? as i have used extended receiver determination and the values of CC is being given there split by ";"

  • Posted on Apr 28, 2016 at 07:48 AM

    Hi,

    Can you give us a sample string?

    Regards,

    Mark

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.