Signal legacy inflight processes issues


We are on flowable 6.5 and have inflight legacy processes which were created in Activiti 5.15 and
continue to work in backward compatible flowable 5 engine.

Problem - we are sending signal in legacy in-flight processes and it fails in
org.flowable.engine.impl.agenda.TriggerExecutionOperation with a NPE given ActivityBehavior
activityBehavior = (ActivityBehavior) ((FlowNode) currentFlowElement).getBehavior() returns NULL from below code(Current flow element here is IntermediateCatchEvent ).

Ideally FlowNode behaviors are set by bpmn parsers which deploy the process definition in memory. Though for flowable 5 compatible process definitions the parsers set ActivitiImpl and not FlowNode. So when the signal is invoked , it gets in TriggerExecutionOperation and tries to find current behavior and cannot find it, given it was not set by bpmn parse handler.

Same flow works great if I am sending signal with a new process definition instantiated in flowable 6.5 engine.

Any ideas why this is happening ?

Code that fails in TriggerExecutionOperation

public void run() {
    FlowElement currentFlowElement = getCurrentFlowElement(execution);
    if (currentFlowElement instanceof FlowNode) {

        ActivityBehavior activityBehavior = (ActivityBehavior) ((FlowNode) currentFlowElement).getBehavior();


Looks like this issue happens only if a signal is send asynchronously otherwise works fine. In synchronous mode the flow of event is through different code path - org.flowable.engine.delegate.event.impl.BpmnModelEventDispatchAction#dispatchEvent

So do I understand you correctly:

  • process instance started on v5, has a waiting signal
  • when triggering async, the NPE above happens? You’re calling signalEventReceived?

That’s correct - based on certain updates/changes we invoke org.activiti.engine.impl.persistence.entity.EventSubscriptionEntity#eventReceived asynchronously. There is a signal boundary catching event waiting for this update to take further action.

In case of asynchronous call, its throws NPE from org.flowable.engine.impl.agenda.TriggerExecutionOperation#run from ActivityBehavior activityBehavior = (ActivityBehavior)((FlowNode)currentFlowElement).getBehavior(); which return null.

If I invoke the above org.activiti.engine.impl.persistence.entity.EventSubscriptionEntity#eventReceived synchronously it works fine.

Do you think there is a defect here ? why does the execution which is of type V5 go and check for elements on FlowNode which is not at all set by V5 flow… thanks for looking into it!