Versions Compared

Key

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

...

Code Block
languagejavascript
themeConfluence
if x > 5 then
  every {
    send_directive("Hello World!" + "This is my first message!");
    send_directive("Hello Again!" + "This is my second message!");
  }

This would place two notification boxes on the pagesend two directives from a single rule.

There is no limit to the number of actions that can be placed inside a compound action. While there is no linguistic restriction on mixing actions that send JavaScript and those that send directives, no current endpoint currentĀ event generator understands both directives and JavaScript, so that is not typically done.

...

Code Block
languagejavascript
themeConfluence
pre {
    some_var = "A"
}

choose some_var {
    A => send_directive("Hello World!" + "This is one message!");
    B => send_directive("Hello World!" + "This is another message!");
}

Notice that a variablebinding, some_var, has been inserted after choose. Any An identifier or any valid KRL expression enclosed in parentheses can follow choose. The expression will be evaluated and its value will be compared to the action labels (A or B) in the action list, and the actions associated with labels that match exactly will be taken. Action labels are identifiers for specific actions. If the value does not match any label, then no action is taken--as if the action statement were missing. Even though no action is taken, the rule will be considered to have fired.