Why message/signal event subscriptions removed when deploying new version of process definition? Why they don't stay on the previous version? Process instances still stay on the previous version, or not?
It makes no sense. I want to keep them on the previous version.
I use Activiti version 5.20.0.1.
Fersmi_,
In the Activiti User Guide, particularly in the areas surrounding event subscriptions, I found a couple of relevant mentions. Particularly that when that, upon the "deployment of a new version of a process definition, the message subscriptions of the previous version are cancelled".
Other helpful bits in this case:
It sounds like from the user guide, that what you're experiencing is intended default behavior.
-JEarles
bp3
Hi Jonathan,
thank you for your answer.
I have another question. Do you know what happens, when event is triggered and process definition is different for event subscription (new version) and process instance (old version)? It will work?
Fersmi
It's definitely wrong. I have upgraded to latest version 5.22.0 and there BpmnDeployer remove only event subscription with no execution id and process instance id. Not all event subscriptions.
That makes sense!
Jakob,
I can assure you that event, message and timer subscriptions for existing process definition version are removed and updated when a new version of a process definition is deployed.
a snippet from the deploy code:
removeObsoleteTimers(processDefinition);
addTimerDeclarations(processDefinition, timers);
removeExistingMessageEventSubscriptions(processDefinition, latestProcessDefinition);
addMessageEventSubscriptions(processDefinition);
removeExistingSignalEventSubScription(processDefinition, latestProcessDefinition);
addSignalEventSubscriptions(processDefinition);
Feel free to take a look at the code yourself, but to summarize.
Event and message subscriptions are queried against the "latest" deployment (i.e. the one currently deployed) and associated tenant ID. The resulting list is iterated over and the subscription is deleted.
After each step, the new subscriptions for the process definition being deployed are added.
Not sure what you mean by "not all event subscriptions", perhaps you can provide a specific example (preferably as a unit test).
Thanks,
Greg
Hi Greg,
I have upgraded Activiti to version 5.22.0 and the query to select event subscriptions (used during deployment of new version) is now make sense. Only event subscriptions WITHOUT execution ID and process instance ID:
select *
from ${prefix}ACT_RU_EVENT_SUBSCR
<where>
<if test="parameter.eventType != null">
(EVENT_TYPE_ = #{parameter.eventType})
</if>
and PROC_DEF_ID_ = #{parameter.processDefinitionId}
and EXECUTION_ID_ is null
and PROC_INST_ID_ is null
<if test="parameter.tenantId != null">
and TENANT_ID_ = #{parameter.tenantId}
</if>
<if test="parameter.tenantId == null">
and (TENANT_ID_ = '' or TENANT_ID_ is null)
</if>
</where>
but in version 5.20.0 was
select *
from ${prefix}ACT_RU_EVENT_SUBSCR
where (EVENT_TYPE_ = #{parameter.eventType})
and (
(CONFIGURATION_ = #{parameter.configuration})
or
(PROC_DEF_ID_ = #{parameter.configuration})
)
<if test="parameter.tenantId != null">
and TENANT_ID_ = #{parameter.tenantId}
</if>
<if test="parameter.tenantId == null">
and (TENANT_ID_ = '' or TENANT_ID_ is null)
</if>
which select all event subscriptions for previous version of process definition. I think that was big bug.
Fersmi
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.