Skip to content

Event Service

Listen for messages from the system

Add Event Listener

javascript
eventService.onEvent(type, handler)

Parameters

ParameterTypeDescription
typeStringEvent type
handlerFunctionListener function

Example

javascript
// Listen for events from parent page
eventService.onEvent('automatic-event', (e) => {
    console.log(e)
})

Add One-Time Event Listener

javascript
eventService.onceEvent(type, handler)

Parameters

ParameterTypeDescription
typeStringEvent type
handlerFunctionListener function

Example

javascript
// Listen for events from parent page
eventService.onceEvent('rpc-ready', (e) => {
    console.log(e)
})

Remove Event Listener

javascript
eventService.offEvent(type, handler)

Parameters

ParameterTypeDescription
typeStringEvent type
handlerFunctionListener function

Example

javascript
// Listen for events from parent page
eventService.offEvent('automatic-event', (e) => {
    console.log(e)
})

TIP

You can send messages to website pages by calling the automation step Send Website Page Message.

List of Listenable Events

EventEvent ParametersDescription
rpc-readyNoneCalled when RPC connection is successfully established
rpc-reloadNoneCalled when RPC page is refreshed
automatic-eventpayload Event content from automation AutomaticEventMessage sent by automation
record-updatedData table record RecordCustom component field, triggered after data table record changes
record-reloadData table record RecordCustom component field, triggered by user refreshing form, automation "Refresh Record Form" and "Push Event to Client" steps
field-changeChanged field event FieldChangeEventCustom component field, triggered after data table field changes

AutomaticEvent structure is as follows

ParameterTypeDescription
typeStringMessage type
contentObjectMessage content

FieldChangeEvent structure is as follows

ParameterTypeDescription
fieldFieldChanged field
recordRecordRecord data after change

RecordReloadEvent structure is as follows

ParameterTypeDescription
typeStringMethod that triggered the refresh
recordRecordRecord data obtained after refresh

RecordReloadEvent type list is as follows

ValueDescription
UserRefreshTriggered when user clicks the form refresh button
Automatic.OutputRecordFormRefreshTriggered by automation "Refresh Record Form" step
Automatic.SSERecordFormRefreshTriggered by automation "Push Event to Client" step
RecordTaskListUpdateWhen data table is bound to workflow
Triggered by "Use existing record to create process" control
BpmnProcessChangeWhen data table is bound to workflow
1. Triggered by "Delete Process" control
2. Triggered by "Cancel Process" control
3. Triggered by automation step "Workflow Change Event"
BpmnTaskChangeWhen data table is bound to workflow
1. Triggered when workflow task status changes
2. Triggered by automation step "Workflow Change Event"