Search…
Triggers
Triggers can be setup to run before and/or after creation, update, and deletion of object instances, as well as before and after session authentications (to allow for custom authentication mechanisms).
1
class Triggered {
2
3
@trigger('create.before', 'create.after', {
4
name: 'c_object_with_prop',
5
active: true,
6
principal: 'c_ok',
7
environment: 'production',
8
weight: 0.7
9
})
10
check({ memo, context, old, new, dryRun, inline, event, runtime }) {
11
console.log('checking')
12
}
13
14
@trigger('axon__task.completed.before')
15
beforeAxonTaskCompleted( { context } ) {
16
17
return context.read('c_require_this_field_to_be_true') === true
18
19
}
20
21
static bakeMeACake() {
22
23
return true
24
25
}
26
27
}
Copied!
Last modified 1mo ago
Copy link