<?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: Custom Execution Listener triggered by VARIABLE_UPDATED event in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/custom-execution-listener-triggered-by-variable-updated-event/m-p/188109#M141239</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Tijs,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, it does not help in this case since the parent execution of the user task execution is the process execution and not the subprocess execution. I was surprised at the fact that there isn't a "subprocess" execution in this case. I'm wondering if that is a result of how my test template is defined. I've attached a copy of it. Note there are no UserTasks or Service Tasks in the process. The process simply flows directly into the subprocess.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was able to make this work in the following way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Override DefaultActivityBehaviorFactory.createSubprocActivityBehavior() method to return a custom class which has a field that stores the id of the subprocess from the template.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) In the execute method of the custom SubProcessActivityBehavior class set the subprocess id in a local variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Update the VARIABLE_UPDATED event listener class to find the scope for a subprocess using the local variable and the process definition. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String subprocessDefinitionId = (String)executionEntity.getVariableLocal(Constants.SUBPROCESS_DEFINITION_ID);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;scope = executionEntity.getProcessDefinition().findActivity(subprocessDefinitionId);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm still testing. But this seems to be working for us.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there an alternative approach that wouldn't require us to create a local variable?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Mar 2015 11:06:13 GMT</pubDate>
    <dc:creator>rhafner</dc:creator>
    <dc:date>2015-03-26T11:06:13Z</dc:date>
    <item>
      <title>Custom Execution Listener triggered by VARIABLE_UPDATED event</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-execution-listener-triggered-by-variable-updated-event/m-p/188107#M141237</link>
      <description>Our proprietary workflow engine supports firing a hierarchy of listeners (that are modeled) when a DataObject is updated. Process&amp;nbsp; DataObject-1&amp;nbsp; Listener-1 &amp;nbsp; Listener-2&amp;nbsp; Subprocess&amp;nbsp;&amp;nbsp;&amp;nbsp; DataObject-2&amp;nbsp;&amp;nbsp;&amp;nbsp; Listener-3 For example, when DataObject-2 is updated Listener-3 will run followed by Listener-2. Whe</description>
      <pubDate>Wed, 25 Mar 2015 11:56:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-execution-listener-triggered-by-variable-updated-event/m-p/188107#M141237</guid>
      <dc:creator>rhafner</dc:creator>
      <dc:date>2015-03-25T11:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Execution Listener triggered by VARIABLE_UPDATED event</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-execution-listener-triggered-by-variable-updated-event/m-p/188108#M141238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you try to get the parent execution of the current user task execution?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 07:30:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-execution-listener-triggered-by-variable-updated-event/m-p/188108#M141238</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2015-03-26T07:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Execution Listener triggered by VARIABLE_UPDATED event</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/custom-execution-listener-triggered-by-variable-updated-event/m-p/188109#M141239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Tijs,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, it does not help in this case since the parent execution of the user task execution is the process execution and not the subprocess execution. I was surprised at the fact that there isn't a "subprocess" execution in this case. I'm wondering if that is a result of how my test template is defined. I've attached a copy of it. Note there are no UserTasks or Service Tasks in the process. The process simply flows directly into the subprocess.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was able to make this work in the following way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Override DefaultActivityBehaviorFactory.createSubprocActivityBehavior() method to return a custom class which has a field that stores the id of the subprocess from the template.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) In the execute method of the custom SubProcessActivityBehavior class set the subprocess id in a local variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Update the VARIABLE_UPDATED event listener class to find the scope for a subprocess using the local variable and the process definition. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String subprocessDefinitionId = (String)executionEntity.getVariableLocal(Constants.SUBPROCESS_DEFINITION_ID);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;scope = executionEntity.getProcessDefinition().findActivity(subprocessDefinitionId);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm still testing. But this seems to be working for us.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there an alternative approach that wouldn't require us to create a local variable?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 11:06:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/custom-execution-listener-triggered-by-variable-updated-event/m-p/188109#M141239</guid>
      <dc:creator>rhafner</dc:creator>
      <dc:date>2015-03-26T11:06:13Z</dc:date>
    </item>
  </channel>
</rss>

