12-07-2024 11:59 AM
Activiti introduced a new attribute in StartEvent called isInterrupting. However, Alfresco has not implemented the serialization and deserialization of this attribute in JSON models.
Despite this, Alfresco relies on the isInterrupting parameter in the EventSubProcessMessageStartEventActivityBehavior. Since this parameter defaults to false due to the lack of proper implementation, message events are unable to cancel executions, causing them to malfunction.
In EventSubProcessMessageStartEventActivityBehavior, when startEvent.isInterrupting() is correctly evaluated as true, the implementation attempts to find and cancel child executions via findChildExecutionsByParentExecutionId. However, the logic does not account for inner subprocesses or nested child executions.
As a result, when the trigger method is invoked, it leads to foreign key violations in the act_ru_execution table and rolling back transaction.
@override
public void cancelExecutionAndRelatedData(ExecutionEntity executionEntity, String deleteReason) {
getAllChildExecutionsHierarchically(executionEntity).forEach(execution -> super.cancelExecutionAndRelatedData(execution, deleteReason));
super.cancelExecutionAndRelatedData(executionEntity, deleteReason);
}
protected List<ExecutionEntity> getAllChildExecutionsHierarchically(ExecutionEntity executionEntity) {
return Stream.iterate(
findChildExecutionsByParentExecutionId(executionEntity.getId()),
CollectionUtils::isNotEmpty,
list -> list.stream()
.flatMap(child -> findChildExecutionsByParentExecutionId(child.getId()).stream())
.toList()
).flatMap(List::stream)
.sorted(comparing(ExecutionEntity::getStartTime))
.toList();
}
This issue is critical as it directly impacts the proper functioning of interrupting message events. We would appreciate for a fix in upcoming release for this.
12-12-2024 12:41 PM
could anyone comment this or maybe better to report it as issue to Alfresco team?
Explore our Alfresco products with the links below. Use labels to filter content by product module.