Conditional Execution of LCA
You can configure your LCAs for conditional execution.
Conditional Execution
Sometimes, before executing an action, the LCA needs to validate a condition and then execute the action only if the condition is true. In such cases, administrators can configure a condition for a particular LCA so that the LCA is triggered only if this condition is satisfied.
Applying Filter for Action
In some cases, LCA must be executed by a condition. For example, for conditions that makes requests only from the UI, You can specify a filter in the configuration.
Filter by clientType
You can configure LCA to run only after requests from UI while ensuring that LCA is not
triggered for other activies, such as data loads. In this case, we can apply
filtering by clientType
for the LCA.
Let us consider the following example illustrating the use of filter in LCA configuration:
"lifecycleActions": {
"beforeSave": [
{
"actions": [
"LCAGroupA"
],
"filter": "equals(clientType, 'Reltio UI') and equals(attributes.Group, 'GroupA')"
}
]
}
In this example, the LCAGroupA-beforeSave
hook is triggered only if a user
tries to create or modify an entity using UI and this entity has the
Group
attribute with the GroupA
value.
clientType
is a value that is passed to the API as
globalId
in the request header. Consider the example listed
below.
Request:
POST /reltio/api/tenantId/entities/entityId
Headers:
Host: env.reltio.com
Connection: keep-alive
Source-System: Reltio
xxx-client: true
globalId: Reltio UI
Authorization: Bearer token
clientSystemId: Reltio UI
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
X-Requested-With: XMLHttpRequest
Accept: */*
Referer: https://env.reltio.com/ui/tenantId/
Accept-Encoding: gzip, deflate, sdch, br
Accept-Language: en-US,en;q=0.8
Cookie: cookies
globalId
to LCA.