PDA

View Full Version : Java Dropping a Variable from putput


snanda
05-13-2003, 08:53
In a java service developed in WM IDE, I have a input variable "a" which is assigned to another variable "b".b is the output variable. As a result of running this code the pipleline has a and b as output. Is there a best coding practise that I should do in order to drop the variable a from pipeline output of the java service similar to WM drop varibale.

jimp
05-13-2003, 09:07
The webMethods java API uses the IDataCursor.delete method to remove pipeline variable in your java service before returning to the wm service that invoked it. See the API help for more details.

dfmalan
05-13-2003, 09:53
Bear in mind that by dropping an Input variable inside your service you may find you've totally removed a variable from the pipeline.

I generally find that it is not optimal for an invoked service to drop its own input pipeline variables. IMHO the better approach is to rather clean obsolete variables from the pipeline 1 level up ie. as one aggregates services eg.

"Aggregate" service
invoke service A (uses var X on pipeline as input)
invoke service B
invoke service C (also uses var X on pipeline as input)
MAP step (drop obsolete vars left over from service A,B&C invocations)

In that way you ensure the "Aggregate" service only leaves its own input and output variables on the pipeline, thus adhering to its specifications as on the Input/Output tab.

YMMV
Danie

snanda
05-13-2003, 10:45
Thanks everybody for their valuable input in this issue.