<?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 Upgraded from Activiti 5.22 to 6.0.1, how to get RuntimeServices from script task in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/upgraded-from-activiti-5-22-to-6-0-1-how-to-get-runtimeservices/m-p/33395#M14125</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Took over some existing models&amp;nbsp;that were used with Activiti 5.22 that made calls similar to this:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; execution.getEngineServices().getRuntimeService().setVariables(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; execution.getId(),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {'blah1': execution.getVariable('blah1'), 'blah2Key': 'blah2Val'});&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;getEngineServices is not part of DelegateExecution in Activiti 6, so not sure how to change so the results are identical to what we were doing in 5.22.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm guessing the following call would result in variables being set on a&amp;nbsp;different&amp;nbsp;scope:&lt;/P&gt;&lt;P&gt;execution.setVariables({'...': '...'});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Apr 2018 17:58:14 GMT</pubDate>
    <dc:creator>ens121</dc:creator>
    <dc:date>2018-04-12T17:58:14Z</dc:date>
    <item>
      <title>Upgraded from Activiti 5.22 to 6.0.1, how to get RuntimeServices from script task</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/upgraded-from-activiti-5-22-to-6-0-1-how-to-get-runtimeservices/m-p/33395#M14125</link>
      <description>Took over some existing models&amp;nbsp;that were used with Activiti 5.22 that made calls similar to this:&amp;nbsp; &amp;nbsp; execution.getEngineServices().getRuntimeService().setVariables(&amp;nbsp; &amp;nbsp; &amp;nbsp; execution.getId(),&amp;nbsp; &amp;nbsp; &amp;nbsp; {'blah1': execution.getVariable('blah1'), 'blah2Key': 'blah2Val'});getEngineServices is not part of Delega</description>
      <pubDate>Thu, 12 Apr 2018 17:58:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/upgraded-from-activiti-5-22-to-6-0-1-how-to-get-runtimeservices/m-p/33395#M14125</guid>
      <dc:creator>ens121</dc:creator>
      <dc:date>2018-04-12T17:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Upgraded from Activiti 5.22 to 6.0.1, how to get RuntimeServices from script task</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/upgraded-from-activiti-5-22-to-6-0-1-how-to-get-runtimeservices/m-p/33396#M14126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;execution.setVariables({'...': '...'}) should just work!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, did you try&amp;nbsp;runtimeService.setVariables( execution.getId(), {});? The &lt;A href="https://github.com/Activiti/Activiti/blob/6.x/modules/activiti-ui/activiti-app-conf/src/main/java/org/activiti/app/conf/ActivitiEngineConfiguration.java" rel="nofollow noopener noreferrer"&gt;runtimeService&lt;/A&gt; bean should be available in the script context.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 13:44:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/upgraded-from-activiti-5-22-to-6-0-1-how-to-get-runtimeservices/m-p/33396#M14126</guid>
      <dc:creator>cjose</dc:creator>
      <dc:date>2018-04-20T13:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Upgraded from Activiti 5.22 to 6.0.1, how to get RuntimeServices from script task</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/upgraded-from-activiti-5-22-to-6-0-1-how-to-get-runtimeservices/m-p/33397#M14127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did get it to work by using Context:&lt;/P&gt;&lt;P&gt;org.activiti.engine.impl.context.Context.getProcessEngineConfiguration().getRuntimeService().setVariables(...);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't realize runtimeService was directly available to the script, so removing Context.getProcessEngineConfiguration() works great. Much cleaner solution. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 15:30:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/upgraded-from-activiti-5-22-to-6-0-1-how-to-get-runtimeservices/m-p/33397#M14127</guid>
      <dc:creator>ens121</dc:creator>
      <dc:date>2018-04-20T15:30:06Z</dc:date>
    </item>
  </channel>
</rss>

