> For the complete documentation index, see [llms.txt](https://docs.medable.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.medable.com/cortex-api/expressions/on.md).

# On

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

```javascript
const { on } = require('decorators')

class Handler {

  @on('axon__task.completed', { name: 'axon__task_completed_event' })
  onCompleted( task, str ) {
    // str === "another param"
  }

}

const task = completeATask()
script.fire('axon__task.completed', task, "another param")
```
