Definition
IF-THEN clause that performs all the activities in the THEN part if the condition in the IF part is true.
Use
Rules allow relationships to be established between the defined
facts in the set of rules in the EH&S Expert and allow data to be derived.Structure
IF Part
You can formulate any conditions in the IF part of the rule. These conditions usually have the following form:
<Fact> |
<Operator> |
<Expression> |
The IF part of a rule can also contain functions. Using the ANY function you can query whether a fact that consists of a number of elements contains a particular expression. You can, for example, determine whether a characteristic that is assigned several R phrases contains one particular R phrase.
IF ANY (<Fact>) = <Expression> |
By including the following condition in the IF part, a rule always performs an activity in the THEN part, provided the facts in the THEN part do not equal zero. See also:
When Is a Rule Executed?
TRUE() |
THEN Part
The activities that can be found in the THEN part of a rule (ToDos) have one of the following forms:
· |
<Fact to be modified> |
<Operator> |
<Expression> |
||
· |
|
<Command> |
(<Expression>) |
The activities can be divided into the following types:
For more information, see
Operators, Commands, and Functions.Rule File
The rules can be found in the rule file in a section that is introduced with the keyword
RULES and concluded with the keyword END . This section follows the facts section. All rules begin with RULE <Rule name> and are concluded with END . The individual conditions in the IF part and activities in the THEN part are separated by commas. The IF part of the rule is equivalent to an AND operation.The following rule sets an R phrase for the case where the flash point is in a certain range:
RULE RULE1 | |||
IF | |||
Flash point > 21, | |||
Flash point < 55 | |||
THEN | |||
Rphrase := "R10" | |||
END |
If you create a set of rules using the rule editor, the editor generates a rule file with the correct syntax automatically.
The example clearly shows that facts are used in the rules without the user having to specify any data types (such as text or integer). All facts can adopt all data types. If required, the data is converted automatically.
For data types Text, Number, List, and Range used internally and in assignments, see Fact.
The order in which you enter the rules is not relevant. The EH&S Expert automatically ensures that the rules are executed in the correct order (see When Is a Rule Executed?).