<?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: Difference between activiti:delegateExpression and activiti:class. Bug? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/difference-between-activiti-delegateexpression-and-activiti/m-p/205522#M158652</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I seem to be unable to edit the above post in which I have spotted a few errors - they are as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;"When using activiti:delegateExpression, one instance of a JavaDelegate, peroid." should read: "When using activiti:delegateExpression, one instance of a JavaDelegate &amp;lt;b&amp;gt;is created&amp;lt;/b&amp;gt;, peroid."&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;The &amp;lt;code&amp;gt;JavaDelegate&amp;lt;/code&amp;gt; code snippet should have &amp;lt;code&amp;gt;implements JavaDelegate&amp;lt;/code&amp;gt;&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;"Now, if an instance of bpmn1 is started, when it reaches the serviceTask it will initialise all three of the Expression's in the JavaDelegate." should read: "Now, if an instance of bpmn1 is started, when it reaches the serviceTask it will initialise &amp;lt;b&amp;gt;both&amp;lt;/b&amp;gt; of the Expression's in the JavaDelegate."&lt;/LI&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;LI&gt;"For the time being, we are nullifying each of the Expression's at the end of the exectute method in each of our JavaDelegate's" - I am aware this may cause concurrency issues, and will be testing to prove that shortly. If anyone can suggest an alternative approach, it would be much appreciated!&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Aug 2015 22:52:24 GMT</pubDate>
    <dc:creator>richardmward</dc:creator>
    <dc:date>2015-08-20T22:52:24Z</dc:date>
    <item>
      <title>Difference between activiti:delegateExpression and activiti:class. Bug?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/difference-between-activiti-delegateexpression-and-activiti/m-p/205521#M158651</link>
      <description>Hi,I have come across what I think may be a bug with the use of activiti:delegateExpression‍ as an alternative to activiti:class‍on both serviceTask‍'s and taskListener‍'s.When using activiti:class‍, one instance of a JavaDelegate‍&amp;nbsp; is created for each serviceTask‍ in a ProcessDefinition‍. When usin</description>
      <pubDate>Thu, 20 Aug 2015 15:33:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/difference-between-activiti-delegateexpression-and-activiti/m-p/205521#M158651</guid>
      <dc:creator>richardmward</dc:creator>
      <dc:date>2015-08-20T15:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between activiti:delegateExpression and activiti:class. Bug?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/difference-between-activiti-delegateexpression-and-activiti/m-p/205522#M158652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I seem to be unable to edit the above post in which I have spotted a few errors - they are as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;"When using activiti:delegateExpression, one instance of a JavaDelegate, peroid." should read: "When using activiti:delegateExpression, one instance of a JavaDelegate &amp;lt;b&amp;gt;is created&amp;lt;/b&amp;gt;, peroid."&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;The &amp;lt;code&amp;gt;JavaDelegate&amp;lt;/code&amp;gt; code snippet should have &amp;lt;code&amp;gt;implements JavaDelegate&amp;lt;/code&amp;gt;&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;"Now, if an instance of bpmn1 is started, when it reaches the serviceTask it will initialise all three of the Expression's in the JavaDelegate." should read: "Now, if an instance of bpmn1 is started, when it reaches the serviceTask it will initialise &amp;lt;b&amp;gt;both&amp;lt;/b&amp;gt; of the Expression's in the JavaDelegate."&lt;/LI&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;LI&gt;"For the time being, we are nullifying each of the Expression's at the end of the exectute method in each of our JavaDelegate's" - I am aware this may cause concurrency issues, and will be testing to prove that shortly. If anyone can suggest an alternative approach, it would be much appreciated!&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 22:52:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/difference-between-activiti-delegateexpression-and-activiti/m-p/205522#M158652</guid>
      <dc:creator>richardmward</dc:creator>
      <dc:date>2015-08-20T22:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between activiti:delegateExpression and activiti:class. Bug?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/difference-between-activiti-delegateexpression-and-activiti/m-p/205523#M158653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&amp;lt;b&amp;gt;Current resolution&amp;lt;/b&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have removed out nullifiying code in order to not cause concurrency issues and instead have used &amp;lt;code&amp;gt;@Scope(BeanDefinition.SCOPE_PROTOTYPE)&amp;lt;/code&amp;gt; on the beans used as &amp;lt;code&amp;gt;JavaDelegate&amp;lt;/code&amp;gt;'s. This allows a new bean to be created each time it is accessed - i.e. a new bean will be created for each and every instance of a &amp;lt;code&amp;gt;serviceTask&amp;lt;/code&amp;gt;. Whilst this is slightly inefficient, we don't anticipate issues as looking through the Activiti code we see:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in &amp;lt;code&amp;gt;ServiceTaskDelegateExpressionActivityBehavior.execute(ActivitiExecution)&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// Note: we can't cache the result of the expression, because the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// execution can change: eg.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// delegateExpression='${mySpringBeanFactory.randomSpringBean()}'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Object delegate = expression.getValue(execution);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Following the references to &amp;lt;code&amp;gt;delegate&amp;lt;/code&amp;gt; from this point onwards, shows it being used in the following line (when the &amp;lt;code&amp;gt;delegate&amp;lt;/code&amp;gt; is an instance of &amp;lt;code&amp;gt;JavaDelegate&amp;lt;/code&amp;gt;):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(new JavaDelegateInvocation((JavaDelegate) delegate, execution));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And checking &amp;lt;code&amp;gt;handleInvocation&amp;lt;/code&amp;gt; I can see that the invocations are not held onto, so Activiti will release the delegates after they have executed, and then we can leave it to the garbage collector to clear the objects up.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2015 09:25:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/difference-between-activiti-delegateexpression-and-activiti/m-p/205523#M158653</guid>
      <dc:creator>richardmward</dc:creator>
      <dc:date>2015-08-21T09:25:56Z</dc:date>
    </item>
  </channel>
</rss>

