I have setup Activiti using Spring Boot integration. Per the default behavior, the *.bpm20.xml files needs to be under src/main/resources/processes for the Activiti engine to deploy when the spring boot app is run.
Is there a way to allow Activiti to auto deploy whenever I put in a new process xml file? This actually means in order to achieve this, I need to externalize the location for the *.bpm20.xml files so that the spring boot jar does not need to be repackaged every time I add a new file.
Solved! Go to Solution.
Sayantan,
I believe this should be possible, but it would take custom modification to Activiti Community in order to reach a functioning result. There are several resources 'listening' to file/folder changes in Java - feel free to go with the one you prefer. Then there are a several relevant files that I would look into within Activiti:
This was just an initial effort to find how and where these elements are being configured. Within this path of classes, you should be able to establish a listener that would either be a part of your ProcessEngine (so you'd have to add additional functionality to the ProcessEngine) or create a listener that would update/replace the ProcessEngine in the current context. I believe the first option is going to be least likely to cause you problems - but take a look at pros and cons as you pursue this, for sure.
Hope this helps get you started
-JEarles
Sayantan,
I believe this should be possible, but it would take custom modification to Activiti Community in order to reach a functioning result. There are several resources 'listening' to file/folder changes in Java - feel free to go with the one you prefer. Then there are a several relevant files that I would look into within Activiti:
This was just an initial effort to find how and where these elements are being configured. Within this path of classes, you should be able to establish a listener that would either be a part of your ProcessEngine (so you'd have to add additional functionality to the ProcessEngine) or create a listener that would update/replace the ProcessEngine in the current context. I believe the first option is going to be least likely to cause you problems - but take a look at pros and cons as you pursue this, for sure.
Hope this helps get you started
-JEarles
Thanks a lot for this insight. I will get started on this and see if I can build something custom. Is there any roadmap to make this a configurable item, like property based?
Sayantan,
It's certainly possible to make elements of this configurable options through properties - like, modifying the location that Activiti is looking for files, the frequency/method it's checking for new files, and so on. And it again, would certainly be possible to make this configurable through the UI. The biggest difficulty you're going to run into is that the ProcessEngine is configured during the initial boot, and these constitute changes to the ProcessEngine - so you'll need to make sure those changes are being propagated correctly, or that the ProcessEngine is being replaced when you create a new one.
I wouldn't really say I have a roadmap for a feature like this, and I haven't found any resources on other Activit users developing it - so it looks like you're the first
-JEarles
I think this should be a very standard feature and it would immensely help during development rather in production. Can this be implemented in a future version? I do understand the complexity involved, but with spring boot you probably could leverage a couple of things here:
One thing, to keep in mind here is that with @RefreshScope we can leverage to trigger the deploy with /refresh rather than a true auto deploy.
Hey everyOne,
i have the same need to do a hot deploy with activiti, did you find anything that can help me do it
Thanks !
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.