<?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 Access to expressionManager from EngineServices?  in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/access-to-expressionmanager-from-engineservices/m-p/165074#M118783</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;Since the mail service task has the body of the mail injected as fields (named html and text) it is not possible to modify that body elsewhere in the process. There are several use cases for this including: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;using a template stored externally in an ECM ; and&lt;/LI&gt; &lt;LI&gt;using different templates for different languages.&lt;/LI&gt;&lt;/UL&gt;&lt;SPAN&gt;I thought a simple answer would be to allow two more fields (htmlVar and textVar) that will hold the name of a process variable that will be populated with the template. Note that I still want to be able to embed ${processVariable}s in these templates and have them replaced by the service task. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is all working fine but I have not found an 'official' way to access the expression manager so for now I have to cast the EngineServices to the implementation class as shown below. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void execute(ActivityExecution execution) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; …&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessEngineConfigurationImpl svcs = (ProcessEngineConfigurationImpl) execution.getEngineServices();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExpressionManager em = svcs.getExpressionManager(); &lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Obviously this is pretty dirty so I wondered how you feel about exposing the expressionManager on the EngineServices interface? Or is there some other way that would be better to get one? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tim &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jan 2014 20:15:13 GMT</pubDate>
    <dc:creator>tstephen</dc:creator>
    <dc:date>2014-01-22T20:15:13Z</dc:date>
    <item>
      <title>Access to expressionManager from EngineServices?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/access-to-expressionmanager-from-engineservices/m-p/165074#M118783</link>
      <description>Hi, Since the mail service task has the body of the mail injected as fields (named html and text) it is not possible to modify that body elsewhere in the process. There are several use cases for this including: using a template stored externally in an ECM ; and using different templates for differen</description>
      <pubDate>Wed, 22 Jan 2014 20:15:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/access-to-expressionmanager-from-engineservices/m-p/165074#M118783</guid>
      <dc:creator>tstephen</dc:creator>
      <dc:date>2014-01-22T20:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Access to expressionManager from EngineServices?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/access-to-expressionmanager-from-engineservices/m-p/165075#M118784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The EngineServices exposes only public-facing API's. Expression-resolving is an internal thing (also uses a lot of org.activiti.*.impl.* classes), we don't want to expose this for the moment. Casting to a processEngineConfigurationImpl is fine, you can alternatively use Context.getProcessEngineConfiguration() (org.activiti.engine.impl.context.Context) - this is also an internal class, but at least you don't have to cast it. Be sure to ONLY use the org.activiti.engine.impl.context.Context class, when in the right context (so everywhere you get an EngineServices passed in is fine).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 08:05:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/access-to-expressionmanager-from-engineservices/m-p/165075#M118784</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2014-01-27T08:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Access to expressionManager from EngineServices?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/access-to-expressionmanager-from-engineservices/m-p/165076#M118785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Cheers Frederik, I used the Context.getProcessEngineConfiguration as suggested and submitted a pull request: &lt;/SPAN&gt;&lt;A href="https://github.com/Activiti/Activiti/pull/205" rel="nofollow noopener noreferrer"&gt;https://github.com/Activiti/Activiti/pull/205&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 10:04:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/access-to-expressionmanager-from-engineservices/m-p/165076#M118785</guid>
      <dc:creator>tstephen</dc:creator>
      <dc:date>2014-01-30T10:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Access to expressionManager from EngineServices?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/access-to-expressionmanager-from-engineservices/m-p/165077#M118786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How are the 'htmlVar' and/or 'textVar' variables assigned in the designer?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 15:01:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/access-to-expressionmanager-from-engineservices/m-p/165077#M118786</guid>
      <dc:creator>psc1952</dc:creator>
      <dc:date>2016-05-02T15:01:48Z</dc:date>
    </item>
  </channel>
</rss>

