cancel
Showing results for 
Search instead for 
Did you mean: 

5.17 Engine - Dynamically Inject Configurations

solanki
Champ in-the-making
Champ in-the-making
Hi,

I want to use the new activiti 5.17. I understand the rest component is dependent on spring mvc, but is also dependent upon engine initialization because of auto-wiring of formService bean etc..

Is there a way we can decouple activiti engine initialization and rest services initialization, earlier the restlet servlet wasn't dependent on engine and we could initialize them separately. The reason to do so is we want to pass some parameters from our running application to engine initialization and hence we do it when the web-application is up and running(engine using container of our web-app), but with spring mvc all beans need to be initialized at start-up.

Also there is no concept of lazy loading of beans, so all beans have to be initialized at start-up and can only take static resources ( properties ) as input, anyway to dynamically inject information such as db params etc..

Thanks
solanki
1 REPLY 1

trademak
Star Contributor
Star Contributor
Well, you would need to hook into the Rest app Configuration classes. The Activiti Engine is initialized there so it can be injected into other beans. So you would need to add your parameters to the Configuration class to make it work. Just copy the activiti-webapp-rest2 application and customize the following class:

https://github.com/Activiti/Activiti/blob/master/modules/activiti-webapp-rest2/src/main/java/org/act...

Hope this helps.

Best regards,