Documentation Index
Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The general flow of sending custom events to your connected server is as follows:- You create your own event, or utilize our pre-configured events.
- In Atoti Limits, you trigger sending the event using
the
IServerEventIssuerService::sendServerEventmethod. - In your connected server, the auto-configured
LimitsEventListenerRestServicereceives the event and broadcasts it to your connected server. - Any Spring Event Listeners you have registered in your connected server for the event will invoke some action in the connected server.
Implementation
The following steps are used to send events from Atoti Limits to your connected server.1. Define your event
You must define your event to be picked up within your connected server. Your event must implementILimitApplicationEvent and be imported as a Spring Bean in your configuration. We
recommend that implementations extend ADefaultLimitApplicationEvent. A sample event looks as follows:
The
EventObject class’s source field is marked as transient. To correctly derserialize
your custom event it is important that you override the getter for this field and mark it as
ignored (via @JsonIgnore).2. Send your event from Atoti Limits to your connected server
This is done by invoking the Spring service methodIServerEventIssuerService::sendServerEvent
at any point in the Atoti Limits code.
For pre-configured events, Atoti Limits sends
the events at the appropriate point in time. For custom events, you need to override the
Atoti Limits code via Spring in order to send the events at the required time. For example, if
you wanted to send your custom event when an evaluation request has completed, you can add custom evaluation logic
to send the event as follows:
3. Listen for your event in your connected server
Add a Spring@EventListener method in your connected server to listen
for the events sent by Atoti Limits. From here, you can invoke actions in your connected server that are
dependent on events that have been triggered in Atoti Limits.
For pre-configured events, you may implement your own IEventListenerService, which already has
methods enabled to listen for the events Atoti Limits sends. To override existing logic Atoti Limits triggers, create an implementation that extends DefaultEventListenerService, for example:
Pre-configured events
The following events are bundled in Atoti Limits, which you may listen for in your connected server:| Event | Description |
|---|---|
LimitsCreatedEvent | Sent when limits are created. |
LimitsUpdatedEvent | Sent when limits are updated. |
LimitsDeletedEvent | Sent when limits are deleted. |
LimitsKpiUpdatedEvent | Sent when KPIs are refreshed. |