AnsweredAssumed Answered

Get the activity from the task

Question asked by frauke on Oct 4, 2010
Latest reply on Oct 4, 2010 by frauke
Hello everybody,

how can I retrieve the activity from a task?
I tried this way, but the activity of this execution is null, although the activityId has the expected value.

        Execution ex = processEngine.getRuntimeService()
            .createExecutionQuery()
            .executionId(task.getExecutionId())
            .singleResult();
        PvmActivity activity = ((ExecutionEntity) ex).getActivity(); // is null
        String actId = ((ExecutionEntity) ex).getActivityId(); // is not null

The same code works with the process instance, but what I need is the currently active activity after branching with an exclusive gateway.
Is there an other way of getting the activity?

Best regards
Frauke

Outcomes