For the complete documentation index, see llms.txt. This page is also available as Markdown.

On

User events are overridden by name and weight, sorted by weight (desc) and must be namespaced.

class Foo {

  @on('axon__task.completed',  {   
    environment: 'development',   
  })
  static check(...params, runtime) {
    const {
      weight, 
      source,   // "script" or "event" 
      metadata,
      event,   
      context   // the event document, when fired by a user event.
    } = runtime

    console.log('checking')
  }

}

script.fire(event, ...params)

Execute events registered with @on in the same script context as the current principal.

Arguments

  • event { String[] } The custom event name. eg. axon__task.completed.before

  • ...params { *[] } Options object to pass to script.arguments

@on(event, options)

Arguments

  • event { String } Event

  • options { Object } Options object

    • active { Boolean = true }

    • name { String }

    • label { String }

    • environment { String = "*" }

    • if { Expression }

    • weight { Number = 0 }

Examples

Last updated

Was this helpful?