Migrating from Red Hat JBoss BRMS 6.4 to Red Hat Decision Manager 7.0
Abstract
Preface
If you have Red Hat BRMS 6.4 projects that you want to use in Red Hat Decision Manager 7.0, you must first migrate the projects.
Prerequisite
You have a Red Hat BRMS 6.4 installation that contains artifacts that you want to migrate to Red Hat Decision Manager 7.0.
Chapter 1. Overview
If you use BRMS version 6.4 and install Red Hat Decision Manager version 7.0, you need to migrate your existing projects to the new product.
You can move the applications (now called decision services) that you developed using the Business Central workbench to the new equivalent, Decision Central. You do not need to change the underlying code manually to complete this migration.
Decision services that you developed in Java code (for example, in Eclipse) require modification for Red Hat Decision Manager 7.0. You must update the dependencies in the pom.xml
file for each project and rebuild the project. Some changes in the new version might cause known build errors; in this case, you must modify the code.
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 BRMS engines (Drools, OptaPlanner), this change also updates the engines. If the application calls the Decision Server, the API client library is updated.
If your client application is not developed with the Java client library and uses the REST API to interact with the KIE server (Decision Server), you might need to modify it to adapt to a small incompatible API change.
You can replace your KIE servers with new Decision Servers simply by stopping the old servers and starting the new ones on the same hosts. You can use Decision Server 7.0 to run KJAR files created in BRMS 6.4. However, for optimal performance, migrate your projects to Red Hat Decision Manager 7.0 and rebuild them.
If you are using a version of BRMS older than 6.4, migrate your projects to version 6.4 before migrating to 7.0. See the Red Hat JBoss BPM Suite 6.4 Migration Guide.
Chapter 2. Migrating projects in Decision Central
If you have created projects in the Business Central workbench in BRMS 6.4, you can migrate them to Red Hat Decision Manager 7.0 by importing the asset repository into Decision Central.
Prerequisites
-
In BRMS 6.4 Business Central, look up the names of the repositories that contain your project. The default repository name is
repository1
. - Stop BRMS 6.4 Business Central.
-
Locate the
.niogit
directory. In the default installation, its location is$EAP_home/bin/.niogit
. This location can be changed with theorg.uberfire.nio.git.dir
system property in the$EAP_home/standalone/configuration/standalone.xml
file. The system property can also be set with a-D
option in the command that starts Business Central. - Install the Red Hat Decision Manager, including Decision Central, on the same host as BRMS 6.4 Business Central, using a separate JBoss EAP installation. For instructions, see Installing Red Hat Decision Manager on premise.
Procedure
- Log in to Red Hat Decision Manager 7.0 Decision Central.
- In the main menu, select Projects.
- Click the icon and select Import Project.
In the Repository URL field, type the URL:
file://<path>/.niogit/<repository>.git
For example, if the location of the
.niogit
directory is/opt/eap7.0/bin/.niogit
and you want to import projects from therepository1
repository:file:///opt/eap7.0/bin/.niogit/repository1.git
- Click Import.
- Select the projects to import and click Import.
A
NoRemoteRepositoryException
exception might be displayed. In this case complete the following steps:-
In a shell terminal, change to the repository subdirectory (under the
.niogit
) directory you are importing -
List the remotes:
git remote -v
Remove all listed remotes:
git remote remove <remote-name>
For example:
$ /opt/eap7.0/bin/.niogit/repository1.git $ git remote -v origin https://github.com/guvnorngtestuser1/guvnorng-playground (fetch) origin https://github.com/guvnorngtestuser1/guvnorng-playground (push) $ git remote remove origin
Then import the projects again. (You can add the remotes in the new repository later if necessary).
-
In a shell terminal, change to the repository subdirectory (under the
- Wait for the importing and indexing to complete.
- Repeat the process for any other repositories that you wish to import.
Result
The projects are imported into Decision Central. You can build and deploy them as normal, using the Build & Deploy button.
If you have developed the project in Java and then imported it into the Business Central workbench, you might need to migrate the project as a Java project. For instructions, see Chapter 3, Migrating Java projects.
Chapter 3. Migrating Java projects
For Java projects that are not developed in Business Central workbench, you must modify the dependencies in the pom.xml
file and resolve any build issues. This process is the same for decision services and client applications written in Java.
Prerequisite
You must download the Maven repository for Red Hat Decision Manager 7.0 and make it available to the local Maven installation (as a local or remote repository).
Procedure
-
Open the
pom.xml
file of the project. Remove the
<version>
tag from any dependencies under the following groups:-
org.kie
-
org.drools
-
org.jbpm
-
org.optaplanner
-
Add the following dependency under the
<dependencies>
tag within the<dependencyManagement>
section:<dependency> <groupId>org.jboss.bom.rhdm</groupId> <artifactId>rhdm-platform-bom</artifactId> <version>${rhdm.version}</version> <scope>import</scope> <type>pom</type> </dependency>
Where
${rhdm.version}
is the version of theorg.jboss.bom.rhdm:rhdm-platform-bom
artifact in the Maven repository for Red Hat Decision Manager 7.0. You can view the version of the artifact by entering the repository and navigating tomaven-repository/org/jboss/bom/rhdm/rhdm-platform-bom
directory; the name of the only subdirectory in this directory is the version. For example,7.0.0.GA-redhat-1
.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.
Replace the legacy
org.guvnor
dependency (if applicable) with the neworg.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>
-
Update the version of the project artifact and save the
pom.xml
file. - Rebuild the project, using a regular Maven build.
- If build errors or subsequent execution errors happen, resolve them using the information in Section 3.1, “Troubleshooting build and execution errors in migrated Java projects”.
3.1. Troubleshooting build and execution errors in migrated Java projects
Use the following information to resolve any build or execution errors after rebuilding migrated projects for Red Hat Decision Manager 7.0.
3.1.1. API changes in Drools modules
The following Drools modules include some incompatible changes from BRMS 6.4 to Red Hat Decision Manager 7.0:
kie-api
: the main API for all projects from KIE Group. The majority of changes are in the following classes:-
org.kie.api.task.*
-
org.kie.api.executor.*
-
org.kie.api.concurrent.*
-
org.kie.api.builder.*
-
org.kie.api.command.*
-
org.kie.api.runtime.*
-
drools-core
: the rules engine. The changed classes are:-
org.drools.core.command.*
-
org.drools.core.common.*
-
kie-server-api
: the general API, including commands,model and so on, for KIE Server (Decision Server). The changed classes are:-
org.kie.server.api.commands.*
-
org.kie.server.api.marshalling.*
-
org.kie.server.api.model.*
-
org.kie.server.api.rest.RestURI
(constants have slightly changed, omitting leading/
)
-
kie-server-controller-api
: the API for the KIE Server Controller. The changed classes are:-
org.kie.server.controller.api.service.*
-
kie-server-controller-rest
: the REST API for KIE Server Controller. The changed classes are:-
org.kie.server.controller.rest.RestSpecManagementServiceImpl
-
org.kie.server.controller.rest.RestKieServerControllerImpl
-
kie-server-client
: the KIE Server Client. The changed classes are:-
org.kie.server.client.SolverServicesClient
-
org.kie.server.client.UIServicesClient
-
org.kie.server.client.admin.ProcessAdminServicesClient
-
org.kie.server.client.ProcessServicesClient
-
org.kie.server.client.QueryServicesClient
-
org.kie.server.client.JobServicesClient
-
org.kie.server.client.UserTaskServicesClient
-
org.kie.server.client.KieServicesClient
-
org.kie.server.client.KieServicesConfiguration
-
If you encounter build errors with any of the listed classes, review the detailed reports that are available at https://access.redhat.com/articles/3352151 . The reports indicate the API changes. You can use this information to adapt your code to the changes.
3.1.2. Logic changes in Drools modules
The following logic changes were made in Drools modules:
In Red Hat BRMS 6.4, when a rule executes the sum function in an accumulate pattern, the result always returns as a double data type regardless of the data type of the inputs. Red Hat Decision Manager 7.0 preserves the data type of the inputs on which the sum is executed. This enhancement provides a more accurate result from the sum function. In the following example, the result type of the accumulate function is
Long
instead ofdouble
:Long(...) from accumulate(..., sum($p.getLongWeight()))
If the rules in your Red Hat BRMS 6.4 project include the sum function in an accumulate pattern, search for these functions and review them. Keep in mind that these functions return a double data type in Red Hat BRMS 6.4, but will return the data type of the input values in Red Hat Decision Manager 7.0.
-
When no fact matches the accumulate pattern, min and max accumulate functions in Red Hat Decision Manager 7.0 do not return
+/-Integer.MAX_VALUE
, but returnnull
, therefore, unlike BRMS 6.4, the accumulate in the rule is not matched and the rule does not fire. -
Business processes that contain business rule tasks with an
implementation=Java
configuration will not be compiled in Red Hat Decision Manager 7.0 due to stricter validation requirements. To resolve compilation errors related to this restriction, set the implementation configuration toimplementation=##unspecified
or remove theimplementation
attribute.
Chapter 4. Red Hat Business Optimizer changes in Red Hat Decision Manager 7.0
Red Hat Business Optimizer is an embeddable planning engine in Red Hat Decision Manager that optimizes planning problems. Red Hat Business Optimizer is based on the community OptaPlanner project that is regularly updated and in some cases requires code changes for the latest Red Hat Business Optimizer features. For an overview of the latest OptaPlanner changes and migration requirements, see the OptaPlanner upgrade recipe archive. OptaPlanner upgrade information for versions 7.0 through 7.6, inclusive, is relevant for upgrading from Red Hat JBoss BRMS 6.4 to Red Hat Decision Manager 7.0.
In Red Hat Decision Manager 7.0, certain Red Hat Business Optimizer configurations in Decision Central must be updated to accommodate recent OptaPlanner changes.
4.1. Updating Red Hat Business Optimizer asset configurations in Decision Central
If you have any solver configuration assets (.solver.xml
files) or solution-related data objects in Decision Central, you must make certain updates to these assets in Red Hat Decision Manager 7.0 to accommodate recent Red Hat Business Optimizer changes.
Prerequisite
Decision Central data has been migrated from Red Hat JBoss BRMS to Red Hat Decision Manager 7.0. For migration instructions,see Chapter 2, Migrating projects in Decision Central.
Procedure
- Log in to Decision Central for Red Hat Decision Manager 7.0.
- Go to Menu → Design → Projects and select the project name.
-
Open any solver configuration asset (
.solver.xml
file), if present. - In the solver configuration designer, click Save without making any changes. This step is required to generate the new code for solver configuration assets in Red Hat Decision Manager 7.0. Do this step with any other solver configuration assets.
Under Data Objects in the Project Explorer (left menu), open any data object (
.java
file) configured as a Planning Solution, if applicable.To verify if this setting is selected for this data object, click the OptaPlanner icon on the right side of the data objects designer. If Planning Solution is not selected, then this procedure does not apply.
- Under general properties in the data objects designer, set the Superclass drop-down option to Nothing selected. This setting is no longer required by Red Hat Business Optimizer in Red Hat Decision Manager 7.0.
- On the right side of the data objects designer, click the OptaPlanner icon to reveal the Planner Settings. The Planning Solution option should be selected (if not, then this procedure does not apply).
- Select No selected, then re-select Planning Solution and specify the Solution Score Type. This step is required to generate the new code for planning solutions in Red Hat Decision Manager 7.0.
- Click Save in the data objects designer and make the same changes to any other data objects configured as a Planning Solution.
Chapter 5. Upgrading a Decision Server
You can upgrade a BRMS 6.4 KIE Server to Red Hat Decision Manager 7.0 Decision Server by installing the new server on the same host. You can use existing KJAR files. However, for optimal performance, upgrade and rebuild the projects.
Procedure
- Install Red Hat Decision Manager 7.0 Decision Server on the same host as a BRMS 6.4 KIE Server. Use a separate JBoss EAP installation. For instructions, see Installing Red Hat Decision Manager on premise.
- Configure the Red Hat Decision Manager 7.0 Decision Server to bind to the same port as the BRMS 6.4 KIE Server. (The default settings are the same).
Configure the Decision Server to use a Maven repository that contains your decision services (KJAR files). Use one of the following approaches:
-
Use the same KJAR files as of the BRMS 6.4 KIE Server. To copy the Maven configuration, copy the value of the
kie.maven.settings.custom
system property from the old version$EAP_home/standalone/configuration/standalone.xml
file to the same file in the new version. - Upgrade your decision services to the new version. For instructions, see Chapter 2, Migrating projects in Decision Central and Chapter 3, Migrating Java projects. Upload the new KJAR files to a Maven repository. Then configure the Decision Server to use the repository:
-
Create a
settings.xml
file for the Maven repository In the
$EAP_home/standalone/configuration/standalone.xml
file for Red Hat Decision Manager 7.0 Decision Server, under the<system-properties>
tag, set thekie.maven.settings.custom property
to the full pathname of thesettings.xml
file, for example:<property name="kie.maven.settings.custom" value="/opt/custom-config/settings.xml"/>
In this case, you need to change the version of the KJAR files. Change the version of the services that you start accordingly. You can still use the same container name to ensure maximum compatibility with existing clients.
-
Use the same KJAR files as of the BRMS 6.4 KIE Server. To copy the Maven configuration, copy the value of the
- Stop the BRMS 6.4 KIE Server.
- Start the Red Hat Decision Manager 7.0 Decision Server.
- Use the API to start the necessary decision services. For instructions, see Packaging and deploying a decision service.
Result
The Red Hat Decision Manager 7.0 Decision Server operates on the same URLs and provides the same services as the BRMS 6.4 KIE Server.
You might need to change client applications that use the REST API in order to adapt to the following API change:
- The ServiceResponse wrapper was removed from the Planner service responses.
You can also configure the Decision Server to connect to a Decision Central. The Decision Central can manage several Decision Servers and deploy the same or different decision services on them. For instructions, see Packaging and deploying a decision service.
Appendix A. Versioning information
Documentation last updated on: Monday, October 1, 2018.