cancel
Showing results for 
Search instead for 
Did you mean: 

Java Mapping in pi 7.1 using pi 7.1 nwds

Former Member
0 Kudos

I am writing a program to remove the special chars in NWDS Java mapping. this is for replacing the "&" with "&".. I am able to compile it and import the jar in PI.. but it does not do anything.. please check..

And also let me know where to check for Java mapping executed with trace detail.. to check if any error

try {

int read_data;

while ((read_data = arg0.getInputPayload().getInputStream().read()) != -1) {

if (read_data != '&') {

arg1.getOutputPayload().getOutputStream().write(read_data);

} else {

arg1.getOutputPayload().getOutputStream().write("&".getBytes());

}

}

arg1.getOutputPayload().getOutputStream().flush();

}catch (Exception e) { }

}

}

Accepted Solutions (1)

Accepted Solutions (1)

vijay_kumar133
Active Participant
0 Kudos

Dear Gopal,

If i not wrong you need to replace all the charecters "&" with blank ...

if so you can this code for doing that..

String outData = inData.replaceAll("&","");

or

you need to replace any special charecter to blank please clarify..

so that i can help you out to solve this issue using java mapping..

Regards

Vijay

Answers (1)

Answers (1)

stefan_grube
Active Contributor
0 Kudos

> arg1.getOutputPayload().getOutputStream().write("&".getBytes());

I suppose when you always get a new outputstream in a while loop, at the end there will be no output.

Do not concatenate method calls. Call each method at the right place.