on 04-28-2016 7:30 AM
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();
}
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you give us a sample string?
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Please ignore if i misunderstood ur problem.
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); // This will not print the value
getTrace().addInfo(" value of split cc is"+Arrays.toString(CC));// This will print something like [a,b,c,d...]
for(int i=0;i<CC.length;i++)
{
getTrace().addInfo(" value if split cc is"+CC.length);
getTrace().addInfo(" value split cc is"+CC[i]);// Use this to print individual values
for(int j=0;j<StrEntitycode.length;j++)
{
StrEntitycode[j] = StrEntitycode[j].substring(0,3);// better use local variable here
if(CC[i].matches(StrEntitycode[j]))
{
result.addValue("TRUE");// If you just need single value then you can break the execution
break;
}else
{
result.addValue("FALSE");
}
}
}
}
catch(Exception e)
{
e.printStackTrace();
}
NB
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ";"
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kantilal ,
The code works fine in Eclipse , But the same is not working in PI message mapping . The reason i am printing the trace is to check if my array values are split properly . This statement shows that array value is not split. Please help me if i have gone wrong in the split statement.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.