Everything within this section is only visible while editing. Use Page Properties ID "STUB", "REFACTURE", "PROGRESS", "rDEV", "rDOC", "rLANG" and "DONE". Everything contained within the table is displayed in the (INTERNAL) Reports page.
Resources & Remarks Modification History Add a new line to this table and fill it whenever you edit the page.
|
A system hook that extends a function call by an HTTP call under defined conditions. |
|
In order to insert an additional action into the process flow of a functional sequence, the ability for reacting to a function call is required. In yuuvis® Momentum, webhooks are a suitable option for this purpose. They belong to the system hooks and thus are triggered by function calls under specified conditions defined on their predicate
attribute.
A webhook extends the function by an HTTP call. Whenever the predicate
of a webhook delivers a t
rue
result, an optional HTTP call to a web URL defined in the webhook configuration is performed. The process flow is interrupted until the webhook activity is finished. Thus, the webhook can perform additional processing steps before passing the data back to resume the interrupted main process. If the predicate
of a webhook delivers a f
alse
result, the HTTP call is skipped.
Import and content update webhooks are called in the Repository service, all others in the API-gateway service.
Any changes to the webhook configuration require a restart of the services that are responsible for the call of the affected functions.
Depending on their type, webhooks are triggered in different situations within the data processing chain.
The webhook type dms.response.objects
can be triggered in various situations. For some of them there are special webhook types (dms.response.objects.insert
, dms.response.objects.update
, dms.response.objects.search
, dms.response.objects.delete
). These sub-webhooks are triggered directly after dms.response.objects
.
The predicate specifies the condition for the call of individual webhooks. It is declared in the webhook configuration.
If multiple webhooks are registered for the same webhook type, the predicate is applied to the original predicate target for each of them and in the order of definition. Imagine an example scenario with two registered webhooks of the type dms.response.objects.search
:
{ "enable": true, "predicate": "spel:true", "type": "dms.response.objects.search", "url": <suitable endpoint removing the property 'appEmail:bcc'>, "useDiscovery": true }, { "enable": true, "predicate": "spel:properties['appEmail:bcc']!=null", "type": "dms.response.objects.search", "url": <any suitable endpoint>, "useDiscovery": true } |
If objects in a search result have the appEmail:bcc
property and the first webhook removes this property from the objects, the predicate of the second webhook still matches.
The same behavior holds for the webhook type dms.response.objects
and one of its sub-webhook types dms.response.objects.*
:
{ "enable": true, "predicate": "spel:true", "type": "dms.response.objects", "url": <suitable endpoint removing the property 'appEmail:bcc'>, "useDiscovery": true }, { "enable": true, "predicate": "spel:properties['appEmail:bcc']!=null", "type": "dms.response.objects.search", "url": <any suitable endpoint>, "useDiscovery": true } |
As a type of system hooks, webhooks are configured in the \service-manager\config\system\systemHookConfiguration.json
configuration file within the service manager in JSON format. Any changes to the system hook configuration will not apply until the affected services have been restarted.
>> systemHookConfiguration.json
This article gave an overview of the webhook types that are available in yuuvis® Momentum. Check out the "Preprocessing Metadata using Webhooks" tutorial for an example application which shows different webhook types.
Read on
|