(variable) is defined | undefined

This construct checks if a variable is defined or undefined. It is available in decision models only.

Purpose

In a decision model, the decision logic can prevent rules that try to access the value of undefined nodes from running. Take the following example:

if the amount of 'shopping cart' is more than 1000 then ...

If shopping cart is undefined, the rule will not be applied.

It is however possible to check if a variable is defined and apply a fallback value in case it is undefined.

Syntax

For single-valued decision nodes:

<variable> is defined | undefined

For multi-valued decision nodes:

<variables> are defined | undefined

Examples

The following rule tests whether the variable shopping cart is undefined. If it is undefined, the string No shopping cart provided is returned.

if 'shopping cart' is undefined then print "No shopping cart provided" ;

The following rule tests whether the variable messages is undefined. If it is undefined, the string No message available is returned.

if 'messages' are undefined then print "No message available" ;