Which process created a particular task?

Is there a way to identify if a given task belongs to a given process ID?
For example: Let’s say there are various tasks for a person created by different processes, now I want to know which process created that particular task. How can this be achieved?

Hi Varun,

Use TaskInfo instances which are returned from the query.

org.flowable.task.api.TaskInfo#getProcessInstanceId
    /**
     * Reference to the process instance or null if it is not related to a process instance.
     */
    String getProcessInstanceId();

Regards
Martin

1 Like