
Subsets of Rules
Use
You can simplify complex
set of rules by splitting them into main sets and subsets of rules. This process creates smaller encapsulated units that can be edited more easily.Features
The subsets of rules are called from the main set of rules. The main set of rules passes the contents of the
facts, records, and compositions to the subset of rules. The subset of rules executes and then passes the newly calculated facts, records, and compositions back to the main set of rules.
Data is exchanged only between the main set of rules and the subset of rules. Subsets of rules do not read data directly from the specification database. Therefore no mapping database is required for sets of rules that serve exclusively as subsets of rules.
A subset of rules is called using the CALL
command. The CALL command in its simplest form appears as follows:|
CALL "<RULE_NAME>" |
|
END |

The system identifies the subset of rules by means of its <RULE_NAME>. It is important, therefore, that you register the subsets of rules. For more information, see the documentation on the IMG activity Interfaces ® EH&S Expert ® Set Up Windows Registry in Customizing for Product Safety.
In the above case, the input facts, records, and compositions of the subset of rules are read by facts, records, and compositions of the main set of rules with the same names, and the output facts, records, and compositions of the subset of rules are returned to facts, records, and compositions of the main set of rules with the same names. This is not always possible or desirable. To match up different names of facts, records, and compositions in main and subsets of rules and to meet other requirements that arise, the CALL command has an optional extended syntax shown and explained below.
CALL Command Syntax
|
CALL "<RULE_NAME>" |
||||
|
WITH <NAME> AS MAIN |
||||
|
MAP |
||||
|
<NAME_MAIN> AS <NAME_SUB>, |
||||
|
RECORD <NAME_MAIN> AS <NAME_SUB> |
||||
|
<NAME_MAIN> AS <NAME_SUB> |
||||
|
END, |
||||
|
Composition <NAME_MAIN> AS <NAME_SUB> |
||||
|
<NAME_MAIN> AS <NAME_SUB>, |
||||
|
RECORD <NAME_MAIN> AS <NAME_SUB> |
||||
|
<NAME_MAIN> AS <NAME_SUB> |
||||
|
END |
||||
|
END |
||||
|
END |
||||
|
PHRASEMAP |
||||
|
"TEXT_MAIN" AS "TEXT_SUB", |
||||
|
"TEXT_MAIN" AS "TEXT_SUB" |
||||
|
END |
||||
|
END |
||||

You can enter the complex syntax of the CALL command in the rule editor in the multiline editing window List of Todos. To set this editing window, under Tools ® Options on the Edit tab page select the field Use Multiline Edit Box for To Do's.
In the MAP section below, this means that facts of the specified record or facts and records of the specified composition can appear exclusively on the left-hand side of a MAP assignment. With WITH <NAME> AS MAIN it is only possible to pass facts, records, or compositions to the subset of rules if they are assigned to the specified record or composition.
The simplest entry is <NAME_MAIN> AS <NAME_SUB>, where the left-hand side relates to the main set of rules and the right-hand side to the subset of rules. Records and compositions can also be assigned. For the correct syntax, refer to the above example. Within an assigned record or composition, an assignment of the facts by means of identical names also applies if no explicit assignments were made.

If the system cannot find the respective assignments, it uses the original names.
Note
Writing data back to the main set of rules is done as follows: