I have a simple BPMN with two sequential user tasks. Start->UT1->UT2->End. I am trying to terminate task instance relates to UT1. I tried with Java Zeebe client API
zeebeClient.newModifyProcessInstanceCommand(processInstanceKey).terminateElement(taskId).send().join();
processInstanceKey = taken from Camunda operator
TaskId = Used TaskList REST API task/search. I can GET task/{id} from this
But this java code results in
Expected to modify instance of process ‘processInstanceKey’ but it contains one or more terminate instructions with an element instance that could not be found: taskId
What is the mistake I am doing here? Should the elementId for terminate instruction is something else than taskId?