Моделювання та внесення змін до бізнес-процесу
- 1. Prerequisites
- 2. Business process modeling
- 2.1. Creating a new BPMN diagram"
- 2.2. Adding Create pool/Participant element
- 2.3. Setting up the initial event
- 2.4. Creating and setting up the User task "Enter a record to the directory"
- 2.5. Creating and configuring the Service Task "Search for a directory record"
- 2.6. Adding an XOR Gateway
- 2.7. Creating and configuring the "Forming an error" service task.
- 2.8. Connecting service task "Forming an error" with user task "Enter a directory record"
- 2.9. Creating and configuring the user task "Sign data by Qualified Electronic Signature" (QES)
- 2.10. Creating and configuring the script task "Sign data by QES"
- 2.11. Creating and configuring the service task "Save data to Data Factory"
- 2.12. Creating and configuring the service task "Directory record creation completed"
- 2.13. Adding an EndEvent for the completion of the business process
🌐 This document is available in both English and Ukrainian. Use the language toggle in the top right corner to switch between versions. |
The mechanism for modeling and making changes to the business process is described using the example of the arbitrary update of the chemical factors directory business process.
Business process modeling is done using Camunda Modeler. To enhance the functionality of the application, you need to install the BPMN Linter plugin.
1. Prerequisites
-
Install the Camunda Modeler application and the BPMN Linter plugin by following the instructions in link.
-
Install a local git-client Atlassian SourceTree by following the instructions in link.
-
Install the business-process-modeler-extensions directory of the standard extensions, which is stored in the Nexus — artifact repository by following the instructions in link.
If necessary, contact the Platform administrator to provide the archive with the latest version of the business-process-modeler-extensions extensions directory (a directory of the version.build type — for example, 0.0.1-SNAPSHOT.12 ).
|
2. Business process modeling
Business process modeling is a sequential procedure. Please follow the steps described in this section. |
2.1. Creating a new BPMN diagram"
Open the Camunda Modeler application and create a new BPMN diagram by clicking on the BPMN diagram
button
This will bring up a new diagram window.
2.2. Adding Create pool/Participant element
From the left-hand toolbar, you need to drag the Create pool/Participant element to the modeling panel."
In the right window with parameters, you need to fill in the fields with the appropriate values:
-
in the
Name
field, enter the value (For example:`Creating the chemical directory`); -
In the
Process id
field, enter the valueupdate-dict
; -
In the
Process name
field, enter the value (For exampleCreating the chemical directory
).
As a result, the Create pool/Participant element is added and filled with the required parameters.
2.3. Setting up the initial event
To fill in the fields in the parameter window for the initial event, click on this event:
-
In the
Name
field, enter the valueStart of the Process
; -
In the
Initiator
field, enter the valueinitiator
.
As a result, the initial event is filled with the required parameters.
2.4. Creating and setting up the User task "Enter a record to the directory"
To add the Enter a record to the directory user task, click on the initial event, and choose Append Task
from the menu that appears.
Alternatively, you can drag the task from the palette to the modeling area of the diagram and connect the initial event to the task. |
After clicking the Create Task
icon, a task will be added to the modeling area, which needs to be filled with the appropriate parameters.
-
Specify the task type by clicking on the key icon (
Change Type
); -
Then choose
User Task
.
-
In the parameter zone on the right, click
Open Catalog
, choose the User Form template, and clickApply
to confirm.
-
Fill in the task parameters in the menu on the right:
-
In the
Id
field, enter the valueActivity_update-dict-bp-add-name
; -
In the
Name
field, enter the valueEnter a record to the directory
; -
In the
Form key
field, enter the valueupdate-dict-bp-add-name
; -
In the
Assignee
field, enter the value${initiator}
(pre-filled upon selection of the template).
-
As a result, the User Task is added to the diagram and configured.
2.5. Creating and configuring the Service Task "Search for a directory record"
Add the following service task Search for a directory record to the business process. To do this, click on the Enter Directory Record user task and choose Append Task
from the menu.
Specify the task type by clicking on the Change Type
icon and choose Service Task from the menu.
-
Click the
Open Catalog
button, choose the customized Search for entities in data factory template, and clickApply
to confirm;
-
Then, in the
name
field, enter the valueSearch for a directory record
; -
In the Resource drop-down menu, fill the
Variable Assignment Value
field with the valuefactor-equal-factor-type-name-count
; -
In the Search Variables drop-down menu, fill the
Variable Assignment Type
field with the valueMap
; -
Add a variable to the Search Variables drop-down menu by clicking the
Add Entry
button and filling in the following parameters:-
In the
Key
field, entername
; -
In the
Value
field, enter${submission('Activity_update-dict-bp-add-name').formData.prop('name').value()}
;
-
-
* In the X-Access-Token drop-down menu, in the
Variable Assignment Value
field, specify the variable${completer('Activity_update-dict-bp-add-name').accessToken}
;After completion of the first user task, try to use the
completer('<task_id>')
function to get user data instead ofinitiator()
.The access token is taken from either the initiator (for example,
$initiator().accessToken}
), or the executor of the last user task (for example,${completer('taskDefinitionId').accessToken}
).The JWT token has a validity period of 300 seconds. If you specify the token of the initiator who started the business process, and the user does not complete the task for a long time, the token validity period will expire, and the business process will have to be restarted.
More information about JUEL functions can be found on the page: JUEL functions in business processes.
-
In the Result Variable drop-down menu, in the
Assign to Process Variable
field, add the variableresponse
.
As a result, Service Task is added to the diagram and configured.
2.6. Adding an XOR Gateway
Add an XOR Gateway Is Directory Record present? by clicking on the Search for a directory record task and choosing Append Gateway
from the menu.
Fill in the gateway parameters in the right-hand menu:
Fill in the Name
field with the value Is Directory Record present?
.
2.7. Creating and configuring the "Forming an error" service task.
Add the following service task Forming an error by clicking on the XOR Gateway Is Directory Record present? → and choosing Append Task
from the menu.
Specify the task type by clicking the key icon and choose Service Task from the menu.
Fill in the task parameters in the right-hand window:
-
Choose the template by clicking the
Open Catalog
button; -
In the opened catalogue window, select the customized template Throw validation error;
-
Click
Apply
to confirm.
-
Then, in the
Name
field, enter the valueForming an error
; -
In the Validation errors drop-down menu, fill the
Variable Assignment Type
field with the valueList
; -
Add a variable by clicking the
Add Value
button and in theValue
parameter enter the following JSON structure:
{"field": "name", "value": "${submission('Activity_update-dict-bp-add-name').formData.prop('name').stringValue().replaceAll("\"", "\\\\\"")}", "message": "Такий запис вже існує"}
On the arrow that connects the XOR Gateway Is Directory Record present? and the service task Forming an error, fill in the parameters on the right-hand menu:
-
In the
Name
field, enter the valueyes
; -
In the
Condition Type
field, enter the valueExpression
; -
In the
Expression
field, enter the value${!response.value.responseBody.elements().isEmpty()}
.
As a result, the Service Task is added to the diagram and configured."
2.8. Connecting service task "Forming an error" with user task "Enter a directory record"
-
On the menu panel, select the element Create Gateway and, while holding down the left mouse button, drag the Enter a directory record task to the diagram area between the initial event and the user task.
-
Connect the service task Forming an error with the user task Enter a directory record by selecting an arrow in the menu.
2.9. Creating and configuring the user task "Sign data by Qualified Electronic Signature" (QES)
Add the following user task Sign data by QES by clicking on the XOR Gateway Is Directory Record present? and choosing Append Task
from the menu.
-
Specify the task type by clicking the key icon and choose User Task from the menu.
-
Fill in the task parameters in the right-hand window:
-
Choose the template by clicking the
Open Catalog
button; -
In the opened catalogue window, select the customized template Officer Sign Task and click
Apply
to confirm; -
In the
id
field, enter the valueActivity_update-dict-bp-sign-add-name
; -
In the
Name
field, enter the valueSign data by QES
; -
In the
Form key
field, enter the valueupdate-dict-bp-sign-add-name
; -
In the
Assignee
field, enter the value${initiator}
(pre-filled when choosing a template).
-
-
Enter value
${submission('Activity_update-dict-bp-add-name').formData}
in theForm data pre-population
field.
On the arrow that connects the XOR Gateway Is Directory Record present? and the Sign data by QES task, fill in the parameters in the right-hand menu:
-
In the
Name
field, enter the valueno
; -
In the
Condition Type
field, enter the valueExpression
; -
In the
Expression
field, specify the variable${response.value.responseBody.elements().isEmpty()}
.
As a result, the user task is added to the diagram and configured.
2.10. Creating and configuring the script task "Sign data by QES"
Add the following script sask Prepare data for recording (transient var) by clicking on the Sign data by QES task and choosing Append Task
from the menu.
Specify the task type by clicking the key icon and choose Script Task from the menu.
Fill in the task parameters with corresponding values in the right-hand window:
-
in the
Name
field, input valuePrepare data for recording (transient var)
; -
in the
Script Format
field, input valuegroovy
; -
in the
Script Type
field, chooseInline Script
; -
Ii the
Script
field, input the necessary script:
def signedFormData = submission('Activity_update-dict-bp-sign-add-name').formData signedFormData.prop('factorType', 'Хімічний: довільні') execution.removeVariable('dataPayload') execution.setVariableLocalTransient('dataPayload', signedFormData)
As a result, the script task is added to the diagram and configured.
2.11. Creating and configuring the service task "Save data to Data Factory"
Add the following service task Save data to Data Factory by clicking on the Sign data with system key task and choosing Append Task
from the menu.
Specify the task type by clicking the key icon and choose Service Task from the menu.
Fill in the following parameters in the right-hand window:
-
Choose the template by clicking the
Open Catalog
button; -
In the opened catalogue window, select the customized template Create entity in data factory and click
Apply
to confirm;
-
in the
Name
field, input valueSave data to Data Factory
; -
in the
Resource
field, input valuefactor
; -
in the
Payload
field, input value${dataPayload}
; -
in the
X-Access-Token
field, input value${completer('Activity_update-dict-bp-sign-add-name').accessToken}
;After the first user task is executed, please use the function
completer('<task_id>')
to get user data instead ofinitiator()
.The access token is taken from EITHER the initiator (for example,
$initiator().accessToken}
) OR the performer of the last user task (for example,${completer('taskDefinitionId').accessToken}
).The JWT token has a validity period of 300 seconds. If you specify the token of the initiator who started the business process and the user does not perform the task for a long time, the token will expire, and the business process will need to be re-started.
More information about JUEL functions can be found on the page JUEL functions in business processes.
-
in the
X-Digital-Signature source
field, input value${sign_submission('Activity_update-dict-bp-sign-add-name').signatureDocumentId}
; -
in the
X-Digital-Signature-Derived source
field, input value${system_signature_ceph_key}
; -
in the
Result variable
field, input valueresponse
.
As a result, the service task is added to the diagram and configured.
2.12. Creating and configuring the service task "Directory record creation completed"
Add the following service task The result of the task execution "Directory record creation completed" by clicking on the Save data to Data Factory task and choosing Append Task
from the menu.
Specify the task type by clicking the key icon and choose Service Task from the menu.
Fill in the task parameters in the right-hand window:
-
choose the template by clicking the
Open Catalog
button; -
in the opened catalogue window, select the customized template Define business process status and click
Apply
to confirm;
-
in the
Name
field, input valueThe result of the task execution "Directory record creation completed"
; -
in the
Status
field, input valueDirectory record created
.
As a result, the service task is added to the diagram and configured.
2.13. Adding an EndEvent for the completion of the business process
Add an event that completes the business process, by clicking on the The result of the task execution "Directory record creation completed" task and choosing Append EndEvent
from the menu.
Fill in the following task parameters in the right-hand window:
-
in the
Name
field, input valueDirectory record created
.
As a result, the event that completes the business process has been added to the diagram and configured.