04-03-2017 04:29 AM
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.
04-03-2017 02:20 PM
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
04-04-2017 04:20 AM
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
04-04-2017 11:04 AM
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!
04-05-2017 01:49 PM
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
04-06-2017 06:09 AM
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
04-06-2017 07:16 AM
Explore our Alfresco products with the links below. Use labels to filter content by product module.