Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: relax paren requirement a bit

...

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 binding, 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.