Versions Compared

Key

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

...

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 valid KRL expression 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.