Hi Ben,
Basically, we figured that what is in the Playbook Designer Guide (Configure Rules, p 23) means that that rule would be triggered again anyway upon change of the value of one of the fields in the conditions :
A rule is evaluated when there is a change to an instance of an object, which is of the type specified in the
rule's object type. When a rule is evaluated, its conditions are checked, and if satisfied, the rule is invoked.
Rules are re-evaluated and can be invoked again when a rule creates a new object or changes the state of
an object. To guard against infinite loops, the Resilient platform limits the rule creation of new objects to
500 while processing rules.
But as I understand it now, a rule
that evaluates to "TRUE" is only evaluated once during a single "loop" triggered by an object change.
Thanks for this clarification, it was not what we expected.
Does this mean that a rule that evaluated to "FALSE" and is
ordered before a second one that changes fields so the conditions of the first one would evaluate to "TRUE" will be re-evaluated ?
Or would it need a new object or change in the state of an existing object anyway?
- and what is meant by change in state (
created, deleted, row inserted, row deleted, .... OK) but what is "changed" ?
Both the "single" evaluation
and the aspect of the ordering of rules was not that clear from the documentation we used.
---------------------
EDIT: I did find the text relating to order of rules ;)
Order. Automatic rules have numbers, which denotes the order in which the rules run when a condition invokes multiple rules. The ordering can be important especially when different rules affect the same fields, or changes made by one rule impact another rule. You can change the order by dragging the rules. Menu Item rules do not have numbers since they run only when a user invokes them.
-------------------------
We did solve our problem though (see my answer to Brenden)
Thnaks
------------------------------
Guido Janssens
------------------------------
Original Message:
Sent: Wed July 15, 2020 09:11 AM
From: Ben Lurie
Subject: In-rule actions on Set Field triggered only once?
A rule whose conditions evaluate to "true" is only ever run once. This is by design to prevent infinite loops and unexpected behavior. As Brendan mentioned below if you need rules to run in a certain order, that is what the Rule ordering is for.
Ben
------------------------------
Ben Lurie
Original Message:
Sent: Tue July 14, 2020 04:40 AM
From: Guido Janssens
Subject: In-rule actions on Set Field triggered only once?
We have a rule that triggers on following conditions:
ANY of ("Impact is changed", "Urgency is Changed", "Incident is created")
The only activity of this rule is to run a script "Set Classification" that calculates a classification based upon the values in Urgency and Impact
This rule runs for all incidents and runs correctly.
We have another rule that triggers on a specific CASE TYPE (the only condition)
The ordered activities are
- adding a number of tasks
- setting a number of field values ....
- setting Field value for Urgency to a value
- setting Field value for Impact to a value
However, when the CASE TYPE is such that this rule is triggered, the first rule does not trigger again, although the values for Urgency and Impact are changed by the second one.
if I add the action "run script Set Classification" to the ordered activities, it calculates well.
Does anyone has a clue why the first rule would not trigger again after the second one has updated fields Urgency and Impact ??
------------------------------
Guido Janssens
------------------------------