<?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: Service task with properties in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/service-task-with-properties/m-p/243196#M196326</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;case 1. "I think it's safe" i said that because I really think it's safe. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; (nobody is perfect so there is a chance for me to be wrong, but I still think it's safe) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;now let's take it seriously.. yes it's safe to use prototype.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As the documentation said:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"using field injection is not thread-safe"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;because by default you'll get the same bean instance and you can change the value of the field from another thread.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;by using prototype is safe because on another call you'll get another instance and will change the field of another bean instance. (so it's safe 100%)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;case 2: yes you can create a spring bean which implements the JavaDelegate interface.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this way you'll have to implement a method execute(DelegateExecution) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but you can also create a spring bean which does not implements JavaDelegate but still have access to the DelegateExecution&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;serviceTask id="javaService"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="Start App Service Task"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; activiti:expression="#{myBean.startApp(execution, appType , appName, appParam)}" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"The first parameter passed is the DelegateExecution, which is available in the expression context by default available as execution"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;appType , appName, appParam: should also be Expressions inside your bean.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Nov 2016 10:18:17 GMT</pubDate>
    <dc:creator>vasile_dirla</dc:creator>
    <dc:date>2016-11-03T10:18:17Z</dc:date>
    <item>
      <title>Service task with properties</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/service-task-with-properties/m-p/243192#M196322</link>
      <description>Hi all,I am an Activiti novice. My company gave me a task of converting their current process engine over to Activiti. Current process engine is executing services (java API calls) in defined order, everything is specified using XML, similar to Activiti.&amp;nbsp; So I am using service tasks and each service</description>
      <pubDate>Mon, 31 Oct 2016 11:38:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/service-task-with-properties/m-p/243192#M196322</guid>
      <dc:creator>natedawg</dc:creator>
      <dc:date>2016-10-31T11:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Service task with properties</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/service-task-with-properties/m-p/243193#M196323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;case 1: "Scope prototype means that every time you ask spring (getBean or dependency injection) for an instance it will create a new instance and give a reference to that." so I think it's safe.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;case 2: I didn't understand what exactly you want to do by "rrewrite the Java delegate to use an expression" can you give an example (some code).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Probably you already know but here you can find some more details about service tasks:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.activiti.org/userguide/#bpmnJavaServiceTask" rel="nofollow noopener noreferrer"&gt;http://www.activiti.org/userguide/#bpmnJavaServiceTask&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2016 08:12:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/service-task-with-properties/m-p/243193#M196323</guid>
      <dc:creator>vasile_dirla</dc:creator>
      <dc:date>2016-11-01T08:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Service task with properties</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/service-task-with-properties/m-p/243194#M196324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Vasile,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for a quick reply and sorry for a late answer, I was away from work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regarding case 1, I am aware of how prototype works but I see you also stated that you "think it's safe". Does it means there are some level of uncertainty?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regarding case 2: "rewrite the Java delegate to use an expression and passing the needed data to the delegate via a method arguments" is a sentence literally taken from &lt;/SPAN&gt;&lt;A href="http://www.activiti.org/userguide/#serviceTaskFieldInjectionThreadSafety" rel="nofollow noopener noreferrer"&gt;Activity documentation &lt;/A&gt;&lt;SPAN&gt;. I am wondering if my Spring bean can implement JavaDelegate so I can write a method that allows me to specify all needed parameters, ex. startApp(String appType, String appName, String appParam), while still have access to DelegateExecution-object (I need to store processInstanceId temporarly so I can reuse it later to correlate a response-message in the process instance). If this is doable, case 2 sounds lot more like a bulletproof solution than case 1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As it is today, there are times where up to hundred of processes can be started simultaneously so in my case thread-safety is critical.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A.H.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 08:59:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/service-task-with-properties/m-p/243194#M196324</guid>
      <dc:creator>natedawg</dc:creator>
      <dc:date>2016-11-03T08:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Service task with properties</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/service-task-with-properties/m-p/243195#M196325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Vasile,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx againg for a very quick response. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Your answer regarding case 2 sounds like a dream, I will try to change my code during this day and tomorrow, and test a bit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx a lot&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A.H.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 09:54:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/service-task-with-properties/m-p/243195#M196325</guid>
      <dc:creator>natedawg</dc:creator>
      <dc:date>2016-11-03T09:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Service task with properties</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/service-task-with-properties/m-p/243196#M196326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;case 1. "I think it's safe" i said that because I really think it's safe. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; (nobody is perfect so there is a chance for me to be wrong, but I still think it's safe) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;now let's take it seriously.. yes it's safe to use prototype.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As the documentation said:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"using field injection is not thread-safe"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;because by default you'll get the same bean instance and you can change the value of the field from another thread.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;by using prototype is safe because on another call you'll get another instance and will change the field of another bean instance. (so it's safe 100%)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;case 2: yes you can create a spring bean which implements the JavaDelegate interface.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this way you'll have to implement a method execute(DelegateExecution) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but you can also create a spring bean which does not implements JavaDelegate but still have access to the DelegateExecution&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;serviceTask id="javaService"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="Start App Service Task"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; activiti:expression="#{myBean.startApp(execution, appType , appName, appParam)}" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"The first parameter passed is the DelegateExecution, which is available in the expression context by default available as execution"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;appType , appName, appParam: should also be Expressions inside your bean.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 10:18:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/service-task-with-properties/m-p/243196#M196326</guid>
      <dc:creator>vasile_dirla</dc:creator>
      <dc:date>2016-11-03T10:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Service task with properties</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/service-task-with-properties/m-p/243197#M196327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;don't forget, the community is waiting your result. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 10:19:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/service-task-with-properties/m-p/243197#M196327</guid>
      <dc:creator>vasile_dirla</dc:creator>
      <dc:date>2016-11-03T10:19:15Z</dc:date>
    </item>
  </channel>
</rss>

