Java Service To Add Two Integers

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

Avinash,

Please locate and spend some time with the very helpful Integration Server Developer’s Guide and Integration Server Built-In Services Guide. These PDF documents are located in your Developer\Docs folder.

There are hundreds of built-in services that come ready to make your life easier.

Mark