<?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: Injecting class in (JAVA) serviceTask manually for testing in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/injecting-class-in-java-servicetask-manually-for-testing/m-p/9476#M3390</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ah, now I see. A workaround could be to use the activiti-sessions instead of API to get execution-variables from parent, eg:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;CommandContext&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getCurrentSession(RuntimeSession.class)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .findVariableInstancesByExecutionId(parentExecutionId);&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;CommandContext&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getCurrentSession(RuntimeSession.class)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .findExecutionById(parentExecutionId);&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Since this is not part of the public API, we can't guarantee that the method-signature (or method itself) will remain the same over time. Also note that this code will only work when invoked from within a process-context (eg. taskListener or JavaDelegation).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Dec 2010 14:02:07 GMT</pubDate>
    <dc:creator>frederikherema1</dc:creator>
    <dc:date>2010-12-17T14:02:07Z</dc:date>
    <item>
      <title>Injecting class in (JAVA) serviceTask manually for testing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/injecting-class-in-java-servicetask-manually-for-testing/m-p/9473#M3387</link>
      <description>Is it possible to inject manually in the service task the class for testing purposes?As I read, the JavaDelegate object is injected in the process definition first time the process is instanced.The problem is that I would like to inject a RuntimeService component (the runtimeService from the Activit</description>
      <pubDate>Wed, 15 Dec 2010 11:59:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/injecting-class-in-java-servicetask-manually-for-testing/m-p/9473#M3387</guid>
      <dc:creator>sruiz</dc:creator>
      <dc:date>2010-12-15T11:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Injecting class in (JAVA) serviceTask manually for testing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/injecting-class-in-java-servicetask-manually-for-testing/m-p/9474#M3388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If your goal is to use the RuntimeService from within your JavaDelegate implementation, then you should rethink this &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The API is created to be used outside of the process-context. When you will try to use a service (eg. runtimeService) in the JavaDelegate, transactions an command-context will be messed up.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Dec 2010 13:58:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/injecting-class-in-java-servicetask-manually-for-testing/m-p/9474#M3388</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2010-12-15T13:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Injecting class in (JAVA) serviceTask manually for testing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/injecting-class-in-java-servicetask-manually-for-testing/m-p/9475#M3389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I agree that a rule of thumb should be &lt;/SPAN&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Don't change process flow with code, use only process variables&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't want to change flow using runtimeService. I only wanted to access to parent process variables within a subprocess&amp;nbsp; using ProcessInstanceQueries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Execution class should access to parent variables or a best solution: access to parent execution. Currently I can not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I only try to find a temporary solution to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://jira.codehaus.org/browse/ACT-313" rel="nofollow noopener noreferrer"&gt;http://jira.codehaus.org/browse/ACT-313&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://jira.codehaus.org/browse/ACT-354" rel="nofollow noopener noreferrer"&gt;http://jira.codehaus.org/browse/ACT-354&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; :cry: Excuse me, maybe the question shall be in other topic: &lt;/SPAN&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Access to parent variables within a sub-process with code&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want I open a new topic with this issue.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Dec 2010 07:40:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/injecting-class-in-java-servicetask-manually-for-testing/m-p/9475#M3389</guid>
      <dc:creator>sruiz</dc:creator>
      <dc:date>2010-12-16T07:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Injecting class in (JAVA) serviceTask manually for testing</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/injecting-class-in-java-servicetask-manually-for-testing/m-p/9476#M3390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ah, now I see. A workaround could be to use the activiti-sessions instead of API to get execution-variables from parent, eg:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;CommandContext&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getCurrentSession(RuntimeSession.class)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .findVariableInstancesByExecutionId(parentExecutionId);&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;CommandContext&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getCurrentSession(RuntimeSession.class)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .findExecutionById(parentExecutionId);&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Since this is not part of the public API, we can't guarantee that the method-signature (or method itself) will remain the same over time. Also note that this code will only work when invoked from within a process-context (eg. taskListener or JavaDelegation).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Dec 2010 14:02:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/injecting-class-in-java-servicetask-manually-for-testing/m-p/9476#M3390</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2010-12-17T14:02:07Z</dc:date>
    </item>
  </channel>
</rss>

