Modules > Custom modules / Events handling in custom modules

Events handling in custom modules

You can configure the handling of various system events in a custom module.

Event handler triggers a specific action in the system after an event has occurred. It can be useful when creating complex modules. For example, a handler can start a business process configured within a module when you have changed some fields in an app item.

You can adjust a handler to start a script or a business process, or to send a message about the occurred event to an external microservice.

начало внимание

The Send message to service activity is available only in ELMA365 on-premises.

конец внимание

To add an event handler:

  1. Go to Administration > Modules.
  2. Hover the mouse over the module and click the gear icon.
  3. Go to the Event handling tab.
  4. Click +Handler and enter the information in the window that opens.

event-handling-1

  • Name*. Enter a name for the handler.
  • Event domain*. Select an area where the handler will monitor the events:
    • All events;
    • App items;
    • Apps;
    • Files;
    • Directories
    • Modules;
    • Settings;
    • Users.

начало внимание

The Files domain is available only in ELMA365 on-premises.

конец внимание

  • Event*. Select an event after which the handler will be launched. We have listed the events available for each domain below.
  • Handler type*. Select an activity which will occur after each event.
    • Run script. Executes the generated script;
    • Run process. Executes the business process created in the module;
    • Send message to service. Sends a messages to an external microservice. This activity is available only in ELMA365 on-premises.

начало внимание

Only processes and scripts created as part of a module can be bound to a handler.

конец внимание

  1. Click the Save button.
  1. In the window that opens select a required process, script or microservice.

event-handling-2

  1. To finish the configuration, click Save and Publish.

Available events

Each event domain has its list of events, after which the handler will be launched.

For the All events domain:

  • All system events.

For the App item domain:

  • Add comment to app item;
  • Change app item status;
  • Create app item;
  • Delete app item;
  • Update app item.

For the Apps domain:

  • App data export;
  • App data import.

For the Files domain:

  • Add a comment to the file;
  • Create file;
  • Delete file;
  • Change access permissions for the file;
  • Modify file.

For the Directories domain:

  • Create directory;
  • Delete directory;
  • Change access permissions for the directory;
  • Modify directory.

For the Modules domain:

  • Disable module;
  • Enable module;
  • Install module;
  • Update module.

For the Settings domain:

  • Change additional parameters.

For the Users domain:

  • Authorization failed;
  • Authorization success;
  • Authentication failed;
  • Authentication success;
  • Sign out.

Cancel a handler

To disable a handler, go to the Event handling tab, click on the three dots icon and select the Cancel publication option. Now, the handler will not be launched after the execution of an event.

You can also delete a handler. To do this, go to the Event handling tab, check the box next to the handler name and click the Delete button in the upper right corner of the page.

event-handling-3

Found a typo? Highlight the text, press ctrl + enter and notify us