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:
- /activiti-spring-boot-starter-basic/src/main/java/org/activiti/spring/boot/ActivitiProperties.java - This file contains the getters and setters for the pathing that pulls the process resources in.
- /activiti-spring-boot-starter-basic/src/main/java/org/activiti/spring/boot/AbstractProcessEngineAutoConfiguration.java - This file is where the SpringProcessEngineConfiguration is established, which references the next file:
- /activiti-spring-boot-starter-basic/src/main/java/org/activiti/spring/boot/AbstractProcessEngineConfiguration.java - There is a method (discoverProcessDefinitionResources) inside of this file that combines the location prefix with the file suffix in order to make a list of auto-deployment files. After the engine is configure it's used within:
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