...
Page Properties | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Status
| status
| ||||||||||||||||||
Ressources
Resources & Remarks This article is intended just to provide context for the contained pages.
Modification History
|
Excerpt |
---|
Define additional actions triggered by specified events, extend the functionality of yuuvis® Momentum API. |
...
Section | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Introduction
System Hooks hooks are functions that apply to core functions of the yuuvis® Momentum API whenever certain conditions are met and that extend or modify those functions. As such, they serve as a modular, external approach for introducing new functionalities as extensions of already existing ones. There are two different types of System Hooks system hooks available: AMQP Hooks hooks as a pure messaging tool , and Webhooks webhooks with multiple possibilitiespossible applications.
System Hooks Types
The System Hooks hooks catch the call for a function under certain conditions in order to extend or modify the requested process. Thus, it is possible to externalize functional extensions or modularize components of the function call. In order to react to a function call under a certain condition, the latter is defined as a parameter for the corresponding System Hook system hook in its predicate
attribute. The set of conditions that need to be met in order for a System Hook system hook to activate are defined in a SpEL (Spring Expression Language) statement that needs to yield a True
result in order to trigger the System Hook.
System Hook Configuration
System Hooks 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.
System Hook Types
system hook.
Two different types of System Hooks system hooks can be used in yuuvis® Momentum , that support two different use cases. Both of them react to function calls under a specified condition defined in SpEL, but their behavior after activation is completely different.
AMQP Hooks
AMQP stands for Advanced Message Queuing Protocol 1.0, which is the encoding scheme the that AMQP Hooks hooks are working with. AMQP Hooks hooks are used to generate messages for the AMQP messaging systems whenever any relevant function is performed. They 're are instantiated using the URL and credentials for an existing messaging queue. The process flow itself is proceeding at the same time and can not cannot be modified with an AMQP Hookhook.
Any changes to the AMQP Hook hook configuration require a restart of the API-gateway service. More on AMQP Hooks hooks can be found here.
Webhooks
A Webhook webhook extends the a function by an HTTP call. Whenever the predicate
of a Webhook webhook delivers a True
result, an optional HTTP call to a web URL defined in the Webhook webhook configuration is performed. The process flow is interrupted until the Webhook webhook activity is finished. Thus, the Webhook 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 False
result, the HTTP call is skipped.
Any changes to the Webhook webhook configuration require a restart of the services , that are responsable for the call of the affected functions. More on Webhooks webhooks can be found here.
Configuring System
...
The following example configures both an AMQP Hook and a Webhook.
- The AMQP Hook applies to object imports and checks the
contentStreams
for the presence of arange
attribute. Should therange
attribute be detected, the AMQP Hook recognizes the imported content to be a compound document and initiates asynchronous text extraction of all the content parts. - The example Webhook activates at every login and retrieves the roles of the user trying to authenticate authorize (permissions)?.
To activate this configuration, both the API-gateway and the Authentication service need to be restarted.
...
title | Example System Hook Configuration |
---|
...
Hooks
System hooks 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
Summary
This article gave an introduction into the concept of System Hooks system hooks in yuuvis® Momentum. Detailed information on the two different types of System Hooks system hooks available can be found in the specific articles: "AMQP Hooks" and "Webhooks". An example configuration of Webhooks webhooks is shown in the "Preprocessing Metadata using Webhooks" tutorial.
...