Hello,
I’m trying to fetch variables from history by taskId. I get always an empty raw.
If I fetch variables by processId, I get all the variables but with taskId as null.
I’m using “/task/{id}/complete” to submit variables and complete tasks.
Any help please.
Yana
August 5, 2019, 1:30pm
2
Hello @Bilel_BARHOUMI and welcome,
Which rest endpoint do you use to fetch the variables?
Is it this one with query param taskIdIn
:
https://docs.camunda.org/manual/7.11/reference/rest/history/variable-instance/get-variable-instance-query/
If it is not, please send us an example of your request.
I get this when I fetch all variables:
Yana
August 6, 2019, 5:35am
5
if this is the only variable which is returned the http://localhost:3000/engine-rest/history/variable-instance?taskIdIn=dc18d615-b781-11e9-894c-0050568c7ff0 response is empty as no variable is available with such task scope. The variable has a process instance scope as the taskId: null
for it.
Thank you @Yana ,
The http://localhost:3000/engine-rest/history/variable-instance?taskIdIn=dc18d615-b781-11e9-894c-0050568c7ff0 return all my variables that was submitted when completing tasks. But all of theme has the taskId null.
The question is, how can I attach variables to the task when I complete it?
Yana
August 6, 2019, 2:00pm
7
How have you submitted the variables so far? Which API do you use, please give an example
I think this page might help you to understand better the concept of the variable scopes topic:
https://docs.camunda.org/manual/7.11/user-guide/process-engine/variables/#variable-scopes-and-variable-visibility