03-27-2017 08:58 PM
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.
03-28-2017 02:23 PM
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
03-28-2017 02:23 PM
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
03-28-2017 04:12 PM
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?
03-28-2017 05:02 PM
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
03-31-2017 06:04 PM
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.
11-30-2022 05:44 AM
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 !
Explore our Alfresco products with the links below. Use labels to filter content by product module.