This Ant will help you to deploy a group of JBPM processes without having to upload one by one. The only requirements are:
- Ant (preferably the latest one)
- A server that accepts PAR files.
Since I've been working with JBPM, whenever we create a process, we store each process in a different directory, each one including a JPDL, a GPD, a JPG, and an optional metadata.xml
This project includes a process-directory-example
folder, to be used as a reference when
getting your process directory ready.
There is a file in the root directory called properties.properties
, update the
process_directory
with the path to your folder with the processes.
process_directory=~/projects/MyJBPMProject/processes
process_directory=C\:\\projects\\MyJBPMProject\\processes
The property process_name
lets you specify the name of a process to deploy, you can also add
wildcards to deploy several processes, and you can play with it to avoid deploying other
processes.
process_name=*
process_name=process*
process_name=processA
This is quiet straight forward, open properties.properties
, modify:
server=localhost
-- IP or domain of the serverport=8080
-- port...deployer=/jbpm-console/upload
-- path to the service used to deploy PAR files.
After configuring everything as stated above, run the ant in this directory. First navigate to
the path of your copy of jbpm-autodeploy, and run $ ant install
If you put JBPM AutoDeploy in Eclipse, you can do the following for the first time:
- Right Click
build.xml
- Run As > Ant Build...
- Go to "Targets" Tab
- Enable "install" (ONLY install!!)
- Run
For the next time, you will be able to:
- Right Click
build.xml
- Run As > Ant Build
Modify the property deploy_directory
to the path of your PAR files, they will be uploaded
one by one, and run $ ant deploy
BE CAREFUL! Some deployers require the PAR's (zipped) files be named named exactly as:
processdefinition.xml
, gpd.xml
, processimage.jpg
, and metadata.xml
$ ant build
DeployProcessToServerTask
-- Thanks to Kurt Stam @ Fresh Expresso- Ant Contrib