Obsolete signal subscriptions are not being removed, causing signals to be fired in old process definitons

Description

When the BpmnDeployer is attempting to re-deploy a BPMN resource, it runs through several steps that remove subscriptions from 'previous' process definition entities.

One of these is to remove subscriptions from signal events. This is

protected void removeObsoleteSignalEventSubScription(ProcessDefinitionEntity processDefinition, ProcessDefinitionEntity latestProcessDefinition)

However, something seems to be not quite right.

This like attempts to get the subscriptions to delete:

List<EventSubscriptionEntity> subscriptionsToDelete = commandContext
.getEventSubscriptionEntityManager()
.findEventSubscriptionsByConfiguration(SignalEventHandler.EVENT_HANDLER_TYPE, latestProcessDefinition.getId(), latestProcessDefinition.getTenantId());

Which is in my case expands to:

.findEventSubscriptionsByConfiguration("signal", "vte:6:3811", "");

However - this appears to never return any results. Drilling down to the query that ultimately gets executed results in this:

org.hsqldb.jdbc.JDBCPreparedStatement@3ff4ed56[sql=[select *
from ACT_RU_EVENT_SUBSCR
where (EVENT_TYPE_ = ?)
and (CONFIGURATION_ = ?)

and (TENANT_ID_ = '' or TENANT_ID_ is null)], parameters=[[signal], [vte:6:3811]]]

Given the parameters, it would return results correctly if
(CONFIGURATION_ = ?)

were replaced with

(PROC_DEF_ID_ = ?)

Which I think would solve my issue where old process definitions are still being started by signals.

Environment

None

Assignee

Joram Barrez

Reporter

Nigel Magnay

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure