cancel
Showing results for 
Search instead for 
Did you mean: 

Signals deleted on new process deployment

lucas_matw
Champ in-the-making
Champ in-the-making
Hello!

We have been using Activiti for a long time and never got this problem.

When a new version of the same process is deployed, Activiti deletes existing signals (ACT_RU_EVENT_SUBSCR table).

Is this possible?
We put a foreign key referencing a signal's id and Activiti couldn't deploy the new process.

Is there any changes on the process that could make this happen?

Activiti version: 5.19.0, schema version: 5.18.0.1

Thanks!











9 REPLIES 9

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

"old" subscriptions are deleted during "new" process version deployment.
example:
org.activiti.engine.test.bpmn.event.signal.SignalEventTest#testSignalDeleteOnRedeploy

Regards
Martin

jbarrez
Star Contributor
Star Contributor
Hmm what kind of signals are we talking about here? Boundary events/start signals?
Someone on the forum also said something similar … we'll investigate.

lucas_matw
Champ in-the-making
Champ in-the-making
Hello, sorry for the delay.

Hmm I'm pretty sure it's the first time that subscriptions get rid on new process deployment (idk if it was working as intended).

Refering this test:
org.activiti.engine.test.bpmn.event.signal.SignalEventTest#testSignalDeleteOnRedeploy

There's something I don't get:

<java>
// Firing a signal start event should only start ONE process instance
// This used to be two, due to subscriptions not being cleaned up
runtimeService.signalEventReceived("The Signal");
assertEquals(3, runtimeService.createProcessInstanceQuery().count());
</java>

Why it says "should only start ONE process instance" but asserts with 3?

Deleted subscriptions are Boundary Events.

We added a new boundary event in the process and noticed a little difference.
Old events have NULL on column CONFIGURATION_  while  the new event has <javascript>{"scope":"global"} </javascript>.


Thanks

Lucas.

jbarrez
Star Contributor
Star Contributor
We've fixed this behaviour last week: https://github.com/Activiti/Activiti/commit/5ffac043e8d25a5940593038f2da2bcad0cf6592
There was indeed something wrong there on redeploy.

Wrt the test you mention, it is correct. The process xml contains 3 process definitions that would be triggered when the signal is received: https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/test/resources/org/acti...

lucas_matw
Champ in-the-making
Champ in-the-making
Hello again

We updated Activiti to 5.19.0.2 (new schema version is 5.20.0.1) and made many redeploys but still having the same issue.

Is there anything we could be doing wrong?

To be more confident, a foreign key referencing an event subscription was added and this showed up on console.

<code>
2016-02-12 13:10:42,776 - [[info]] application - Deployment ID:27510 - OI Notification 1.0 @Wed Jul 29 10:55:40 ART 2015
2016-02-12 13:10:42,849 - [[info]] o.a.e.i.b.d.BpmnDeployer - Processing resource processes/venta-3.0.bpmn20.xml
2016-02-12 13:10:46,298 - [[error]] application - Couldn't deploy
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`activiti`.`signal_fk`, CONSTRAINT `fk_signal_fk_1` FOREIGN KEY (`fk_evt_sbcr`) REFERENCES `ACT_RU_EVENT_SUBSCR` (`ID_`) ON DELETE NO ACTION ON UPDATE NO ACTION)
### The error may involve org.activiti.engine.impl.persistence.entity.EventSubscriptionEntity.deleteSignalEventSubscription-Inline
### The error occurred while setting parameters
### SQL: delete from ACT_RU_EVENT_SUBSCR where ID_ = ? and REV_ = ?
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`activiti`.`signal_fk`, CONSTRAINT `fk_signal_fk_1` FOREIGN KEY (`fk_evt_sbcr`) REFERENCES `ACT_RU_EVENT_SUBSCR` (`ID_`) ON DELETE NO ACTION ON UPDATE NO ACTION)
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.3.0.jar:3.3.0]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:172) ~[mybatis-3.3.0.jar:3.3.0]
at org.apache.ibatis.session.defaults.DefaultSqlSession.delete(DefaultSqlSession.java:185) ~[mybatis-3.3.0.jar:3.3.0]
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`activiti`.`signal_fk`, CONSTRAINT `fk_signal_fk_1` FOREIGN KEY (`fk_evt_sbcr`) REFERENCES `ACT_RU_EVENT_SUBSCR` (`ID_`) ON DELETE NO ACTION ON UPDATE NO ACTION)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_45]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_45]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_45]
2016-02-12 13:10:46,304 - [[info]] application - Deployment ID:995010 - Aop 1.0.0 @Mon Nov 09 16:21:25 ART 2015
2016-02-12 13:10:46,304 - [[info]] application - ActivitiPlugin started
2016-02-12 13:10:46,307 - [[info]] monitoring - Starting application
</code>

Thanks

Lucas.

trademak
Star Contributor
Star Contributor
Hi Lucas,

The fix that Joram points to is not part of 5.19.0.2, it's currently only on master.

Best regards,

lucas_matw
Champ in-the-making
Champ in-the-making
Hello Tijs,
My apologies, I misunderstood that part.
Thanks for the clarification.

Cheers,

Lucas.

lucas_matw
Champ in-the-making
Champ in-the-making
Hello guys

Is there any tentative release date containing this fix? One, two months? or sooner?

Thanks!

jbarrez
Star Contributor
Star Contributor
typically we release every three months. So most like next month.