I assume using logical equations in Groovy is a real time execution but I have to be 100% sure this is true. For insdtance, in statement like this:
if ((a == true) and (b == true)) then
{
c = true;
}
my good guess, the IF expression will be evaluated right at a time of the C assignment.
I am asking this question because in RM "Use the Required Expression" stament, used for gating unwanted Trggers is too far from being real time. Another words, the evaluation of the Required Expression in RM is not done at time when Trigger Event happens. This results in ether getting unwanted Trigger or missing wanted one and rule behavior becomes unexpected.
The upcoming changes to the RM (removig "do not trigger while running" option) finally pushing me to start coding in Groovy. I am thinking about creating Virtual Trigger custom driver. Pretty much this should be something like the existing Virtual Switch but must be automatically Reset while hub is rebooting and ideally should/must have a real time customizable gating logic. The Virtual Trigger will be set by customizable existing hub triggers but will be reset by very last rule action.
As of now I am aready using Virtual Switch as rule trigger. This approach works very well for preventing unwanted triggers (much better than using PB) but because VS resets by the rule itself the Required Expression and Conditional Trigger options cannot be used. I hope, my Virtual Trigger custom driver will solve rule triggering related problems.