This section requires some knowledge about Eclipse Extension Points.
Why monitoring executions?
Monitoring executions allows developers to enhance the execution engine or to connect it to other tools. For instance, one could monitor executions in order to:
- show ongoing executions in an online dashboard,
- notify user by e-mail or Slack when an execution fails,
- update a database with the result of the execution.
Executions can be monitored by registering execution hooks.
How to register a new execution hook?
An execution hook can be registered by contributing a new
hook element to the
fr.kazejiyu.ekumi.core.execution extension point.
This element needs the following attributes:
|id||Uniquely identifies the hook|
|class||An instance of the
|name||Human-readable name displayed in UI|
|description||Details of what the hook does, displayed in UI|
|activated by default||(Optional) Indicates whether the hook should be notified by default|
When the user executes an activity, he can select the hooks that should be notified. The
activated by default attribute indicates whether the hook is selected by default. The following screenshot shows the Run Configuration tab that allows the user to select available hooks:
How to implement a new execution hook?
A new hook is implemented by creating a class that implements the
ExecutionHook interface. This interface provides a lot of methods to react on specific events but their default behavior is to do nothing so you can only override the ones you are interested in.
The following class defines a hook that prints messages when an execution starts, ends, and when an activity fails: