Decision returns null

Symptoms

In Decision Designer, when you run a decision, the decision returns null.

Causes

The first step when trying to understand why a decision returns null is to check your decision model and its associated decision logic to make sure they are well defined.

If there is no issue with the decision model and its decision logic, the decision might return null because of null input.

Implicit tests are triggered when you execute a rule. The rule engine checks if the input that is necessary to execute the rule is available. This input can be provided by an input data node or a decision node. If one of the input is null, the rule is not executed and returns null.

In the following example, the decision node Salutation has one direct input Name.

Example diagram with a decision node and an input data node

The decision logic of the Salutation node is defined as follows:

set decision to "Hello " + Name

If Name is null, the rule is not executed and returns null.

In the following example, the decision node Salutation has one direct input Customer. Customer has two attributes: name and address.

Example diagram with a decision node and an input node

The decision logic of the Salutation node is defined as follows:

set decision to "Hello " + the name of Customer

If Customer is null, the rule is not executed and returns null. If Customer is not null and the name of the customer is null, the rule is executed and returns Hello null.

Resolving the problem

You can rewrite the decision logic and define a default value to avoid the decision returning null.

If we take the second example, we can rewrite the decision logic of the Salutation node as follows:

if 
  the name of Customer is defined 
then 
  set decision to "Hello " + the name of Customer ;

And add a default value:

set decision to "We don't have correct information to greet you."

For more information about defining a default value, see Defining a default value.