Searching users by equal and Inverse startsWith functions
This functionality is deprecated. |
🌐 This document is available in both English and Ukrainian. Use the language toggle in the top right corner to switch between versions. |
1. Overview
The business name of the integration extension: Keycloak Get Officer Users By Attributes Equals And Start With The system name of the integration extension: The file name in the extensions library: keycloakGetOfficerUsersByAttributesEqualsAndStartWith.json |
The delegate is needed to get a list of users with the officer
system role by specific attributes from the Keycloak service when executing a business process.
The following attributes are required for all registries: edrpou
, drfo
, and fullName
.
Registries may also use custom attributes, such as KATOTTG
.
In this topic, we’ll use the attributes mentioned above as search examples. |
The Keycloak API receives GET
requests with the specified parameters and returns an array of usernames that can be used in the business process.
The system searches the edrpou
, drfo
, and fullName
attributes using the equal
function, which returns values that exactly match the one you provide.
The KATOTTG
attribute is searched using the Inverse startsWith
function, which returns values with the specified prefix—that is, those that "start with" the specified condition.
The Searches for users whose specific Keycloak attribute value "starts with" the query specified in the UI form in the user portal. At the same time, Keycloak contains the full value of this attribute. For example, The Works the same as the |
Before configuring the template in Camunda Modeler, ensure the resources/element-templates folder of the application contains the keycloakGetOfficerUsersByAttributesEqualsAndStartWith.json file. |
2. Configuring the template in the business process
-
Open the business process modeling interface.
-
Model a new task.
-
Click the key icon and select Service Task from the dropdown menu.
-
In the settings panel on the right, click the
Open Catalog
button and select the Keycloak Get Officer Users By Attributes Equals And Start With delegate from the list. ClickApply
to confirm your action. -
Configure the following settings:
-
Name: Specify the task name. For example,
Find users by attributes
. -
Attributes Equals: Specify the value to search by EDRPOU, and/or DRFO, and/or full name:
${attributesEquals}
. -
Attribute Inverse Start With: Specify the value to search by KATOTTG:
${attributesStartsWith}
.Keys and attribute values can only be passed as variables.
In our example, we use the following variables to search by attributes:
${attributesEquals}
and${attributesStartsWith}
.The objects, or key-value pairs, for the search attributes are generated by a script in the previous task of the business process. Task data is passed from a corresponding user UI form and processed by the script. The result of the script is stored in search variables, which are used to configure the delegate template.
-
Result variable: Specify the search result variable to store the list of retrieved users:
usersByAttributes
.
For details on using the delegate, download the BPMN schema of a test business process and open it in the modeler. |
3. Using search parameters in the officer portal
The system allows searching by one attribute or a combination of attributes: KATOTTG
, edrpou
, drfo
, and fullName
.
3.1. Prerequisites
-
The system contains three users with the following EDRPOU and KATOTTG attributes:
-
Ivanov, EDRPOU 11111111, KATOTTG UA0502 (Vinnytsia district).
-
Petrov, EDRPOU 22222222, KATOTTG UA05 (Vinnytsia region).
-
Sydorenko, EDRPOU 34554362, KATOTTG UA05 (Vinnytsia region).
-
-
Let’s consider three search scenarios:
-
By the EDRPOU attribute value 34554362.
-
By the KATOTTG attribute value UA05100030000051497 (Vapnyarska territorial community, Tulchyn district, Vinnytsia region).
-
By a combination of attributes: EDRPOU=34554362 та KATOTTG=UA05100030000051497.
-
3.2. Search process
-
Sign in to the officer portal using your digital signature.
For details on user authentication, see Registry user authentication. -
Go to All services and start the business process of searching users by attributes.
-
In the task’s UI form, enter
34554362
into the EDRPOU field and clickSearch
.As a result, the system finds one user who matches the search criteria.
-
Restart the task and enter
UA05100030000051497
into the KATOTTG field. ClickSearch
.As a result, the system finds two users who match the search criteria.
-
Restart the task and enter a combination of attributes:
34554362
for EDRPOU andUA05100030000051497
for KATOTTG. ClickSearch
.As a result, the system finds one user who matches the search criteria.