Work with Rule Blocks
A rule document in a decision service or flow project is made up of plain text and rule blocks.
Rule blocks:
- can contain Boolean rules, calculation rules, table rules and object rules
- can contain comment text
- can contain blank lines
- can only contain rules for one object
Standard rule blocks have a grey header (as shown above), whereas custom function rule blocks have a brown header (as shown below).
Custom function rule blocks must at a minimum contain a rule that provides a "result" (the rule that will all be evaluated each time the custom function is called). For more information, see Add a Custom Function. To edit the custom function definition, click in the rule block (not header) to show the edit icon in the header.
Add an empty rule block
To add an empty rule block to a rule document:
- In the rule editor, on a blank line in the rule document (outside of a rule block), click the plus button in the margin.
- In the drop-down menu, select Empty rule block. An empty rule block is added to the line.

Add rules to a rule block
After you have added a rule block, you can add rules to it. To understand the different types of rules in decision service and flow projects, see Rule Types.
-
In the rule editor, on a blank line in the rule block, click the plus button in the margin.
-
In the drop-down menu, select one of the rule types. These are:
-
Boolean - for more information, see Add a Rule to Prove a Boolean
-
Calculation - for more information, see Add a Rule to Calculate a Value
-
Table - for more information, see Add a Table Rule
-
Object - for more information, see Populate a Set of Records Into a Record List
A rule template for that type of rule will be added to your rule block.
-
Tip: A comprehensive set of rule functions are available for use in decision service and flow projects. For more information, see Write Rules Using Functions and Function Reference (English).
Break out of a rule block
To break out of a rule block so that you can add some plain text or start a new rule block (for example, a rule block containing the rules for a different object):
- In the rule editor, on a blank line in the rule block, click the plus button in the margin.
- In the drop-down menu, select Break rule block. The cursor will move to a new line outside of the rule block.
Tip: If the last row of a rule block is a table row, you will need to break out of the table rule onto a new line in order to then break out of the rule block. To do this, put the cursor somewhere in the last row of the table and press Enter, then Enter again.
Select a rule block
To select a rule block (in order to delete it or move it):
- In the rule editor, click anywhere in the rule block.
- Click the menu button in the margin.
- In the drop-down menu, select Select rule block.
Delete a rule block
To delete a rule block:
- In the rule editor, select the rule block.
- Click Delete on your keyboard.
Add comment text in a rule block
Rule blocks can contain non-rule text, called comments. To add comment text to a rule block:
- In the rule editor, on a blank line in the rule block, click the plus button in the margin.
- In the drop-down menu, select Inline comment. An empty comment line is added to the rule block.
- Add the comment text to the line.

Tip: You can convert comment text into rule text. To do this, use the Enable margin menu option for the comment line in the rule block. And vice versa, you can convert rule text into comment text using the Change to inline comment margin menu option for the line in the rule. You can also add a task to the Tasks list for the project by preceding the comment text with "TO DO". For more information, see Add a Task to the Project.
Change the scope of the rule block
Each rule block can only contain rules for one object. The scope of the rule block is indicated in the heading of the rule block. This will show whether the rules in the rule block are going to be:
- Calculated once per case - that is, set the value of one or more top level fields and record lists, or
Calculated for each record of a particular object - that is, set the values of one or more fields and child record lists, for each of those object instances.
For more information, see Write Rules Using Objects and Write Rules with Object Level Scope.
A rule block can also be scoped to reference a custom function. These rule blocks have a header which shows that the rules in the rule block are going to be:
-
Calculated when the custom function is called, or
-
Calculated when the custom function is called, for each record of a particular object
Example of this are shown in the Split a Custom Function Across Rule Blocks topic.
To change the scope of the rule block:
- In the rule editor, click the down arrow in the rule block heading.
- In the drop-down menu, select the new scope.

The heading is updated to show the new scope of the rule block.