We used to get the EngineServices using the delegateExecution earlier in ServiceTask or TaskListener but I dont see that method in Activiti6.
I looked back through the commits and found that this change was made with the following commit:
Move to unified interfaces for DelegateExecution, ExecutionListener etc · Activiti/Activiti@af93157 · GitHub
The commit was made to the Activiti6 branch only in August 2015 by Tijs and had the title:
"Move to unified interfaces for DelegateExecution, ExecutionListener etc"
It looks as though the prefered way of getting to the Engine Services is now:
Hope this helps,
I downloaded the Activiti 6.0.0.Beta4, which includes the most up-to-date UserGuide with the download.The section for how to do what you're describing in Activiti5 (located here in the UserGuide), is identical to that section within the Activiti 6.0.0.Beta4 documentation.Are you saying you've attempted this and it doesn't seem to be exposed? There could be a potential issue in the Beta version, or the documentation may be off.-JEarlesbp3
I ran a quick check and you are absolutely correct.
The getEngineServices method has been removed from the DelegateExecution class in Activiti 6.
This will cause a huge issue when upgrading applications from version 5.??
I will reach out to the dev leads and see what's up.
In the interim, you can retrieve the ProcessEngineConfiguration from the Spring Context and from there get the engine Services:
Sit tight, this is a pretty big deal (at least in my mind).
I have created a Jira to document this change so as to avoid any migration issues:
Now how do I get the instance of context in a service task. All we have is an instance of delegateExecution.
Use the org.activiti.engine.impl.context.Context class. It includes a static method to get the process engine services:
Retrieving data ...