versioning and auto deployment of processes
tom.baeyens Mar 1, 2006 3:44 AMThe problem
When starting a process execution in jBPM, this is typically done in the latest version of the process of a given name.
Currently, jBPM is responsible for assigning version numbers during the deployment of a process archive. So there is no relation between the process deployment and jboss server lifecycle. That is why currently it is a manual process and there is no automatic deployer for jBPM processes.
This is hard to match with the JBoss deployer architecture. A JBoss deployer will deploy every deployable file at boot time (each time).
Another consideration is that the solution should be easy for organisations that have split development from their production environment. In that scenario, the development team provides to the production guys a process archive and a description on how to deploy it on to the production system.
Also backup and restore of a whole jboss server (including the processes) should be taken into account. The JBoss way is that a server configuration contains all software and configurations that defines the whole server behaviour. In the case of jBPM, the processes are part of that and those must live in the database.
I'm looking into writing a JBoss deployer or other mechanism that can cope with this situation. There are 3 approaches that i can think of:
Alternative 1) Using the webconsole
A web console could list all the process definitions in a process deploy directory. Then an admin can just click on any of those processes for them to be deployed. This mechanism would not necessary need a JBoss Deployer.
Alternative 2) Adding a deployment file timestamp and/or file-hash
I suppose that the deployer can get a hold of the file descriptor (right?). So during deployment, the jBPM could get the file timestamp and add it to the process in the database. Similarly, a hash of the whole process archive file could be added to the process definition in the database. So that on subsequent scans and reboots, the jbpm archive deployer can compare the process archive in the deploy folder with the latest process definition in the jBPM database.
Alternative 3) Adding a version attribute
An optional 'version' attribute should be added to the 'process-definition' element. During deployment, jBPM will check wether this attribute is set.
If a version is specified, jBPM will only deploy the process if the given version number is higher then the current highest version for process definitions with the same name. Otherwise, a log message should say that the deployment is ignored because a newer version is present in the jBPM system.
If a version is not specified, things will remain as they are. Meaning that a version number will be assigned by jBPM.
regards, tom.