[2.4.1.155] Request: Simpler way to open and done all rules [C8P])

(Update 10 Apr 2025: It is highly recommended by everyone that you read through the whole of this thread before considering to use this feature.)

Is there a way I can open all Rules and have the Done button clicked? Can some obscure button or endpoint be created to have this done in the background for us, automatically or manually initiated? I'd be happy if only one rule was auto processed every 5-10 seconds as long as it's done in the background, especially after an update.

Use case: Over time, there are fixes to Rule Machine that require affected rules to be opened and either updated, or done. I have nearly 200 rules. Probably not as many as the other beta-test users here, but still quite a pain to process each rule manually. Of course, I could only open the affected rules, but there is no way I am going to remember if each rule has something affected without opening it, and after opening to check, blindly clicking done is simplest.

For example, the current fix in 2.4.1.155 threw errors in the log, so it was easy to identify 5 immediately affected rules that were important but not critical. However, I'm sure there are others that do not run as often, and I shouldn't wait for it to trigger to find out it didn't work.

5 Likes

Next release there will be a button in the parent Rule Machine app that does this.

23 Likes

Will there be an easy way to automate that with a rule triggered by restart?

Thank you!

Could it also be autotriggered by a HE firmware update that requires it? or will it be only a manual button?

Definitely not. This is not going to be something that should be done generally.

7 Likes

Definitely not.

4 Likes

I understand that this would interrupt any rules in a waiting state. So it should not be taken lightly. You would not want to run it unless necessary.

3 Likes

I have some questions in advance, on it's behavior.

  1. what will it do to a rule that is stopped? At a minimum it should ignore that rule, or ensure it stays turns off.
  2. What does it do to a rule that is not enabled? Some rules could be enabled and disabled by other rules. Currently, we have to enable the rule, click done, and then disable it again. These rules shouldn't be skipped, but should also ensure it remains disabled.

Both of these questions are based on process "done" being done manually. If the button process does things magically without affecting stopped or disabled, then these concerns are moot.

2 Likes

No, it shouldn't interrupt those rules. I haven't tested that case, but a pending Wait should still be pending after the update. This is not quite the same as hitting Update in a rule. Rules with Required Expression false won't be updated, as that would happen automatically when the RE goes true, and won't trigger until then. It won't unStop a Stopped rule either, or Resume a Paused rule.

My advice: when the Release Notes say that rules that were broken by a specific bug need Update or Done, do that -- don't do this.

Disabled rules will NOT be updated and will remain disabled.

I can confirm that pending Waits are not affected by doing this.

5 Likes

(Not trying to bite the hand that feeds me. :pray:t4:) Wouldn't this defeat the purpose of the button in my original request?

My advice is to follow my advice :man_shrugging:. Don't use the button. Update the rules as identified in the Release Notes.

2 Likes

Here is a good example: Release 2.4.1 Available - #7 by bcopeland

Per the Release Notes, only rules with overlapped use of Modes or HSM Status in Required Expression and a Trigger need to be updated.

2 Likes

Is there some potential harm that the button can cause?

I think the OP's concern might be shared by a lot of people. How do you know if any given rule needs to be updated without looking at it? Absent some superhuman memory, you either have to open each rule and look, or wait for something to go wrong (risking the all-important WAF).

I was just looking at the release notes for 154 and 155, thinking to myself "####". I have no idea whether I have any rules meeting those criteria or not. So, do I grab a few beers and spend the rest of my evening mindlessly opening every rule on every hub and clicking done? I'd almost rather write some javascript or a keyboard macro to do that. But then wouldn't that do the same thing as your button?

2 Likes

No, not at all. The button should be good to go, as described above. It hasn't been used on thousands of rules yet, so "should be good" is what it is. It hasn't been through beta.

The update process invoked in each rule is similar to what happens when a Required Expression goes from true, to false, to true again. In fact, that sequence will repair any rule that might need an update, and that sequence is not impaired by the bug just fixed (or the related one before that). The update process entails removing Trigger Event Subscriptions, then renewing them. This process does not include many rule initializations that happen when Update or Done is hit. Those omitted initializations would cancel Waits, Delays, etc, which you really don't want in some blanket do-all rules action.

If a rule has its Required Expression false, it is not updated, because it will be updated when the Required Expression becomes true.

6 Likes

Ah, ok. So your button fixes the case where trigger subscriptions need to be repaired, it's not a general-purpose update of the entire rule. Makes sense. Thanks for the explanation.

2 Likes

Thank you for the detailed explanation of the button.

In order to ensure I've understood, I will summarize the clarifications. Is this correct?

  1. The button WOULD fix trigger subscriptions (and future possible required expressions?) - it would fix the issues described in the release notes for 2.4.1.154 and 2.4.1.155. If there was a required expression that turned true in the future, the issue would resolve itself.

  2. The button WOULD NOT fix issues in the stay/wait issues described in the betas. Or in any other past issues that would be found in the Actions section.

No, all of those are fixed as well, except Actions. But that isn't needed at this point. All rules were updated when 2.4.1 was first installed. Only rules with issues are those identified in Release Notes for 155, 156 and later today 157. These are each very specific bugs that affect only certain rules. There is no situation where Release Notes instruct to hit Update or Done that the RM button won't repair it.

These are all bugs caused by broken or mistaken Event Subscriptions for triggers, in somewhat esoteric contexts that I missed earlier. Either Update button or the RM button causes all trigger Event Subscriptions to be re-established.

4 Likes

@hydro311, sorry, the original tag was a mistake. didn't realize we were out of beta.

@jtp10181, thank you for fixing the tag.

1 Like

Reading this thread it occurred to me that this is something I was unaware of - ie the potential necessity of going into each rule after a release. I too have about 200 rules. Some could be messed up and I might not readily know. Or am I misunderstanding the issue this change addresses?

You are correct, some releases have updates which fix specific issues and the instructions are to go into each rule impacted and click update/done to force them to update the subscriptions. If you are not sure which rules apply to the update notes then its hard to know which specific rules to update, unless you wait for something to break.