Step by step example
Let's go through an example process and see how the related data is stored on it. Let's take as an example a process that performs a user search.
The process will have the following nodes defined:
  • a start node, no initial parameters are required
  • a user task that will display a form to the user and collect the first name and last name values; these will be saved on the process data under the key client
  • an external integration will be included; the process will make a search request to that external system and receive the results from it
  • the results received from the external system will be saved on a new key, searchResults
  • a new user task will be added and require the user to pick one of the results from the search; the users info will be added to the process data
Let's go through the process step by step and see how data model evolves during its execution.

Step 1 - process start

As no initial data is required for starting the process, an empty object will be first stored for the new process instance.
1
{}
Copied!

Step 2 - user input task - input user data

When defining this user task in the designer, we will have to set which keys should the first name and last name be stored, we will set these to client.firstName and client.lastName.
After the user submits the data and the process advances through this node, the process instance parameter values will be the following:
1
{
2
"client": {
3
"firstName": "Jim",
4
"lastName": "Smith",
5
}
6
}
Copied!

Step 3 - integration with external system

Let's assume the external integration requires the search request to look like:
1
{
2
"searchObject" {
3
"first_name": "",
4
"last_name": "",
5
}
6
}
Copied!
When defining the action that will make the request to that integration, we will define which of the process values to replace in the message that will be sent:
1
{
2
"searchObject" {
3
"first_name": "${application.firstName}",
4
"last_name": "${application.lastName}",
5
}
6
}
Copied!
When the process performs that action, the values that follow the ${} sign will be replaced with their coresponsing values from the process data. The message sent to the integration will look like:
1
{
2
"searchObject" {
3
"first_name": "Jim",
4
"last_name": "Smith",
5
}
6
}
Copied!
Lets say the integration will return the following results:
1
[
2
{
3
"id": 1,
4
"first_name": "Jimmy",
5
"last_name": "Smith",
6
"type": "CUSTOMER"
7
},
8
{
9
"id": 2,
10
"first_name": "Jim",
11
"last_name": "Smith",
12
"type": "CUSTOMER"
13
},
14
{
15
"id": 3,
16
"first_name": "Jane",
17
"last_name": "Smith",
18
"type": "NON_CUSTOMER"
19
}
20
]
Copied!
When defining the message receive task, we will have to configure on which process data key to save the received information .We'll set this to searchResults, so the process data will look like:
1
{
2
"client": {
3
"firstName": "Jim",
4
"lastName": "Smith"
5
},
6
"searchResults": [
7
{
8
"id": 1,
9
"first_name": "Jimmy",
10
"last_name": "Smith",
11
"type": "CUSTOMER"
12
},
13
{
14
"id": 2,
15
"first_name": "Jim",
16
"last_name": "Smith",
17
"type": "CUSTOMER"
18
},
19
{
20
"id": 3,
21
"first_name": "Jane",
22
"last_name": "Smith",
23
"type": "NON_CUSTOMER"
24
}
25
]
26
}
Copied!

Step 4 - user input task - user picks one search result

This task will display the search results to the user (all the data stored under the key ${searchResults}) and the user will be able to choose whether to save the info from one of the results to the client data object.
Lets assume the user picks the search result with id = 2. This will override the existing values of these keys and add the new keys. The process data will look like this:
1
{
2
"client": {
3
"id": 2,
4
"type": "CUSTOMER",
5
"firstName": "Jim",
6
"lastName": "Smith"
7
},
8
"searchResults": [
9
{
10
"id": 1,
11
"first_name": "Jimmy",
12
"last_name": "Smith",
13
"type": "CUSTOMER"
14
},
15
{
16
"id": 2,
17
"first_name": "Jim",
18
"last_name": "Smith",
19
"type": "CUSTOMER"
20
},
21
{
22
"id": 3,
23
"first_name": "Jane",
24
"last_name": "Smith",
25
"type": "NON_CUSTOMER"
26
}
27
]
28
}
Copied!
Since there are no other nodes in the process that can change the data on it, this will be the final state of the process values.
Copy link
Contents