set (variable) to (value)

This construct specifies a value for a variable.

Purpose

You use this construct in the action part of a rule to set the value of a variable.

Syntax

  • In decision models:

    set decision to <value>
  • In task models:

    set <variable> to <value>

Description

The decision keyword represents the decision node output. Unlike other node variables, it is mutable and policy-dependent. The value can be a literal value, an expression, or a list.

Example

Consider a decision logic for determining the current age of a customer. This decision logic might have a rule that sets the decision to the age of the customer. As a result, the current age is equal to the age of the customer.

set decision to the age of customer;

You can also use the set decision to <value> construct with the a copy of <object> where <attribute> is <value> construct to update the value of an existing variable. The following action creates a copy of the address of the customer and updates its value.

set 'new address' to a copy of the address of customer where the street is "Victor Hugo" ;