Getting Task ID (error: task with given ID can't be found, task is null))

Hello everyone,

I looked through the existing topics but somehow couldn’t find a solution to my problem, so I hope it’s ok if I ask jet another question concerning task IDs. :wink:
First of all sorry if my wording is not technical enough, I’m a stundent in second semester and it’s my first time working with process engines. For my project I need to link a certain process definition to a custom ui. When posting the complete-task-method I get the error message, that the task with the given ID could not be found (and that the task is null). I also have the bpmn-diagram of the definition and checked the task ID multiple times, so there is no typo. Did I get anything wrong and the ID contains more that what can be seen in the Camunda Modeller? Or did I miss anything while modelling the whole thing (it is a rather simple model with user tasks, two gateways and form fields)? I use REST for the communication between process engine and ui.

Thanks in advance. :slight_smile:

Hi @skoch,

maybe you mix up the taskDefinitionKey with the id: Task (Camunda Platform Javadocs 7.15.4-ee)

The task ID is generated in the database once the process instance arrives at a task and cound not be found in the process model. The task Id from the modeler is referered as taskDefinitionKey in the API.

Hope this helps, Ingo

Hi @Ingo_Richtsmeier,

thanks a lot, that totally helps. :slightly_smiling_face:
It seems I got confused because the field in the modeler was labeled as ID. But it makes a lot more sense the way you described it. I still need to figure out how to map this to my code for the ui, but that’s something I have to do on my own. :wink:

Best wishes, Simone