Chapter 5. Deploying custom tasks

Work item handlers, as custom code, are created outside of Red Hat Process Automation Manager. To use the code in your custom task, the code must be deployed to the server. Work item handler projects must be Java JAR files that can be placed into a Maven repository.

In Red Hat Process Automation Manager you can deploy custom tasks using three methods:

  • Within a Business Central service task repository. For more information, see Chapter 1, Managing service tasks in Business Central.
  • Within Business Central where you can use both the legacy and current editors to upload the work item handler JAR to the Business Central Maven repository as an artifact.
  • Outside of Business Central, you can manually copy the JAR files into the Maven repository.

5.1. Using a Business Central service task repository

You can enable, disable, and deploy service tasks within a Business Central service task repository. For more information, see Chapter 1, Managing service tasks in Business Central.

5.2. Uploading JAR Artifact to Business Central

You can upload the work item handler JAR to the Business Central Maven repository as an artifact by using the legacy and current editors.

Procedure

  1. In Business Central, select the Admin icon in the top-right corner of the screen and select Artifacts.
  2. Click Upload.
  3. In the Artifact Upload window, click the Choose File icon.
  4. Navigate to the location of the work item handler JAR, select the file and click Open.
  5. In the pop-up dialog, click the Upload icon.

    The artifact is uploaded and can now be viewed on the Artifacts page and referenced.

5.3. Manually copying work item definitions to Business Central Maven repository

Business Central automatically creates or reuses the Maven repository folder. By default the location is based on the location of the user launched Red Hat JBoss EAP. For example, the full default path would be <startup location>/repositories/kie/global. It is possible to replicate a standard Maven repository folder layout of <groupId>/<artifactId>/<versionId>/ in this folder and copy work item handler JAR files to this location. For example:

<startup location>/repositories/kie/global/com/redhat/myworkitem/1.0.0-SNAPSHOT/myworkitems-1.0.0-SNAPSHOT.jar

Any artifacts copied in this fashion are available to Red Hat Process Automation Manager without a server restart. Viewing the artifact in the Business Central Artifacts page requires clicking Refresh.