Spring event bridge not firing task listener on manual tasks

I’ve got a custom listener setup like so

@Component
public class Listener {

    private static final Logger LOGGER = LoggerFactory.getLogger(Listener.class);

    @EventListener
    public void onTaskEvent(DelegateTask taskDelegate) {
        LOGGER.info("Mutable Task Event: {} - Task: {} - Process Definition: {} - Process Instance: {}",
                taskDelegate.getEventName(),
                taskDelegate,
                taskDelegate.getProcessDefinitionId(),
                taskDelegate.getProcessInstanceId());
    }

    @EventListener
    public void onTaskEvent(TaskEvent taskEvent) {
        LOGGER.info("Immutable Task Event: {} - Task: {} - Process Definition: {} - Process Instance: {}",
                taskEvent.getEventName(),
                taskEvent.getProcessDefinitionId(),
                taskEvent.getProcessInstanceId());
    }

    @EventListener
    public void onExecutionEvent(DelegateExecution executionDelegate) {
        LOGGER.info("Mutable Execution Event: {} - Process Definition: {} - Process Instance: {} - Activity: {}",
                executionDelegate.getEventName(),
                executionDelegate.getProcessDefinitionId(),
                executionDelegate.getProcessInstanceId(),
                executionDelegate.getCurrentActivityId());
    }

    @EventListener
    public void onExecutionEvent(ExecutionEvent executionEvent) {
        LOGGER.info("Immutable Execution Event: {} - Process Definition: {} - Process Instance: {} - Activity: {}",
                executionEvent.getEventName(),
                executionEvent.getProcessDefinitionId(),
                executionEvent.getProcessInstanceId(),
                executionEvent.getCurrentActivityId());
    }

    @EventListener
    public void onHistoryEvent(HistoryEvent historyEvent) {
        LOGGER.info("History Event: {} – String {} - Process Definition: {} - Process Instance: {} - Activity: {}",
                historyEvent.getEventType(),
                historyEvent.toString(),
                historyEvent.getProcessDefinitionId(),
                historyEvent.getProcessInstanceId(),
                historyEvent.getExecutionId());
    }
}

But I receive no task events for manual tasks, and no event at all when a comment is added to a manual task. Would a custom plugin give me access to these events, or is it no different to the spring event bridge?

Not an expert here, so… YMMV.

As I understand it, Manual Task (as opposed to User Task) are defined to be things that happen outside the visibility of the Process Orchestrator. As such, the Camunda Process Engine skips these steps completely, not firing any events.

Try converting them to User Tasks and see if that causes them to show up in your logger.
Your user will then need to go into the tasklist and complete the tasks.

1 Like

Apologies, I think I had the wrong terminology. You’re right about manual tasks, but in my original request I was actually trying to work with standalone tasks.

Please clarify.
Which tasks are you referring to as “standalone tasks”

A task added via the create task button in the TaskList UI.

Hmmm.
I’m not 100% what type of Tasks those are according to the engine.

We’ll probably need one of the people with more experience to chime in. Sorry that I couldn’t solve this one for you.

No problem thanks for trying!