In Camunda Platform 8,Is there a ready-to-use Tasklist API (GraphQL) Using Java Client?

Hello Camunda Team.

Tasklist API (GraphQL), Is there a ready-to-use Spring Boot framework or Java 8 solution for querying, claiming, or completing user tasks?

For Camunda 8, I saw one reference here with NestJs.

Please assist me, If any java client or example. available

There was a really nice blog post written by @Hafflgav on this topic.
You can read it here: Getting Started with Camunda Platform 8’s GraphQL API - Camunda

1 Like

Hello @ramakrishnan707 ,

there is a nice project: GitHub - camunda-community-hub/camunda-tasklist-client-java: Java client for the Tasklist API of Camunda Platform 8

I hope this helps

Jonathan

1 Like

Hi @jonathan.lukas I have used above metioned example but when i execute this statement

SimpleAuthentication 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);

client.getTasks method gives below error :
Exception in thread “main” io.camunda.tasklist.exception.TaskListException: Error(message = Validation error of type WrongType:
argument ‘query’ with value ‘ObjectValue{objectFields=[ObjectField{name=‘candidateGroup’,
value=VariableReference{name=‘candidateGroup’}},
ObjectField{name=‘assignee’, value=VariableReference{name=‘assignee’}},
ObjectField{name=‘assigned’, value=VariableReference{name=‘assigned’}},
ObjectField{name=‘state’, value=VariableReference{name=‘state’}},
ObjectField{name=‘processDefinitionId’, value=VariableReference{name=‘processDefinitionId’}},
ObjectField{name=‘processInstanceId’, value=VariableReference{name=‘processInstanceId’}},
ObjectField{name=‘taskDefinitionId’, value=VariableReference{name=‘taskDefinitionId’}},
ObjectField{name=‘pageSize’, value=VariableReference{name=‘pageSize’}},
ObjectField{name=‘searchAfter’, value=VariableReference{name=‘searchAfter’}},
ObjectField{name=‘searchBefore’, value=VariableReference{name=‘searchBefore’}},
ObjectField{name=‘searchAfterOrEqual’, value=VariableReference{name=‘searchAfterOrEqual’}}]}’ c
ontains a field not in ‘TaskQuery’: ‘processDefinitionId’ @ ‘tasks’, locations = [Location(line = 1, column = 303)],
path=null, extensions = {classification=ValidationError}, nonStandardFields = null)
at io.camunda.tasklist.CamundaTaskListClient.execute(CamundaTaskListClient.java:253)
at io.camunda.tasklist.CamundaTaskListClient.getTasks(CamundaTaskListClient.java:225)
at io.camunda.tasklist.CamundaTaskListClient.getTasks(CamundaTaskListClient.java:181)
at io.camunda.tasklist.CamundaTaskListClient.getAssigneeTasks(CamundaTaskListClient.java:98)
at io.camunda.tasklist.CamundaTaskListClient.getAssigneeTasks(CamundaTaskListClient.java:86)
at com.taskclient.camundataskclient.GetUserData.getUserData(GetUserData.java:33)
at com.taskclient.camundataskclient.CamundataskclientApplication.main(CamundataskclientApplication.java:16)
Any inputs?

I am using camunda 8.1 and it’s library.

Hello @Neha1 ,

have you reported this as an issue?

There is a good chance that the creator of the library can explain the problem or provide you with a fix.

If you already see the issue, you can also file a PR to fix it.

Jonathan

Hi @jonathan.lukas Any pointings on how to create issue or PR ?

Hello @Neha1 ,

please use the issue functionality provided by the above mentioned github repo.

Jonathan

this project is on gradle ? can you provide with the maven link

Hello @Supriya ,

here you are: GitHub - camunda-community-hub/camunda-tasklist-client-java: Java client for the Tasklist API of Camunda Platform 8

Jonathan