class TaskPriorityQueueConsumer extends Thread {

    public Boolean taskInstanceIsFinalState(int taskInstanceId){
        TaskInstance taskInstance = processService.findTaskInstanceById(taskInstanceId);
        return taskInstance.getState().typeIsFinished();
    }

}