<?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: Java service classes in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/java-service-classes/m-p/134550#M94456</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot, Frederik, that really helped my understanding. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Apr 2013 07:22:31 GMT</pubDate>
    <dc:creator>sheublein</dc:creator>
    <dc:date>2013-04-25T07:22:31Z</dc:date>
    <item>
      <title>Java service classes</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-service-classes/m-p/134548#M94454</link>
      <description>Hi Forum,I am currently trying to integrate Activiti with an application that is being developed at my company. I am still on a very low level regarding the understanding of Activiti and the interaction of its components but something struck me that I could not answer from reading the (btw excellent</description>
      <pubDate>Tue, 23 Apr 2013 14:15:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-service-classes/m-p/134548#M94454</guid>
      <dc:creator>sheublein</dc:creator>
      <dc:date>2013-04-23T14:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Java service classes</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-service-classes/m-p/134549#M94455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The JavaDelegate implementation is indeed shared between process-instances. Process-variables (set when starting the process, through API or by activities in the process) are stored in the database for each process-instance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So if you have a process that is started by user X, you can use the activiti:initiator="personWhoStarted" construction (see user guide). Once your service-task is reached, you can use the DelegateExecution to extract the value of the "personWhoStarted" variable for the current process instance, using delegateExecution.getVariable("personWhoStarted"). This value can now be used to call your external service, being 100% sure that the call to that service is using the user for the process involved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another way to extract variables from the execution in a service-task is to use Field-injection (see user guide again). This field is stateless and thus can be shared between all instances. Once the javaDelegate is called, you can get the value of the field, based on the current process-instance (by passing in the DelegateExecution when getting value).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you don't want to use JavaDelegates that are shared, you can always use, for example, spring-beans (using activiti:delegateExpression) or methods on spring-beans (or non-spreing beans set at configuration time), passing in execution-variables along with it (activiti:expression). Again, this is described in the user guide in more detail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you really really really want to create your own delegate classes, you can have the "delegateExpression" return a new instance every time. off course, if you think about the "stateless" nature of the process-logic Java, it makes no sense to have new instance every time. The logic in the delegates should use the process-variables and state…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 09:26:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-service-classes/m-p/134549#M94455</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-04-24T09:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Java service classes</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-service-classes/m-p/134550#M94456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot, Frederik, that really helped my understanding. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2013 07:22:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-service-classes/m-p/134550#M94456</guid>
      <dc:creator>sheublein</dc:creator>
      <dc:date>2013-04-25T07:22:31Z</dc:date>
    </item>
  </channel>
</rss>

