Skip to end of metadata
Go to start of metadata

Motivation

webMethods contains several useful built in services in the pub.math folder. One problem with these services though, is that they are not "safe". For instance if you call pub.math:addInts and pass in the values 1 and null it throws an error. This means that instead of assuming that a null is zero, you need to introduce the overheads of extra error handling.

Solution

Write your own "Safe" math classes. The package contains services in the "safemath" folder that cleanly wrap up the functionality and can make mapping chores just that little bit more maintainable.

Implementation Example

A simple two line solution for each of the services you wish to wrap up for safety is to put a MAP step which sets num1, num2 to 0 with the "Overwrite pipeline variable" checkbox de-selected:

Labels
  • None
  1. Nov 07, 2008

    Aditya Gollakota

    You can also use the services in PSUtilities like the one below:

    You can also use the services in PSUtilities like the one below: