Completing a User task with Java API

Hi,

Is it possible and how to complete a user task with the Java API?
I have the task_id.

Thanks!

1 Like

In REST API, you can use this method:
https://docs.camunda.org/manual/7.10/reference/rest/task/post-submit-form/
you should find a similar one in Java API

Yes, I know this REST API call @zmadel, thanks!
But Iā€™m looking about a JAVA API alternative.

Get the task service
Using the process engine
Complete with ID

processEngine().getTaskService() .complete("someTaskIdHere");

6 Likes

can we do that via scripting from within the process?

Did you find a solution for this?

I figured out the solution

pi = execution.getProcessInstanceId()
taskService = execution.getProcessEngineServices().getTaskService()
task = taskService.createTaskQuery().processInstanceId(pi).taskDefinitionKey("IssueCvr").singleResult()
taskService.complete(task.getId())
1 Like