Rule actions

Rule actions define what to do when the if part of the rule is true or false.

You define actions in the then and else parts of a rule. A rule action consists of at least one action phrase that the rule executes when the if part of the rule is true. It can also contain action phrases to execute when the if part of the rule is false.

You define actions in the following parts of a rule:

The then part of a rule must define at least one action. If the then or else part contains multiple actions, the rule executes the actions in their listed order.

Example of the then part

The following rule applies a discount of 15% only when the value of the shopping cart is more than $100, otherwise the rule applies no action.

if 
	the value of the shopping cart is more than $100 
then 
	apply a 15% discount on the shopping cart; 

Example of the else part

The following rule applies a change when the conditions are met (then), or a different change when the conditions are not met (else):

if 
	'the loan report' is approved 
	and the loan grade in 'the loan report' is one of { "A", "B", "C" } 
then 
	in 'the loan report', accept the loan with the message "Congratulations! Your loan has been approved"; 
else 
	in 'the loan report', refuse the loan with the message "We are sorry. Your loan has not been approved";