Red Hat Training

A Red Hat training course is available for Red Hat Process Automation Manager

Chapter 5. Migrating Java project data

Projects that you developed in Java code in Red Hat JBoss BPM Suite 6.4 (for example, in Eclipse) also require modification for Red Hat Process Automation Manager 7.0. You must update the dependencies in the pom.xml file for each project, upgrade the database configured for the project, and rebuild the project. To migrate your Java client applications, you also must update the dependencies in the pom.xml file for each project. If your application uses embedded Red Hat JBoss BPM Suite engines (jBPM, Drools, OptaPlanner), this change also updates the engines. If the application calls the Process Server, the API client library is updated.

5.1. Update Java project dependencies

You must update several dependencies in your Java projects to prepare them for migration to Red Hat Process Automation Manager 7.0.

Prerequisite

The Maven repository for Red Hat Process Automation Manager 7.0 has been downloaded from the Red Hat Customer Portal and made available to the local Maven installation (as a local or remote repository).

Procedure

  1. Open the pom.xml file of the project and remove the <version> tag from any dependencies under the following groups:

    • org.kie
    • org.drools
    • org.jbpm
    • org.optaplanner
  2. Add the following dependency under the <dependencies> tag within the <dependencyManagement> section:

    <dependency>
      <groupId>org.jboss.bom</groupId>
      <artifactId>rhpam-platform-bom</artifactId>
      <version>${rhpam.version}</version>
      <scope>import</scope>
      <type>pom</type>
    </dependency>

    The ${rhpam.version} is the version of the org.jboss.bom:rhpam-platform-bom artifact in the Maven repository for Red Hat Process Automation Manager 7.0. You can view the version of the artifact by entering the repository and navigating to the maven-repository/org/jboss/bom/rhpam/rhpam-platform-bom directory. The name of the only sub-directory in this directory is the version. For example: 7.0.0.GA-redhat-1.

  3. If your code uses any Drools CDI annotations (@KReleaseId , @KContainer, @KBase, @KSession), also add the following dependency:

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-cdi</artifactId>
    </dependency>

    This dependency is necessary because the CDI extension for processing the annotations is now defined using a separate module. Without this dependency, the annotations do not work.

  4. Replace the legacy jbpm-workitems dependency (if applicable) with one or more of the new dependencies. The new dependencies that you choose depend on the work items that your code uses.

    Legacy jbpm-workitems dependency:

    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-workitems</artifactId>
    </dependency>

    New jbpm-workitems dependency options:

    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-workitems-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-workitems-bpmn2</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-workitems-email</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-workitems-jms</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-workitems-rest</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-workitems-webservice</artifactId>
    </dependency>
  5. Replace the legacy org.guvnor dependency (if applicable) with the new org.uberfire dependency.

    Legacy org.guvnor dependency:

    <dependency>
      <groupId>org.guvnor</groupId>
      <artifactId>guvnor-rest-client</artifactId>
    </dependency>

    New org.uberfire dependency:

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-rest-client</artifactId>
    </dependency>
  6. Replace the legacy org.kie.remote dependency (if applicable) with the new org.kie.server dependency.

    Legacy org.kie.remote dependency:

    <dependency>
      <groupId>org.kie.remote</groupId>
      <artifactId>kie-remote-client</artifactId>
    </dependency>

    New org.kie.server dependency:

    <dependency>
      <groupId>org.kie.server</groupId>
      <artifactId>kie-server-client</artifactId>
    </dependency>

    This dependency is necessary because Business Central no longer has execution server capabilities nor API endpoints related to the execution server.

  7. Update the version of the project artifact and save the pom.xml file.

5.2. Upgrade your database

Red Hat Process Automation Manager 7.0 contains updates to the database schema for optimal performance with the new Business Central and Process Server. You must update the Red Hat JBoss BPM Suite 6.4 database to be used with Red Hat Process Automation Manager 7.0 using one of the upgrade scripts provided with this release to accommodate the change.

Prerequisites

  • The Red Hat Process Automation Manager 7.0.0 Add-Ons distribution has been downloaded from the Red Hat Customer Portal and extracted to a temporary directory.
  • The database has been backed up, as a precaution.

Procedure

  1. Navigate to the extracted rhpam-7.0.0-add-ons folder in your temporary directory and extract the rhpam-7.0-migration-tool.zip sub-folder (if not extracted already).
  2. Navigate to the extracted rhpam-7.0-migration-tool folder and open the upgrade-scripts folder. This folder contains database upgrade scripts that are required for applying changes to the database model made in Red Hat Process Automation Manager 7.0.
  3. Log on to the Red Hat JBoss BPM Suite 6.4 database to be used with Red Hat Process Automation Manager 7.0 and run the relevant Red Hat Process Automation Manager 7.0 upgrade script, according to the supported database type. This prepares the database for Red Hat Process Automation Manager 7.0.
  4. If you use Quartz as your scheduling service, additionally run the quartz-upgrade.sql script provided in the relevant database folder within the upgrade-scripts folder. This script updates your Quartz version to 2.2.3 in compliance with Red Hat Process Automation Manager 7.0 requirements.

5.3. Verify the Java project migration

After you have migrated all Java project data and have upgraded the relevant database, rebuild the Java project to verify successful migration.

Prerequisites

  • Java project dependencies have been updated.
  • The Red Hat JBoss BPM Suite 6.4 database to be used with Red Hat Process Automation Manager 7.0 has been upgraded.
  • Maven 3.x or later is installed.
  • Java 8 or later is installed.

Procedure

  1. Rebuild each Java project using a regular Maven build.

    $ mvn clean install
  2. Review all project data in each build to confirm successful migration.

    If you encounter build errors, verify that the project dependencies have been updated correctly. To review other product changes that may have impacted your Java project, see Chapter 6, Other migration considerations.