cancel
Showing results for 
Search instead for 
Did you mean: 

Getting application context from JavaDelegate

lossril
Champ in-the-making
Champ in-the-making
Hello,

My Activiti runs as webapp on Tomcat. I need to get its ApplicationContext in JavaDelegate, which is invoked in some process instance inside the Activiti. How should I do it?
2 REPLIES 2

vasile_dirla
Star Contributor
Star Contributor
Hi,
A solution could be to create a spring bean which implements ApplicationContextAware,
and then just inject this bean reference into your java delegate.
http://www.activiti.org/userguide/#serviceTaskFieldInjection

jbarrez
Star Contributor
Star Contributor
Or use the SpringProcessEngineConfiguration. If you then use 'delegateExpression' with the bean name, it looks up that Spring bean.