<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Critical Issue with EventSubProcessMessageStartEventActivityBehavior in Alfresco Activiti Integr in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/critical-issue-with/m-p/485406#M39717</link>
    <description>&lt;P&gt;could anyone comment this or maybe better to report it as issue to Alfresco team?&lt;/P&gt;</description>
    <pubDate>Thu, 12 Dec 2024 17:41:14 GMT</pubDate>
    <dc:creator>vnosach</dc:creator>
    <dc:date>2024-12-12T17:41:14Z</dc:date>
    <item>
      <title>Critical Issue with EventSubProcessMessageStartEventActivityBehavior in Alfresco Activiti Integratio</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/critical-issue-with/m-p/485221#M39705</link>
      <description>&lt;H4&gt;Part 1: Serialization of isInterrupting Attribute&lt;/H4&gt;&lt;P&gt;Activiti introduced a new attribute in &lt;FONT color="#FF6600"&gt;&lt;EM&gt;StartEvent&lt;/EM&gt; &lt;/FONT&gt;called &lt;FONT color="#FF6600"&gt;&lt;EM&gt;isInterrupting&lt;/EM&gt;&lt;/FONT&gt;. However, Alfresco has not implemented the serialization and deserialization of this attribute in JSON models.&lt;/P&gt;&lt;P&gt;Despite this, Alfresco relies on the &lt;FONT color="#FF6600"&gt;&lt;EM&gt;isInterrupting&lt;/EM&gt; &lt;/FONT&gt;parameter in the &lt;FONT color="#FF6600"&gt;&lt;EM&gt;EventSubProcessMessageStartEventActivityBehavior&lt;/EM&gt;&lt;/FONT&gt;. Since this parameter defaults to false due to the lack of proper implementation, &lt;STRONG&gt;message events are unable to cancel executions&lt;/STRONG&gt;, causing them to malfunction.&lt;/P&gt;&lt;H4&gt;Part 2: Handling Child Executions in Subprocesses&lt;/H4&gt;&lt;P&gt;In &lt;FONT color="#FF6600"&gt;&lt;EM&gt;EventSubProcessMessageStartEventActivityBehavior&lt;/EM&gt;&lt;/FONT&gt;, when &lt;FONT color="#FF6600"&gt;&lt;EM&gt;startEvent.isInterrupting()&lt;/EM&gt;&lt;/FONT&gt; is correctly evaluated as true, the implementation attempts to find and cancel child executions via &lt;FONT color="#FF6600"&gt;&lt;EM&gt;findChildExecutionsByParentExecutionId&lt;/EM&gt;&lt;/FONT&gt;. However, the logic does not account for &lt;STRONG&gt;inner subprocesses or nested child executions&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;As a result, when the &lt;FONT color="#FF6600"&gt;&lt;EM&gt;trigger&lt;/EM&gt; &lt;/FONT&gt;method is invoked, it leads to &lt;STRONG&gt;foreign key violations in the act_ru_execution table&amp;nbsp;&lt;/STRONG&gt;and rolling back transaction.&lt;/P&gt;&lt;H3&gt;Suggested Fixes:&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Serialization Fix&lt;/STRONG&gt;: Ensure the isInterrupting attribute is properly serialized and deserialized in the StartEventJsonConverter&amp;nbsp;to align with Activiti's implementation.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Nested Subprocess Handling&lt;/STRONG&gt;: Update EventSubProcessMessageStartEventActivityBehavior to handle child executions recursively, ensuring all nested subprocesses are correctly cancelled. code snippet from our custom implementation CustomExecutionEntityManagerImpl&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;    &lt;a href="https://connect.hyland.com/t5/user/viewprofilepage/user-id/31150"&gt;@override&lt;/a&gt;
    public void cancelExecutionAndRelatedData(ExecutionEntity executionEntity, String deleteReason) {
        getAllChildExecutionsHierarchically(executionEntity).forEach(execution -&amp;gt; super.cancelExecutionAndRelatedData(execution, deleteReason));
        super.cancelExecutionAndRelatedData(executionEntity, deleteReason);
    }

    protected List&amp;lt;ExecutionEntity&amp;gt; getAllChildExecutionsHierarchically(ExecutionEntity executionEntity) {
        return Stream.iterate(
                        findChildExecutionsByParentExecutionId(executionEntity.getId()),
                        CollectionUtils::isNotEmpty,
                        list -&amp;gt; list.stream()
                                .flatMap(child -&amp;gt; findChildExecutionsByParentExecutionId(child.getId()).stream())
                                .toList()
                ).flatMap(List::stream)
                .sorted(comparing(ExecutionEntity::getStartTime))
                .toList();
    }
​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 07 Dec 2024 16:59:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/critical-issue-with/m-p/485221#M39705</guid>
      <dc:creator>vnosach</dc:creator>
      <dc:date>2024-12-07T16:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Critical Issue with EventSubProcessMessageStartEventActivityBehavior in Alfresco Activiti Integr</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/critical-issue-with/m-p/485406#M39717</link>
      <description>&lt;P&gt;could anyone comment this or maybe better to report it as issue to Alfresco team?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 17:41:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/critical-issue-with/m-p/485406#M39717</guid>
      <dc:creator>vnosach</dc:creator>
      <dc:date>2024-12-12T17:41:14Z</dc:date>
    </item>
  </channel>
</rss>

