Configuration¶
- Integration Monitor
- Lime CRM Web Client Start Page
Integration Monitor¶
Create an Integration Monitor record for each integration that should be monitored and fill in the configuration parameters.
Lime CRM Web Client¶
Start Page¶
Go to Lime Admin > System > Start Pages
Below is an example of how the config could look for one integration. The config parameter should match the integration key of the Integration Monitor.
[
{
"components": [
{
"props": {
"config": "erp_integration"
},
"name": "lwc-limepkg-integration-monitor-integration-monitor-alert-container",
"size": "square-big"
}
],
"name": "Default",
"id": "_default"
}
]
View Configuration¶
The following needs to be added to the views in the Web Client.
Integration Monitor¶
{
"general": {
"primaryTitle": [
{
"property": "name"
}
],
"icon": "monitor",
"color": "#333cb8",
"create": true,
"enableGlobalSearch": true,
"globalTablesMenu": true,
"inlineCreate": false,
"bulkDeleteObjects": false,
"views": [
{
"title": "webclient.limeobject.table-view",
"icon": "insert_table",
"view": {
"name": "limec-table-view",
"props": {}
}
},
{
"title": "webclient.limeobject.list-view",
"icon": "activity_feed_2",
"view": {
"name": "limec-list-view",
"props": {}
}
}
],
"variant": {}
},
"card": {
"sections": [
{
"title": "untitled",
"collapsed": false,
"visible": true,
"visibleOnCreate": true,
"layout": {
"columns": 5,
"dense": true
},
"controls": [
{
"property": "name",
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "integration_key",
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "type",
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "active",
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "alertstatus",
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "alerttext",
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "alert_timestamp",
"format": "datetime",
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "alert_interval",
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "alert_no_updates_deceeds",
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "alert_no_creates_deceeds",
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "alert_no_deletes_deceeds",
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
}
]
}
],
"relations": [
{
"property": "integration_monitor_batch"
},
{
"property": "integration_monitor_log"
}
]
},
"list": {
"header": [
{
"property": "name"
}
],
"subheader": [
{
"property": "type"
},
{
"property": "integration_key"
},
{
"property": "active"
},
{
"property": "alertstatus"
},
{
"property": "alerttext"
},
{
"property": "alert_timestamp"
},
{
"property": "alert_interval"
},
{
"property": "alert_no_updates_deceeds"
},
{
"property": "alert_no_creates_deceeds"
},
{
"property": "alert_no_deletes_deceeds"
}
]
},
"search": {
"header": [
{
"property": "name"
}
],
"subheader": [
{
"property": "integration_key"
},
{
"property": "type"
}
]
},
"table": {
"columns": [
{
"property": "name",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "integration_key",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "type",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "active",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "alert_interval",
"isDefault": false,
"component": {
"props": {}
}
},
{
"property": "alert_no_creates_deceeds",
"isDefault": false,
"component": {
"props": {}
}
},
{
"property": "alert_no_updates_deceeds",
"isDefault": false,
"component": {
"props": {}
}
},
{
"property": "alert_no_deletes_deceeds",
"isDefault": false,
"component": {
"props": {}
}
},
{
"property": "alert_timestamp",
"isDefault": false,
"component": {
"props": {}
}
},
{
"property": "alertstatus",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "alerttext",
"isDefault": false,
"component": {
"props": {}
}
},
{
"property": "id",
"isDefault": false,
"component": {
"props": {}
}
},
{
"property": "createdtime",
"isDefault": false,
"component": {
"props": {}
}
},
{
"property": "timestamp",
"isDefault": false,
"component": {
"props": {}
}
}
]
}
}
Integration Monitor Batch¶
{
"general": {
"primaryTitle": [
{
"property": "integration_monitor"
}
],
"icon": "inspection",
"color": "#b6d0e0",
"create": false,
"inlineCreate": false,
"bulkDeleteObjects": false,
"views": [
{
"title": "webclient.limeobject.table-view",
"icon": "insert_table",
"view": {
"name": "limec-table-view",
"props": {}
}
},
{
"title": "webclient.limeobject.list-view",
"icon": "activity_feed_2",
"view": {
"name": "limec-list-view",
"props": {}
}
}
],
"variant": {}
},
"card": {
"sections": [
{
"title": "untitled",
"collapsed": false,
"visible": true,
"visibleOnCreate": true,
"layout": {
"columns": 5,
"dense": true
},
"controls": [
{
"property": "integration_monitor",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"query": {
"filter": {}
},
"component": {
"props": {}
}
},
{
"property": "logstatus",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "integrationid",
"readonly": true,
"required": false,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "logtext",
"readonly": true,
"required": false,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "starttime",
"format": "datetime",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "endtime",
"format": "datetime",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "duration",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "no_created",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "no_updated",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "no_deleted",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "errormsg",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
}
]
}
],
"relations": [
{
"property": "integration_monitor_log"
}
]
},
"list": {
"header": [
{
"property": "integration_monitor"
}
],
"subheader": [
{
"property": "logstatus"
},
{
"property": "integrationid"
},
{
"property": "logtext"
},
{
"property": "starttime",
"format": "datetime"
},
{
"property": "endtime",
"format": "datetime"
},
{
"property": "duration"
}
]
},
"search": {
"header": [
{
"property": "integration_monitor"
}
],
"subheader": [
{
"property": "logstatus"
},
{
"property": "integrationid"
},
{
"property": "logtext"
},
{
"property": "starttime",
"format": "datetime"
},
{
"property": "endtime",
"format": "datetime"
},
{
"property": "duration"
}
]
},
"table": {
"columns": [
{
"property": "integration_monitor.name",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "logstatus",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "integrationid",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "logtext",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "starttime",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "endtime",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "duration",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "no_created",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "no_updated",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "no_deleted",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "errormsg",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "id",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "createdtime",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "timestamp",
"isDefault": true,
"component": {
"props": {}
}
}
]
}
}
Integration Monitor Log¶
{
"general": {
"primaryTitle": [
{
"property": "integration_monitor"
},
{
"property": "integration_monitor_batch"
}
],
"icon": "tasklist",
"color": "#80a4ff",
"create": false,
"inlineCreate": false,
"bulkDeleteObjects": false,
"views": [
{
"title": "webclient.limeobject.table-view",
"icon": "insert_table",
"view": {
"name": "limec-table-view",
"props": {}
}
},
{
"title": "webclient.limeobject.list-view",
"icon": "activity_feed_2",
"view": {
"name": "limec-list-view",
"props": {}
}
}
],
"variant": {}
},
"card": {
"sections": [
{
"title": "untitled",
"collapsed": false,
"visible": true,
"visibleOnCreate": true,
"layout": {
"columns": 5,
"dense": true
},
"controls": [
{
"property": "integration_monitor",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"query": {
"filter": {}
},
"component": {
"props": {}
}
},
{
"property": "integration_monitor_batch",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"query": {
"filter": {}
},
"component": {
"props": {}
}
},
{
"property": "logstatus",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "logtext",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "message",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "errormsg",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
},
{
"property": "integrationid",
"readonly": true,
"visible": true,
"visibleOnCreate": true,
"layout": {},
"component": {
"props": {}
}
}
]
}
]
},
"list": {
"header": [
{
"property": "integration_monitor"
}
],
"subheader": [
{
"property": "integration_monitor_batch"
},
{
"property": "logstatus"
},
{
"property": "logtext"
},
{
"property": "message"
},
{
"property": "errormsg"
},
{
"property": "integrationid"
}
]
},
"search": {
"header": [
{
"property": "integration_monitor"
}
],
"subheader": [
{
"property": "integration_monitor_batch"
},
{
"property": "logstatus"
},
{
"property": "logtext"
},
{
"property": "message"
},
{
"property": "errormsg"
},
{
"property": "integrationid"
}
]
},
"table": {
"columns": [
{
"property": "integration_monitor.name",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "integration_monitor_batch.logstatus",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "logstatus",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "integrationid",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "logtext",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "errormsg",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "message",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "id",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "createdtime",
"isDefault": true,
"component": {
"props": {}
}
},
{
"property": "timestamp",
"isDefault": true,
"component": {
"props": {}
}
}
]
}
}
Webhook usage¶
Webhooks make it possible to create a subscription from an external system to events in Lime CRM. This package contains custom events which makes it possible to subscribe to events for a specific integration (webhooks created for a specific integration_key
).
- Run
poetry add lime-webhooks
to add the package as a dependency in your solution'spyproject.toml
file. - Add code to custom limeobjects to send notifications about new/updated objects (see examples below).
- Add code to your solution to register custom events to Lime Webhooks. See example below.
- Build and deploy your solution.
- Only for on premise: Restart Lime CRM services (
Web server
andEvent Handler
). - Configurate the webhook(s). See documentation for Lime Webhooks.
Code examples¶
Code Example (limeobject integration_monitor
)¶
from lime_type.limeobjects import LimeObject
from limepkg_integration_monitor.events import events as im_events
class IntegrationMonitor(LimeObject):
def after_update(self, unsaved_self, **kwargs):
super().after_update(unsaved_self, **kwargs)
im_events.publish_integration_monitor_event(
self, unsaved_self)
def register_limeobject_classes(register_class):
register_class('integration_monitor', IntegrationMonitor)
Code Example (limeobject integration_monitor_batch
)¶
from lime_type.limeobjects import LimeObject
from limepkg_integration_monitor.events import events as im_events
class IntegrationMonitorBatch(LimeObject):
def after_update(self, unsaved_self, **kwargs):
super().after_update(unsaved_self, **kwargs)
im_events.publish_integration_monitor_batch_event(
self, unsaved_self)
def register_limeobject_classes(register_class):
register_class('integration_monitor_batch', IntegrationMonitorBatch)
Code Example (limeobject integration_monitor_log
)¶
from lime_type.limeobjects import LimeObject
from limepkg_integration_monitor.events import events as im_events
class IntegrationMonitorLog(LimeObject):
def after_update(self, unsaved_self, **kwargs):
super().after_update(unsaved_self, **kwargs)
im_events.publish_integration_monitor_log_event(
self, unsaved_self)
def register_limeobject_classes(register_class):
register_class('integration_monitor_log', IntegrationMonitorLog)
Code examples to register custom events¶
In this case we add it into the the customer's solution __init__.py
. Replace xxx with the customer's name.
Add nodes for the events that you want your solution to publish, meaning the combinations of limetypes+integration_key events that you want to be able to register webhooks for.
xxx_events = {
'limeobject_events': [
{
'name': '<integration_key>',
'limetype': 'integration_monitor_batch',
'events': ['new', 'update']
}
]
}
Set up the entry point in your poetry based pyproject.toml
as:
[tool.poetry.plugins."lime.webhooks.events"]
"xxx-events" = 'solution_xxx:xxx_events'