Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Remove unsupported options

...

Code Block
languagejavascript
themeConfluence
raise <domain> event <expr> [for <expr>] [with <modifier_clause> | attributes <expr>] 

The event name is given by the <expr>. The expression is evaluated and the resulting string is used as the event name.

Warning

Because the event name is an expression, you must use a string rather than using a bare word.

Attributes

...

.

...

Modifier Clause

The modifier clause allows the developer to add event parameters to the event. The right side of the individual bindings in the with clause can be any KRL expression. The modifier clause takes the following form:

Code Block
languagejavascript
themeConfluence
with <var> = <expr> [[and] <var> = <expr>]* 

Any variable in a modifier clause is used (with its associated value) as an event parameter.  

The following example illustrates this

Code Block
languagejavascript
themeConfluence
raise explicit event "foo" with a = "hello" b = 4 + x;

Attributes Clause

The attributes clause also allows the developer to add event attributes to the event. The expression that follows the attributes key word must evaluate to a map. The keys and values in the map will be used as event attributes. This is particularly useful when you want to pass through all, or most, of the attributes that the current rule received:

...

The for clause is followed by an expression that is evaluated to determine which rule sets should see the event. The result must be a string, giving the target ruleset ID or an array of target rulesets. A target ruleset ID has the form <rid[.<ver>]> where the optional version may be the keyword "prod" for the production ruleset or a version number for the explicit version. If the version is unspecifiedAt the moment, the system will match use the target version to the version of the current ruleset.

...

In the Sky Event API, explicit events will be raised to any ruleset that an entity has installed unless a for clause is present. You can specify the current ruleset using the using meta:rid() functions from  from the meta library.  Normally the API is determined by what API was used to raise the event that caused processing to commence. You can ensure that the behavior of explicit events will follow the Sky API behavior by specifying that the Sky API be used as follows:

...

languagejavascript
themeConfluence



Like any other postlude statement, explicit events can be guarded:

Code Block
languagejavascript
themeConfluence
raise explicit event "foo" attributes {
      with "a" =: "hello",
       "b" =: 4 + x
} if (flipper == "two");

The event in the preceding example will only be raised if the variable flipper has the value "two".

...