I am using camunda 8 and refering below link for getting task from processinstance id https://github.com/camunda-community-hub/camunda-tasklist-client-java
I have added the dependency mentioned in link. My simpleauthentication is also done. Camundatasklistclient object is also initialised. But when running below step it shows error : impleAuthentication sa = new SimpleAuthentication("demo", "demo");
//shouldReturnVariables will change the default behaviour for the client to query variables along with tasks.
CamundaTaskListClient client = new CamundaTaskListClient.Builder().taskListUrl("http://localhost:8081").shouldReturnVariables().authentication(sa).build();
//get tasks from a process instance (TaskSearch can take many more parameters)
TaskSearch ts = new TaskSearch().setProcessInstanceId("2251799818839086");
TaskList tasksFromInstance = client.getTasks(ts); // this statement gives error at runtime
Error : io.camunda.tasklist.exception.TaskListException:Error(message=Validation error of type wrongtype argument query with value 'ObjectValue{objectfields{objectfields=candidategroup, assignee, assigned,state,processDefinitionId,processInstanceId,pagesize,search after,search before,contains a filed not in Taskquery : processDefinitionId @ tasks
How to resolve this error ?
Have you checked if the versions of the client library and the servers side API match? It looks like the client lib is including processDefinitionId, but the the Taskquery API does not contain it.
Version 8.1 an 8.2 contains processDefinitionId:
https://docs.camunda.io/docs/apis-tools/tasklist-api/inputs/task-query/
Version 8.0 does not contain it:
https://docs.camunda.io/docs/8.0/apis-tools/tasklist-api/inputs/task-query/
=> Upgrade your server side and try again