How can I get the username that completed a specific task programmatically?
In my JavaServiceTask, I have two objects: DelegateExecution and RuntimeService, but I haven’t figure out how to play with them to get a task by Id from the current process instance, and for that task, get the assignee or user who completed the task.
then you can use taskDefinitionKey you declared in flowable-modeler to find the task you are looking for. Once you have the
object of HistoricTaskInstance, you can find anything about that task like taskId, Assignee etc.
Your query might look like this :
“historyService.createHistoricTaskInstanceQuery().taskDefinitionKey(“dummyTaskKey”).singleResult()” . This will return you HistoricTaskInstance class object. Then you can use functions associated with this object to get the required things.