Announcing Interceptions
The last piece of the puzzle is how to announce events. You will do so via the inherited super type method announce() that all your handlers,plugins and even the interceptors themselves have or via the interceptor service announce() method. This method accepts an incoming data struct which will be broadcasted alongside your event:
1
// Announce with no data
2
announce( "onExit" );
3
4
// Announce with data
5
announce( 'onLog', {
6
time = now(),
7
user = event.getValue( "user" ),
8
dataset = prc.dataSet
9
} );
10
11
// Announce via interceptor service
12
controller.getInterceptorService().announce( "onRecordInsert", {} );
Copied!
Hint Announcing events can also get some asynchronous love, read the Interceptor Asynchronicity for some asynchronous love.
Last modified 1yr ago
Copy link
Edit on GitHub