Access to expressionManager from EngineServices?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2014 03:15 PM
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:
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.
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?
cheers,
Tim
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 different languages.
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.
public void execute(ActivityExecution execution) { … ProcessEngineConfigurationImpl svcs = (ProcessEngineConfigurationImpl) execution.getEngineServices(); ExpressionManager em = svcs.getExpressionManager();
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?
cheers,
Tim
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2014 03:05 AM
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).
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2014 05:04 AM
Cheers Frederik, I used the Context.getProcessEngineConfiguration as suggested and submitted a pull request: https://github.com/Activiti/Activiti/pull/205
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2016 11:01 AM
How are the 'htmlVar' and/or 'textVar' variables assigned in the designer?
