Custom Functions

Custom functions allow rule authors of decision service and flow projects to specify their own syntax for common functions specific to their business needs and reuse those functions throughout their rules. A custom function accepts a number of parameters, evaluates the rules against those values and returns a single result.

For example, you could create a custom function to calculate the number of months that a licence has been held:

A custom function for MonthsLicenceHeld in a decision service project

You could then use the MonthsLicenceHeld function in various rules:

Rules using a custom function for MonthsLicenceHeld in a decision service project

Custom functions are able to use other values from the project that are not explicitly passed in, as shown above, where "the assessment date" is not defined as one of the arguments in the custom function. Another example could be a custom function that determines the loyalty discount for a particular "customer" record (that is passed into the custom function) using fields like "order date" and discount tables (that are not passed in).

For more information, see: