Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


StatusstatuscolourPriority
Page Properties
hidden
true
id
Yellow
titlePROGRESS
REFACTURE

Product Version2.4
Report Notepresentable
AssigneeAntje, Nils
Ressources

Resources & Remarks

Remarks

Concept article linking to the respecive tutorials

  • Antje: writing started

Modification History

NameDateProduct VersionAction
Antje08 FEB 20212.4New page properties macro.
Antje05 MAR 20212020 WinterNew interceptor type added.



Excerpt

Intervening a running process at a certain position and redirecting the process flow in order to include project-specific processing steps.

...

Section
bordertrue


Column

Table of Contents

Table of Contents
exclude(Table of Contents|Read on|Another Tutorial|Another Concept Article|Another interesting System Hooks|Preprocessing Metadata using Webhooks|Interceptor Example Tutorial)


Introduction

The interceptors allow for project-specific extensions of the yuuvis® Momentum standard process flows. The running process flow can be intervened in redirected by a condition set on the processed object , that has to be specified in the interceptor definition. Whenever the process flow satisfies meets the condition, the project-specific process extension is included for the currently processed object at this position of the process flow. The standard process is resumed subsequently.

Main part(s)

Subsection(s)

Code Block
languagejava
titleFor Loop in Java (brief, concise title)
linenumberstrue
for (int i = 0; i < 10; i++)
{
	System.out.println("Hello World " + i);
}

Summary

Thus, the alternative process can entirely replace the standard one from this position on or resume the standard process at a specified position.

Interceptor Configuration

The condition for the intervention of the process flow is defined in the interceptor configuration file \system\interceptorConfiguration.json.

Parameters

The following parameters are available for the interceptor configuration:

ParameterTypeRequiredDescription
typeStringyesThe type of the interceptor. It defines the position in the process flow where the interceptor can step in.
predicateStringyesThe condition that triggers the redirection of the process flow in order to include the project-specific process extension. The string can provide the condition either in Spring Expression Language (SpEL) or Javascript. Thus, the string always has to start with a prefix spel: for SpEL or js: for Javascript.
urlStringyesHTTP address of an external endpoint defining the project-specific process extension. Dynamic components (properties of the processed object) can be included in curly brackets.
useDiscoveryBooleannoDecides whether to resolve the url string at the Discovery-Service or not. If not specified, a default value is set.

Interceptor Types

There are different types of interceptors available that interrupt the process flow at different positions.

Interceptor type

Evaluation target of the predicateInterceptor input dataDescription
getContentAPI DMS object in JSON format derived from given objectIdobjectIdManipulation of the binary content of the return statement by a project-specific service
searchStructure of the specific class SearchInterceptorObjectSearch query objectManipulation of the search query parameter and the search result.
updateDmsObjectFirst API DMS object in the list in JSON format that is passed to the corresponding update endpointUpdated metadata and metadata of current versionManipulation of the update properties that will be applied to a DMS object.
dms.request.objects.upsert.database-beforeAll objects of the objects  list in the data part of the multipart body after enrichment.a multipart request bodyThe take-off point of the interceptor is after the REPOSITORY service. The initial request body is already normalized, validated and enriched with content stream properties.

Interceptor Configuration Example

The following example configures an interceptor that will be trigger by every update of a content (action code 301). At the take-off point after the REPOSITORY service, the enriched request body is passed to the external endpoint specified by url.

To activate this configuration, the REPOSITORY service needs to be restarted. 

Code Block
languageyml
titleExample interceptorConfiguration.json.
linenumberstrue
{
	"interceptors": [
		{
			"type": "dms.request.objects.upsert.database-before",
			"predicate": "spel:options['action']==301",
			"url": "http://exampleinterceptorcontentupdate/api/dms/objects/upsert",
			"useDiscovery": true
		}
	]
}

Summary

This article gave an overview of the interceptors in yuuvis® Momentum. If you want to extend the functionality of your system, system hooks also might be an interesting topic for you.


Info
iconfalse

Read on

Section


Column
width25%

Another Tutorial

...

Interceptor Example Tutorial

Insert excerpt
Interceptor Example Tutorial
Interceptor Example Tutorial
nopaneltrue
 Keep on reading


Column
width25%

...

Another Concept Article

...

System Hooks

Insert excerpt
System Hooks
System Hooks
nopaneltrue
 Keep on reading



Column
width25%

Another interesting Tutorial

...

Preprocessing Metadata using Webhooks

Insert excerpt
Preprocessing Metadata using Webhooks
Preprocessing Metadata using Webhooks
nopaneltrue
 Keep on reading