To use the DeployProcessToServer Task you need to define a new task using the taskdef command
<taskdef name="deployToServer" classname="org.jbpm.ant.DeployProcessToServerTask">
<classpath refid="exec-classpath"/>
</taskdef>
So here I defined a task called 'deployToServer', but you can call it whatever you want. The classpath should obviously point to the jar containing this class. The 'deployToServer' can either deploy a Process Archive (PAR), which is a zip file containing the files you want to deploy, or you can specify a set of files which it will zip up and deploy for you. You can use the following attributes and subelements:
Attribute | Description | Default value |
---|---|---|
process | The location of process archive | - |
servername | The name of the server which is used to build the deployment url | localhost |
serverport | The port to which the http protocol is bound | 8080 |
serverdeployer | The address of the deployer servlet | /jbpm-console/upload |
debug | Debug flag which, if set, writes out a debug.par zip file. This is especially useful if fileSet subelements are used, so you can check what gets loaded to the server | - |
SubElement | Description | Default value |
fileSet | A fileSet element | - |
The following xml fragment deploys all the files in the processDefinition directory to the server
<target name="deployProcess" description="deploys the process definition">
<echo>Deploy the process definition</echo>
<taskdef name="deployToServer" classname="org.jbpm.ant.DeployProcessToServerTask">
<classpath refid="exec-classpath"/>
</taskdef>
<deployToServer>
<fileset dir="${basedir}/processDefinition" includes="*"/>
</deployToServer>
</target>
Or if you already have a par archive ready to go you could reference that
<target name="deployProcess" description="deploys the process definition">
<echo>Deploy the process definition</echo>
<taskdef name="deployToServer" classname="org.jbpm.ant.DeployProcessToServerTask">
<classpath refid="exec-classpath"/>
</taskdef>
<deployToServer process="${build}/process.par"/>
</target>
5 comments:
Nice work!
I can use this.
I have authentication configured in my jbpm-console. How can I use this ant script with it?
You'll need to add some code for the authentication, you can probably lift it from the jBPM Designer plugin code, which is doing the very same thing.
--Kurt
Hi Kurt,
thanks for this!
Just another question: is there any chance to deploy processes to jbpm (installed within the jboss esb) without the server running? I would need that for installation procedures at the customers sites. Otherwise the installation needs to include a complete jboss as boot, then the ant script running and a shutdown of the server. Also, the data directory should not be deleted, which is sometimes necessary to get a clean state for the application server.
Any idea? Or did I get something completely wrong? I couldn't find so far a "usual" offline deployment procedure for jbpm processes (like putting the .par file into a deploy directory).
Thanks,
Andre
If you *don't* use an embedded database you should be able to use
http://docs.jboss.com/jbpm/v3/userguide/jpdl.html#deployingaprocessarchiveNote that the class got renamed
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4078036#4078036-K
Post a Comment