[configuration/rules-dsl.md] Textual Rules -> Rule Name Uniqueness (#627)
* Textual Rules -> Rule Name Uniqueness Add information on requirement for uniqueness of rule names. Signed-off-by: Garry Mitchell garrymitchell@my105e.com (github: ConfusedTA) * Textual Rules -> Rule Name Uniqueness Amended per suggestions to include rule details as a list, tweak of wording, and amendment of sample rules to follow suggestion of wrapping quotes around rule names. Signed-off-by: Garry Mitchell garrymitchell@my105e.com (github: ConfusedTA) * Textual Rules -> Rule Name Uniqueness Amend rule syntax, make syntax sections into a list. Signed-off-by: Garry Mitchell garrymitchell@my105e.com (github: ConfusedTA) * Textual Rules -> Rule Name Uniqueness Updated based upon suggestions to further clarify points. Signed-off-by: Garry Mitchell garrymitchell@my105e.com (github: ConfusedTA) * Update rules-dsl.mdpull/631/head
parent
0c65337b94
commit
5597733082
|
@ -90,19 +90,17 @@ The **Rules** section contains a list of rules.
|
||||||
Each rule has the following syntax:
|
Each rule has the following syntax:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
rule "rule name"
|
rule "<RULE_NAME>"
|
||||||
when
|
when
|
||||||
<TRIGGER CONDITION1> or
|
<TRIGGER_CONDITION> [or <TRIGGER_CONDITION2> [or ...]]
|
||||||
<TRIGGER_CONDITION2> or
|
|
||||||
<TRIGGER_CONDITION3>
|
|
||||||
...
|
|
||||||
then
|
then
|
||||||
<SCRIPT_BLOCK>
|
<SCRIPT_BLOCK>
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
A rule can have any number of trigger conditions, but must at least have one.
|
- `<RULE_NAME>` - Each rule must have a unique name (given within quotes). It is recommended that you choose a name that has meaning when spoken.
|
||||||
The `SCRIPT_BLOCK` contains the code that should be executed, when a trigger condition is met, see the [script](#scripts) section for details on its syntax.
|
- `<TRIGGER_CONDITION>` - The triggering event upon which the rule logic is executed. A rule is executed in reaction to one or more trigger conditions. Multiple conditions are separated by the keyword `or`. Please see below for different possible triggers.
|
||||||
|
- `<SCRIPT_BLOCK>` - Contains the logic that should be executed when a trigger condition is met, see the [script](#scripts) section for details on its syntax.
|
||||||
|
|
||||||
{: #rule-triggers}
|
{: #rule-triggers}
|
||||||
### Rule Triggers
|
### Rule Triggers
|
||||||
|
@ -734,7 +732,7 @@ var Number counter
|
||||||
|
|
||||||
// setting the counter to some initial value
|
// setting the counter to some initial value
|
||||||
// we could have done this in the variable declaration already
|
// we could have done this in the variable declaration already
|
||||||
rule Startup
|
rule "Startup"
|
||||||
when
|
when
|
||||||
System started
|
System started
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in New Issue