In WmPublic there are several mathematical services. One of them being an “addInts” service. But if you are justing learning to use java services, here’s the code:
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
String num1 = “0”;
String num2 = “0”;
int sum = 0;
if (idcPipeline.first(“num1”)) {
num1 = (String)idcPipeline.getValue();
}
if (idcPipeline.first(“num2”)) {
num2 = (String)idcPipeline.getValue();
}
sum = Integer.parseInt(num1)+Integer.parseInt(num2);
idcPipeline.insertAfter(“value”,sum+“”);
pipelineCursor.destroy();