Wrong data in processDefinitionId in Tasklist API?

Hello Everybody !

I’m try to use very nice camunda-tasklist-client-java. It works well, but returns data in processDefinitionId very similar to “Process Instance Key”. Like: “2251799816697009” insted of process ID: “Process_107v1hv”.
Is it correct ?

processDefinitionId_Error

for this process:
processDefinitionId_Error2
I think, this wrapper has no error and just return the data from Tasklist API (GraphQL)

Unfortunatly I can’t check by myself what data GraphQL API return. I connected to Tasklist API (GraphQL) and got “Session-ID”:
curl -v -XPOST "http://10.168.128.9:8081/api/login?username=demo&password=demo"
then try to execute query with this examples:

but got an error message “Method Not Allowed”:

D:>curl -b "TASKLIST-SESSION=14A2D4A5064ADB90767FFCFF9E74E96B" -X POST -H "Content-Type: application/json" -d "{\"query\":\"{tasks(query:{}){name}}\"}" http://10.168.128.9:8081/graphql

{
“timestamp” : “2023-02-09T15:23:48.301+00:00”,
“status” : 405,
“error” : “Method Not Allowed”,
“path” : “/graphql”
}
D:>

The same result was when I used already created files with queries from Camunda doc:

D:>curl -b “TASKLIST-SESSION=14A2D4A5064ADB90767FFCFF9E74E96B” -X POST -H “Content-Type: application/json” --data @req1.txt http://10.168.128.9:8081/graphql
{
“timestamp” : “2023-02-09T14:48:18.422+00:00”,
“status” : 405,
“error” : “Method Not Allowed”,
“path” : “/graphql”
}

Where req1.txt contains text:

> {"query":"{
>     tasks(query: {}) {
>         name
>     }
>   }"
> }

So my question is: is it correct when Tasklist API in processDefinitionId returns data similar to “Process Instance Key” insted of “Process ID” ?
And also could you help me to execute query to graphql API by curl.

Hello @volodya327 ,

the problem is here that the Tasklist API sticks to GraphQL Naming conventions where an ID is considered something unique.

In all other apis, the key is unique (and generated), while the Id comes from the bpmn xml.

I hope this helps

Jonathan

1 Like

I’m sorry, Jonathan, but I don’t understand your answer.
What data is contained in the processDefinitionId of Tasklist API ?
And how to get info about “Process ID” of the task ?

Hello @volodya327 ,

currently, the processDefinitionId is the related to a process definition.

If you would like to find out the bpmnProcessId from there, use the Operate API:

Here, you can get a process definition by its key by using the processDefinitionId from Tasklist.

This will provide you with a more rich representation of a process definition.

I hope this helps

Jonathan

Thanks, Jonathan ! You save my life :wink:

1 Like