interceptorConfiguration.json

The condition for the intervention of the process flow is defined in the interceptor configuration file.

Characteristics

Profile NameinterceptorConfiguration.json
Referenced by Services
Storage LocationGit system directory 

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 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. 

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