Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: yet another common error

...

However any rules selected by a raised event are added at the end of the schedule. So, in this case, the rules actually evaluate in this order: 

  1. check_for_new_month

  2. record_probe_temp_to_sheet

  3. set_up_url (for first reading of new month)

because the first two listed were added to the schedule when the event came in, while the third was only added to the schedule later during the evaluation of the first. So the first reading of a new month went to the old URL and subsequent readings for that month went to the new one.

...

This cautionary tale was inspired by this commit which followed an emergency fix to manually restore ent:apps to a value that had accumulated over time between the first installation of a ruleset into a pico and a second, ill-advised, installation months later.

Using regular expressions with multi-line strings

It is possible in the select when clause of a rule to check for the existence of event attributes by name, matching them against a regular expression and binding the value to a name (see the page Capturing Values).

However, when the value matched is a string, only the first line of that string will be retained. See this commit for an example of working around this.