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>