we are testing how the engine behaves using a message queue and for that we are creating several flows to check that it works as expected,
i.e the same as with the ‘NOT MESSAGE QUEUE BASED ASYNC EXECUTOR’ configuration but with better behavior
the tests were good until we ran into the next flow ‘mqTest1’ which is shown below;
the task ‘TaskA’ and gateway ‘ExclusiveGwy’ run with the same thread
the tasks ‘TaskB’, ‘TaskC’, ‘TaskD’ and ‘TaskE’ are asynchronous so run with different threads
we are starting new process instances through the flowable REST API
in this case (flow) we find that the engine behaves differently; and to explain better (show the differences) send you the request body and responses
test A; MESSAGE QUEUE BASED ASYNC EXECUTOR configuration, checkVar=true
request body:
{
“processDefinitionKey” : “mqTest1”,
“returnVariables”: true,
“variables”:
[
{ “name”: “client”, “value” : “caph” },
{ “name”: “checkVar”, “value” : “true” }
]
}
response body:
{
“id”: “b7cc8fb0-5296-11ea-8b06-7446a0aca61e”,
“url”: “…”,
“name”: null,
“businessKey”: null,
“suspended”: false,
“ended”: false,
“processDefinitionId”: “mqTest1:3:7218e90e-528e-11ea-8b06-7446a0aca61e”,
“processDefinitionUrl”: “…”,
“processDefinitionName”: “mqTest1”,
“processDefinitionDescription”: null,
“activityId”: null,
“startUserId”: null,
“startTime”: “2020-02-18T18:36:27.043-03:00”,
“variables”: [
{
“name”: “TaskA-05-37-10”,
“type”: “string”,
“value”: “…”,
“scope”: “local”
},
{
“name”: “checkVar”,
“type”: “string”,
“value”: “true”,
“scope”: “local”
},
{
“name”: “client”,
“type”: “string”,
“value”: “caph”,
“scope”: “local”
},
{
“name”: “startDate”,
“type”: “serializable”,
“value”: null,
“valueUrl”: “…”,
“scope”: “local”
}
],
“callbackId”: null,
“callbackType”: null,
“tenantId”: “”,
“completed”: false
}
test B; MESSAGE QUEUE BASED ASYNC EXECUTOR configuration, checkVar=false
request body:
{
“processDefinitionKey” : “mqTest1”,
“returnVariables”: true,
“variables”:
[
{ “name”: “client”, “value” : “caph” },
{ “name”: “checkVar”, “value” : “false” }
]
}
response body:
{
“id”: “da6bef76-5296-11ea-8b06-7446a0aca61e”,
“url”: “…”,
“name”: null,
“businessKey”: null,
“suspended”: false,
“ended”: true,
“processDefinitionId”: “mqTest1:3:7218e90e-528e-11ea-8b06-7446a0aca61e”,
“processDefinitionUrl”: “…”,
“processDefinitionName”: “mqTest1”,
“processDefinitionDescription”: null,
“activityId”: null,
“startUserId”: null,
“startTime”: “2020-02-18T18:37:25.130-03:00”,
“variables”: [],
“callbackId”: null,
“callbackType”: null,
“tenantId”: “”,
“completed”: true
}
test C; NOT MESSAGE QUEUE BASED ASYNC EXECUTOR configuration, checkVar=true
request body:
{
“processDefinitionKey” : “mqTest1”,
“returnVariables”: true,
“variables”:
[
{ “name”: “client”, “value” : “caph” },
{ “name”: “checkVar”, “value” : “true” }
]
}
response body:
{
“id”: “bd9b9287-5297-11ea-af47-7446a0aca61e”,
“url”: “…”,
“name”: null,
“businessKey”: null,
“suspended”: false,
“ended”: false,
“processDefinitionId”: “mqTest1:3:7218e90e-528e-11ea-8b06-7446a0aca61e”,
“processDefinitionUrl”: “…”,
“processDefinitionName”: “mqTest1”,
“processDefinitionDescription”: null,
“activityId”: null,
“startUserId”: null,
“startTime”: “2020-02-18T18:43:46.285-03:00”,
“variables”: [
{
“name”: “checkVar”,
“type”: “string”,
“value”: “true”,
“scope”: “local”
},
{
“name”: “client”,
“type”: “string”,
“value”: “caph”,
“scope”: “local”
},
{
“name”: “TaskA-06-43-02”,
“type”: “string”,
“value”: “…”,
“scope”: “local”
},
{
“name”: “startDate”,
“type”: “serializable”,
“value”: null,
“valueUrl”: “…”,
“scope”: “local”
}
],
“callbackId”: null,
“callbackType”: null,
“tenantId”: “”,
“completed”: false
}
test D; NOT MESSAGE QUEUE BASED ASYNC EXECUTOR configuration, checkVar=false
request body:
{
“processDefinitionKey” : “mqTest1”,
“returnVariables”: true,
“variables”:
[
{ “name”: “client”, “value” : “caph” },
{ “name”: “checkVar”, “value” : “false” }
]
}
response body:
{
“id”: “02a44d87-5298-11ea-af47-7446a0aca61e”,
“url”: “…”,
“name”: null,
“businessKey”: null,
“suspended”: false,
“ended”: true,
“processDefinitionId”: “mqTest1:3:7218e90e-528e-11ea-8b06-7446a0aca61e”,
“processDefinitionUrl”: “…”,
“processDefinitionName”: “mqTest1”,
“processDefinitionDescription”: null,
“activityId”: null,
“startUserId”: null,
“startTime”: “2020-02-18T18:45:42.105-03:00”,
“variables”: [
{
“name”: “checkVar”,
“type”: “string”,
“value”: “false”,
“scope”: “local”
},
{
“name”: “TaskA-06-43-02”,
“type”: “string”,
“value”: “…”,
“scope”: “local”
},
{
“name”: “startDate”,
“type”: “serializable”,
“value”: null,
“valueUrl”: “…”,
“scope”: “local”
},
{
“name”: “client”,
“type”: “string”,
“value”: “caph”,
“scope”: “local”
}
],
“callbackId”: null,
“callbackType”: null,
“tenantId”: “”,
“completed”: true
}
We note that with the MESSAGE QUEUE BASED ASYNC EXECUTOR configuration, only in the case that the variable checkVar is equal to true do you see all the variables set in the flow
We also note that with the NOT MESSAGE QUEUE BASED ASYNC EXECUTOR configuration the value of the variable checkVar does not matter, the output always shows all the variables set in the flow
Another test:
With NOT MESSAGE QUEUE BASED ASYNC EXECUTOR configuration, if we change async=“false” for tasks ‘TaskB’, ‘TaskC’, ‘TaskD’ and ‘TaskE’,
when the flow end it does not return the variables set in the flow
Our question is, it works like this:
when the MESSAGE QUEUE BASED ASYNC EXECUTOR configuration is used, the engine does not always return the variables set in the flow;
contrary to what happens when we use the NOT MESSAGE QUEUE BASED ASYNC EXECUTOR configuration???
WE HOPED THAT WITH BOTH CONFIGURATIONS THE ENGINE WORKS THE SAME FOR THIS CASE