Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

KRL uses the "event condition action" pattern. Since there is only space for a single Boolean expression in the condition, KRL adds a prelude section in which preparatory computations can be done. It fits in between the event and condition, setting things up for the conditional action. The prelude begins in line 3 in the rule template shown below. 

Code Block
languagejs
themeConfluence
linenumberstrue
rule test {
  select when sensor heartbeat
  pre {
    ...
  }
  if condition_is_true then {
    send_directive("Heartbeat")
  }
  fired {
    ...
  } else {
    ...
  } 
}

...