Event Service
Listen for messages from the system
Add Event Listener
javascript
eventService.onEvent(type, handler)Parameters
| Parameter | Type | Description |
|---|---|---|
| type | String | Event type |
| handler | Function | Listener 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
| Parameter | Type | Description |
|---|---|---|
| type | String | Event type |
| handler | Function | Listener 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
| Parameter | Type | Description |
|---|---|---|
| type | String | Event type |
| handler | Function | Listener 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
| Event | Event Parameters | Description |
|---|---|---|
| rpc-ready | None | Called when RPC connection is successfully established |
| rpc-reload | None | Called when RPC page is refreshed |
| automatic-event | payload Event content from automation AutomaticEvent | Message sent by automation |
| record-updated | Data table record Record | Custom component field, triggered after data table record changes |
| record-reload | Data table record Record | Custom component field, triggered by user refreshing form, automation "Refresh Record Form" and "Push Event to Client" steps |
| field-change | Changed field event FieldChangeEvent | Custom component field, triggered after data table field changes |
AutomaticEvent structure is as follows
| Parameter | Type | Description |
|---|---|---|
| type | String | Message type |
| content | Object | Message content |
FieldChangeEvent structure is as follows
| Parameter | Type | Description |
|---|---|---|
| field | Field | Changed field |
| record | Record | Record data after change |
RecordReloadEvent structure is as follows
| Parameter | Type | Description |
|---|---|---|
| type | String | Method that triggered the refresh |
| record | Record | Record data obtained after refresh |
RecordReloadEvent type list is as follows
| Value | Description |
|---|---|
| UserRefresh | Triggered when user clicks the form refresh button |
| Automatic.OutputRecordFormRefresh | Triggered by automation "Refresh Record Form" step |
| Automatic.SSERecordFormRefresh | Triggered by automation "Push Event to Client" step |
| RecordTaskListUpdate | When data table is bound to workflow Triggered by "Use existing record to create process" control |
| BpmnProcessChange | When 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" |
| BpmnTaskChange | When data table is bound to workflow 1. Triggered when workflow task status changes 2. Triggered by automation step "Workflow Change Event" |

