Managing and monitoring Decision Server
Abstract
Preface Copy linkLink copied to clipboard!
As a systems administrator, you can install, configure, and upgrade Red Hat Decision Manager for production environments, quickly and easily troubleshoot system failures, and ensure that systems are running optimally.
Prerequisites
- Red Hat JBoss Enterprise Application Platform 7.2 is installed. For more information, see Red Hat JBoss Enterprise Application Platform 7.2 Installation Guide.
- Red Hat Decision Manager is installed. For more information, see Planning a Red Hat Decision Manager installation.
-
Red Hat Decision Manager is running and you can log in to Business Central with the
adminrole. For more information, see Planning a Red Hat Decision Manager installation.
Chapter 1. Red Hat Decision Manager components Copy linkLink copied to clipboard!
Red Hat Decision Manager is made up of Business Central and Decision Server.
Business Central is the graphical user interface where you create and manage business rules. You can install Business Central in a Red Hat JBoss EAP instance or on the Red Hat OpenShift Container Platform (OpenShift).
Business Central is also available as a standalone JAR file. You can use the Business Central standalone JAR file to run Business Central without needing to deploy it to an application server.
Decision Server is the server where rules and other artifacts are executed. It is used to instantiate and execute rules and solve planning problems. You can install Decision Server in a Red Hat JBoss EAP instance, on OpenShift, in an Oracle WebLogic server instance, in an IBM WebSphere Application Server instance, or as a part of Spring Boot application.
You can configure Decision Server to run in managed or unmanaged mode. If Decision Server is unmanaged, you must manually create and maintain KIE containers (deployment units). A KIE container is a specific version of a project. If Decision Server is managed, the Decision Manager controller manages the Decision Server configuration and you interact with the Decision Manager controller to create and maintain KIE containers.
Chapter 2. System integration with Maven Copy linkLink copied to clipboard!
Red Hat Decision Manager is designed to be used with Red Hat JBoss Middleware Maven Repository and Maven Central repository as dependency sources. Ensure that both the dependencies are available for projects builds.
Ensure that your project depends on specific versions of an artifact. LATEST or RELEASE are commonly used to specify and manage dependency versions in your application.
-
LATESTrefers to the latest deployed (snapshot) version of an artifact. -
RELEASErefers to the last non-snapshot version release in the repository.
By using LATEST or RELEASE, you do not have to update version numbers when a new release of a third-party library is released, however, you lose control over your build being affected by a software release.
2.1. Preemptive authentication for local projects Copy linkLink copied to clipboard!
If your environment does not have access to the internet, set up an in-house Nexus and use it instead of Maven Central or other public repositories. To import JARs from the remote Maven repository of Red Hat Decision Manager server to a local Maven project, turn on pre-emptive authentication for the repository server. You can do this by configuring authentication for guvnor-m2-repo in the pom.xml file as shown below:
Alternatively, you can set Authorization HTTP header with Base64 encoded credentials:
2.2. Duplicate GAV detection in Business Central Copy linkLink copied to clipboard!
In Business Central, all Maven repositories are checked for any duplicated GroupId, ArtifactId, and Version (GAV) values in a project. If a GAV duplicate exists, the performed operation is canceled.
Duplicate GAV detection is disabled for projects in Development Mode. To enable duplicate GAV detection in Business Central, go to project Settings → General Settings → Version and toggle the Development Mode option to OFF (if applicable).
Duplicate GAV detection is executed every time you perform the following operations:
- Save a project definition for the project.
-
Save the
pom.xmlfile. - Install, build, or deploy a project.
The following Maven repositories are checked for duplicate GAVs:
-
Repositories specified in the
<repositories>and<distributionManagement>elements of thepom.xmlfile. -
Repositories specified in the Maven
settings.xmlconfiguration file.
2.3. Managing duplicate GAV detection settings in Business Central Copy linkLink copied to clipboard!
Business Central users with the admin role can modify the list of repositories that are checked for duplicate GroupId, ArtifactId, and Version (GAV) values for a project.
Duplicate GAV detection is disabled for projects in Development Mode. To enable duplicate GAV detection in Business Central, go to project Settings → General Settings → Version and toggle the Development Mode option to OFF (if applicable).
Procedure
- In Business Central, go to Menu → Design → Projects and click the project name.
- Click the project Settings tab and then click Validation to open the list of repositories.
Select or clear any of the listed repository options to enable or disable duplicate GAV detection.
In the future, duplicate GAVs will be reported for only the repositories you have enabled for validation.
NoteTo disable this feature, set the
org.guvnor.project.gav.check.disabledsystem property totruefor Business Central at system startup:~/EAP_HOME/bin/standalone.sh -c standalone-full.xml -Dorg.guvnor.project.gav.check.disabled=true
$ ~/EAP_HOME/bin/standalone.sh -c standalone-full.xml -Dorg.guvnor.project.gav.check.disabled=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 3. Applying patch updates and minor release upgrades to Red Hat Decision Manager Copy linkLink copied to clipboard!
Automated update tools are often provided with both patch updates and new minor versions of Red Hat Decision Manager to facilitate updating certain components of Red Hat Decision Manager, such as Business Central, Decision Server, and the headless Decision Manager controller. Other Red Hat Decision Manager artifacts, such as the decision engine and standalone Business Central, are released as new artifacts with each minor release and you must re-install them to apply the update.
You can use the same automated update tool to apply both patch updates and minor release upgrades to Red Hat Decision Manager 7.4. Patch updates of Red Hat Decision Manager, such as an update from version 7.4 to 7.4.1, include the latest security updates and bug fixes. Minor release upgrades of Red Hat Decision Manager, such as an upgrade from version 7.4.x to 7.5, include enhancements, security updates, and bug fixes.
Only updates for Red Hat Decision Manager are included in Red Hat Decision Manager update tools. Updates to Red Hat JBoss EAP must be applied using Red Hat JBoss EAP patch distributions. For more information about Red Hat JBoss EAP patching, see the Red Hat JBoss EAP patching and upgrading guide.
Prerequisites
- Your Red Hat Decision Manager and Decision Server instances are not running. Do not apply updates while you are running an instance of Red Hat Decision Manager or Decision Server.
Procedure
Navigate to the Software Downloads page in the Red Hat Customer Portal (login required), and select the product and version from the drop-down options.
Example:
- Product: Decision Manager
- Version: 7.4.1
If you are upgrading to a new minor release of Red Hat Decision Manager, such as an upgrade from version 7.4.x to 7.5, first apply the latest patch update to your current version of Red Hat Decision Manager and then follow this procedure again to upgrade to the new minor release.
NoteIf you are upgrading from Red Hat Decision Manager 7.4.1 to Red Hat Decision Manager 7.5.0, you must use the Business Central migration tool on your
.niogitdirectory to prepare project data and system configurations for migration to Red Hat Decision Manager 7.5. For instructions on using the migration tool, see Patching and upgrading Red Hat Decision Manager 7.4.Click Patches, download the Red Hat Decision Manager [VERSION] Update Tool, and extract the downloaded
rhdm-$VERSION-update.zipfile to a temporary directory.This update tool automates the update of certain components of Red Hat Decision Manager, such as Business Central, Decision Server, and the headless Decision Manager controller. Use this update tool first to apply updates and then install any other updates or new release artifacts that are relevant to your Red Hat Decision Manager distribution.
If you want to preserve any files from being updated by the update tool, navigate to the extracted
rhdm-$VERSION-updatefolder, open theblacklist.txtfile, and add the relative paths to the files that you do not want to be updated.When a file is listed in the
blacklist.txtfile, the update script does not replace the file with the new version but instead leaves the file in place and in the same location adds the new version with a.newsuffix. If you blacklist files that are no longer being distributed, the update tool creates an empty marker file with a.removedsuffix. You can then choose to retain, merge, or delete these new files manually.Example files to be excluded in
blacklist.txtfile:WEB-INF/web.xml // Custom file styles/base.css // Obsolete custom file kept for record
WEB-INF/web.xml // Custom file styles/base.css // Obsolete custom file kept for recordCopy to Clipboard Copied! Toggle word wrap Toggle overflow The contents of the blacklisted file directories after the update:
ls WEB-INF web.xml web.xml.new
$ ls WEB-INF web.xml web.xml.newCopy to Clipboard Copied! Toggle word wrap Toggle overflow ls styles base.css base.css.removed
$ ls styles base.css base.css.removedCopy to Clipboard Copied! Toggle word wrap Toggle overflow In your command terminal, navigate to the temporary directory where you extracted the
rhdm-$VERSION-update.zipfile and run theapply-updatesscript in the following format:ImportantMake sure that your Red Hat Decision Manager and Decision Server instances are not running before you apply updates. Do not apply updates while you are running an instance of Red Hat Decision Manager or Decision Server.
On Linux or Unix-based systems:
./apply-updates.sh $DISTRO_PATH $DISTRO_TYPE
$ ./apply-updates.sh $DISTRO_PATH $DISTRO_TYPECopy to Clipboard Copied! Toggle word wrap Toggle overflow On Windows:
.\apply-updates.bat $DISTRO_PATH $DISTRO_TYPE
$ .\apply-updates.bat $DISTRO_PATH $DISTRO_TYPECopy to Clipboard Copied! Toggle word wrap Toggle overflow The
$DISTRO_PATHportion is the path to the relevant distribution directory and the$DISTRO_TYPEportion is the type of distribution that you are updating with this update.The following distribution types are supported in Red Hat Decision Manager update tool:
-
rhdm-decision-central-eap7-deployable: Updates Business Central (decision-central.war) rhdm-kie-server-ee8: Updates Decision Server (kie-server.war)NoteThe update tool will update Red Hat JBoss EAP EE7 to Red Hat JBoss EAP EE8.
-
rhdm-kie-server-jws: Updates Decision Server on Red Hat JBoss Web Server (kie-server.war) -
rhdm-controller-ee7: Updates the headless Decision Manager controller (controller.war) -
rhdm-controller-jws: Updates the headless Decision Manager controller on Red Hat JBoss Web Server (controller.war)
Example update to Business Central and Decision Server for a full Red Hat Decision Manager distribution on Red Hat JBoss EAP:
./apply-updates.sh ~EAP_HOME/standalone/deployments/decision-central.war rhdm-decision-central-eap7-deployable ./apply-updates.sh ~EAP_HOME/standalone/deployments/kie-server.war rhdm-kie-server-ee8
./apply-updates.sh ~EAP_HOME/standalone/deployments/decision-central.war rhdm-decision-central-eap7-deployable ./apply-updates.sh ~EAP_HOME/standalone/deployments/kie-server.war rhdm-kie-server-ee8Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example update to headless Decision Manager controller, if used:
./apply-updates.sh ~EAP_HOME/standalone/deployments/controller.war rhdm-controller-ee7
./apply-updates.sh ~EAP_HOME/standalone/deployments/controller.war rhdm-controller-ee7Copy to Clipboard Copied! Toggle word wrap Toggle overflow The update script creates a
backupfolder in the extractedrhdm-$VERSION-updatefolder with a copy of the specified distribution, and then proceeds with the update.-
After the update tool completes, return to the Software Downloads page of the Red Hat Customer Portal where you downloaded the update tool and install any other updates or new release artifacts that are relevant to your Red Hat Decision Manager distribution.
For files that already exist in your Red Hat Decision Manager distribution, such as
.jarfiles for the decision engine or other add-ons, replace the existing version of the file with the new version from the Red Hat Customer Portal.If you use the standalone Red Hat Decision Manager 7.4.0 Maven Repository artifact (
rhdm-7.4.0-maven-repository.zip), such as in air-gap environments, download Red Hat Decision Manager [VERSION] Incremental Maven Repository and extract the downloadedrhdm-$VERSION-incremental-maven-repository.zipfile to your existing~/maven-repositorydirectory to update the relevant contents.Example Maven repository update:
unzip -o rhdm-7.4.1-incremental-maven-repository.zip -d $REPO_PATH/rhdm-7.4.0-maven-repository/maven-repository/
$ unzip -o rhdm-7.4.1-incremental-maven-repository.zip -d $REPO_PATH/rhdm-7.4.0-maven-repository/maven-repository/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - After you finish applying all relevant updates, start Red Hat Decision Manager and Decision Server and log in to Business Central.
Verify that all project data is present and accurate in Business Central, and in the top-right corner of the Business Central window, click your profile name and click About to verify the updated product version number.
If you encounter errors or notice any missing data in Business Central, you can restore the contents in the
backupfolder within therhdm-$VERSION-updatefolder to revert the update tool changes. You can also re-install the relevant release artifacts from your previous version of Red Hat Decision Manager in the Red Hat Customer Portal. After restoring your previous distribution, you can try again to run the update.
Chapter 4. Configuring and starting Decision Server Copy linkLink copied to clipboard!
You can configure your Decision Server location, user name, password, and other related properties by defining the necessary configurations when you start Decision Server.
Procedure
Navigate to the Red Hat Decision Manager 7.4 bin directory and start the new Decision Server with the following properties. Adjust the specific properties according to your environment.
- 1
- Start command with
standalone-full.xmlserver profile - 2
- Server ID that must match the server configuration name defined in Business Central
- 3
- User name to connect with Decision Server from the Decision Manager controller
- 4
- Password to connect with Decision Server from the Decision Manager controller
- 5
- Decision Manager controller location, Business Central URL with
/rest/controllersuffix - 6
- User name to connect to the Decision Manager controller REST API
- 7
- Password to connect to the Decision Manager controller REST API
- 8
- Decision Server location (on the same instance as Business Central in this example)
- 9
- Hibernate dialect to be used
- 10
- JNDI name of the data source used for your previous Red Hat JBoss BRMS database
If Business Central and Decision Server are installed on separate application server instances (Red Hat JBoss EAP or other), use a separate port for the Decision Server location to avoid port conflicts with Business Central. If a separate Decision Server port has not already been configured, you can add a port offset and adjust the Decision Server port value accordingly in the Decision Server properties.
Example:
-Djboss.socket.binding.port-offset=150 -Dorg.kie.server.location=http://localhost:8230/kie-server/services/rest/server
-Djboss.socket.binding.port-offset=150
-Dorg.kie.server.location=http://localhost:8230/kie-server/services/rest/server
If the Business Central port is 8080, as in this example, then the Decision Server port, with a defined offset of 150, is 8230.
Decision Server connects to the new Business Central and collects the list of deployment units (KIE containers) to be deployed.
When you use a class inside a dependency JAR file to access Decision Server from Decision Server client, you get the ConversionException and ForbiddenClassException in Business Central. To avoid generating these exceptions in Business Central, do one of the following:
- If the exceptions are generated on the client-side, add following system property to the kie-server client:
System.setProperty("org.kie.server.xstream.enabled.packages", "org.example.**");
System.setProperty("org.kie.server.xstream.enabled.packages", "org.example.**");
-
If the exceptions are generated on the server-side, open
standalone-full.xmlfrom the Red Hat Decision Manager installation directory, set the following property under the <system-properties> tag:
<property name="org.kie.server.xstream.enabled.packages" value="org.example.**"/>
<property name="org.kie.server.xstream.enabled.packages" value="org.example.**"/>
- Set the following JVM property:
-Dorg.kie.server.xstream.enabled.packages=org.example.**
-Dorg.kie.server.xstream.enabled.packages=org.example.**
It is expected that you do not configure the classes that exists in KJAR using these system property. Ensure that only known classes are used in the system property to avoid any vulnerabilities.
The org.example is an example package, you can define any package that you want to use. You can specify multiple packages separated by comma , for example, org.example1.* * , org.example2.* * , org.example3.* *.
You can also add specific classes , for example, org.example1.Mydata1, org.example2.Mydata2.
Chapter 5. Configuring Decision Server with the integrated Decision Manager controller Copy linkLink copied to clipboard!
Only make the changes described in this section if Decision Server will be managed by Business Central and you installed Red Hat Decision Manager from the ZIP files. If you did not install Business Central, you can use the headless Decision Manager controller to manage Decision Server, as described in Chapter 6, Installing and running the headless Decision Manager controller.
Decision Server can be managed or it can be unmanaged. If Decision Server is unmanaged, you must manually create and maintain KIE containers (deployment units). If Decision Server is managed, the Decision Manager controller manages the Decision Server configuration and you interact with the Decision Manager controller to create and maintain KIE containers.
The Decision Manager controller is integrated with Business Central. If you install Business Central, you can use the Execution Server page in Business Central to interact with the Decision Manager controller.
If you installed Red Hat Decision Manager from the ZIP files, you must edit the standalone-full.xml file in both the Decision Server and Business Central installations to configure Decision Server with the integrated Decision Manager controller.
Prerequisites
Business Central and Decision Server are installed in the base directory of the Red Hat JBoss EAP installation (
EAP_HOME).NoteYou should install Business Central and Decision Server on different servers in production environments. However, if you install Decision Server and Business Central on the same server, for example in a development environment, make the changes described in this section in the shared
standalone-full.xmlfile.On Business Central server nodes, a user with the
rest-allrole exists.Procedure
In the Business Central
EAP_HOME/standalone/configuration/standalone-full.xmlfile, uncomment the following properties in the<system-properties>section and replace<USERNAME>and<USER_PWD>with the credentials of a user with thekie-serverrole:<property name="org.kie.server.user" value="<USERNAME>"/> <property name="org.kie.server.pwd" value="<USER_PWD>"/>
<property name="org.kie.server.user" value="<USERNAME>"/> <property name="org.kie.server.pwd" value="<USER_PWD>"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the Decision Server
EAP_HOME/standalone/configuration/standalone-full.xmlfile, uncomment the following properties in the<system-properties>section.<property name="org.kie.server.controller.user" value="<CONTROLLER_USER>"/> <property name="org.kie.server.controller.pwd" value="<CONTROLLER_PWD>"/> <property name="org.kie.server.id" value="<KIE_SERVER_ID>"/> <property name="org.kie.server.location" value="http://<HOST>:<PORT>/kie-server/services/rest/server"/> <property name="org.kie.server.controller" value="<CONTROLLER_URL>"/>
<property name="org.kie.server.controller.user" value="<CONTROLLER_USER>"/> <property name="org.kie.server.controller.pwd" value="<CONTROLLER_PWD>"/> <property name="org.kie.server.id" value="<KIE_SERVER_ID>"/> <property name="org.kie.server.location" value="http://<HOST>:<PORT>/kie-server/services/rest/server"/> <property name="org.kie.server.controller" value="<CONTROLLER_URL>"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Replace the following values:
-
Replace
<CONTROLLER_USER>and<CONTROLLER_PWD>with the credentials of a user with therest-allrole. -
Replace
<KIE_SERVER_ID>with the ID or name of the Decision Server installation, for example,rhdm-7.4.0-decision_server-1. -
Replace
<HOST>with the ID or name of the Decision Server host, for example,localhostor192.7.8.9. Replace
<PORT>with the port of the Decision Server host, for example,8080.NoteThe
org.kie.server.locationproperty specifies the location of Decision Server.Replace
<CONTROLLER_URL>with the URL of Business Central. Decision Server connects to this URL during startup.If you installed Business Central using the installer or Red Hat JBoss EAP zip installations,
<CONTROLLER_URL>has this format:http://<HOST>:<PORT>/decision-central/rest/controllerIf you are running Business Central using the
standalone.jarfile,<CONTROLLER_URL>has this format:http://<HOST>:<PORT>/rest/controller
Chapter 6. Installing and running the headless Decision Manager controller Copy linkLink copied to clipboard!
You can configure Decision Server to run in managed or unmanaged mode. If Decision Server is unmanaged, you must manually create and maintain KIE containers (deployment units). If Decision Server is managed, the Decision Manager controller manages the Decision Server configuration and you interact with the Decision Manager controller to create and maintain KIE containers.
Business Central has an embedded Decision Manager controller. If you install Business Central, use the Execution Server page to create and maintain KIE containers. If you want to automate Decision Server management without Business Central, you can use the headless Decision Manager controller.
6.1. Using the installer to configure Decision Server with the Decision Manager controller Copy linkLink copied to clipboard!
Decision Server can be managed by the Decision Manager controller or it can be unmanaged. If Decision Server is unmanaged, you must manually create and maintain KIE containers (deployment units). If Decision Server is managed, the Decision Manager controller manages the Decision Server configuration and you interact with the Decision Manager controller to create and maintain KIE containers.
The Decision Manager controller is integrated with Business Central. If you install Business Central, you can use the Execution Server page in Business Central to interact with the Decision Manager controller.
You can use the installer in interactive or CLI mode to install Business Central and Decision Server, and then configure Decision Server with the Decision Manager controller.
If you do not install Business Central, see Chapter 6, Installing and running the headless Decision Manager controller for information about using the headless Decision Manager controller.
Prerequisites
- Two computers with backed-up Red Hat JBoss EAP 7.2 server installations are available.
- Sufficient user permissions to complete the installation are granted.
Procedure
- On the first computer, run the installer in interactive mode or CLI mode. See Installing and configuring Red Hat Decision Manager on Red Hat JBoss EAP 7.2 for more information.
- On the Component Selection page, clear the Decision Server box.
- Complete the Business Central installation.
- On the second computer, run the installer in interactive mode or CLI mode.
- On the Component Selection page, clear the Business Central box.
- On the Configure Runtime Environment page, select Perform Advanced Configuration.
- Select Customize Decision Server properties and click Next.
Enter the controller URL for Business Central and configure additional properties for Decision Server. The controller URL has the following form where
<HOST:PORT>is the address of Business Central on the second computer:<HOST:PORT>/business-central/rest/controller
<HOST:PORT>/business-central/rest/controllerCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Complete the installation.
- To verify that the Decision Manager controller is now integrated with Business Central, go to the Execution Servers page in Business Central and confirm that the Decision Server that you configured appears under REMOTE SERVERS.
6.2. Installing the headless Decision Manager controller Copy linkLink copied to clipboard!
You can install the headless Decision Manager controller and use the REST API or the Decision Server Java Client API to interact with it.
Prerequisites
-
A backed-up Red Hat JBoss EAP installation version 7.2 is available. The base directory of the Red Hat JBoss EAP installation is referred to as
EAP_HOME. - Sufficient user permissions to complete the installation are granted.
Procedure
Navigate to the Software Downloads page in the Red Hat Customer Portal (login required), and select the product and version from the drop-down options:
- Product: Decision Manager
- Version: 7.4
-
Download Red Hat Decision Manager 7.4.0 Add Ons (the
rhdm-7.4.0-add-ons.zipfile). -
Unzip the
rhdm-7.4.0-add-ons.zipfile. Therhdm-7.4-controller-ee7.zipfile is in the unzipped directory. -
Extract the
rhdm-7.4-controller-ee7archive to a temporary directory. In the following examples this directory is calledTEMP_DIR. Copy the
TEMP_DIR/rhdm-7.4-controller-ee7/controller.wardirectory toEAP_HOME/standalone/deployments/.WarningEnsure that the names of the headless Decision Manager controller deployments you copy do not conflict with your existing deployments in the Red Hat JBoss EAP instance.
-
Copy the contents of the
TEMP_DIR/rhdm-7.4-controller-ee7/SecurityPolicy/directory toEAP_HOME/bin. When asked to overwrite files, select Yes. -
In the
EAP_HOME/standalone/deployments/directory, create an empty file namedcontroller.war.dodeploy. This file ensures that the headless Decision Manager controller is automatically deployed when the server starts.
6.2.1. Creating a headless Decision Manager controller user Copy linkLink copied to clipboard!
Before you can use the headless Decision Manager controller, you must create a user that has the kie-server role.
Prerequisites
-
The headless Decision Manager controller is installed in the base directory of the Red Hat JBoss EAP installation (
EAP_HOME).
Procedure
-
In a terminal application, navigate to the
EAP_HOME/bindirectory. Enter the following command and replace
<USER_NAME>and<PASSWORD>with the user name and password of your choice../add-user.sh -a --user <username> --password <password> --role kie-server
$ ./add-user.sh -a --user <username> --password <password> --role kie-serverCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteMake sure that the specified user name is not the same as an existing user, role, or group. For example, do not create a user with the user name
admin.The password must have at least eight characters and must contain at least one number and one non-alphanumeric character, but not & (ampersand).
- Make a note of your user name and password.
6.2.2. Configuring Decision Server and the headless Decision Manager controller Copy linkLink copied to clipboard!
If Decision Server will be managed by the headless Decision Manager controller, you must edit the standalone-full.xml file in Decision Server installation and the standalone.xml file in the headless Decision Manager controller installation, as described in this section.
Prerequisites
-
Decision Server is installed in the base directory of the Red Hat JBoss EAP installation (
EAP_HOME). The headless Decision Manager controller is installed in an
EAP_HOME.NoteYou should install Decision Server and the headless Decision Manager controller on different servers in production environments. However, if you install Decision Server and the headless Decision Manager controller on the same server, for example in a development environment, make these changes in the shared
standalone-full.xmlfile.-
On Decision Server nodes, a user with the
kie-serverrole exists. On the server nodes, a user with the
kie-serverrole exists.Procedure
In the
EAP_HOME/standalone/configuration/standalone-full.xmlfile, add the following properties to the<system-properties>section and replace<USERNAME>and<USER_PWD>with the credentials of a user with thekie-serverrole:<property name="org.kie.server.user" value="<USERNAME>"/> <property name="org.kie.server.pwd" value="<USER_PWD>"/>
<property name="org.kie.server.user" value="<USERNAME>"/> <property name="org.kie.server.pwd" value="<USER_PWD>"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the Decision Server
EAP_HOME/standalone/configuration/standalone-full.xmlfile, add the following properties to the<system-properties>section:<property name="org.kie.server.controller.user" value="<CONTROLLER_USER>"/> <property name="org.kie.server.controller.pwd" value="<CONTROLLER_PWD>"/> <property name="org.kie.server.id" value="<KIE_SERVER_ID>"/> <property name="org.kie.server.location" value="http://<HOST>:<PORT>/kie-server/services/rest/server"/> <property name="org.kie.server.controller" value="<CONTROLLER_URL>"/>
<property name="org.kie.server.controller.user" value="<CONTROLLER_USER>"/> <property name="org.kie.server.controller.pwd" value="<CONTROLLER_PWD>"/> <property name="org.kie.server.id" value="<KIE_SERVER_ID>"/> <property name="org.kie.server.location" value="http://<HOST>:<PORT>/kie-server/services/rest/server"/> <property name="org.kie.server.controller" value="<CONTROLLER_URL>"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - In this file, replace the following values:
-
Replace
<CONTROLLER_USER>and<CONTROLLER_PWD>with the credentials of a user with thekie-serverrole. -
Replace
<KIE_SERVER_ID>with the ID or name of the Decision Server installation, for example,rhdm-7.4.0-decision_server-1. -
Replace
<HOST>with the ID or name of the Decision Server host, for example,localhostor192.7.8.9. Replace
<PORT>with the port of the Decision Server host, for example,8080.NoteThe
org.kie.server.locationproperty specifies the location of Decision Server.Replace
<CONTROLLER_URL>with the URL of the headless Decision Manager controller.- Decision Server connects to this URL during startup.
6.3. Running the headless Decision Manager controller Copy linkLink copied to clipboard!
After you have installed the headless Decision Manager controller on Red Hat JBoss EAP, use this procedure to run the headless Decision Manager controller.
Prerequisites
-
The headless Decision Manager controller is installed and configured in the base directory of the Red Hat JBoss EAP installation (
EAP_HOME).
Procedure
-
In a terminal application, navigate to
EAP_HOME/bin. If you installed the headless Decision Manager controller on the same Red Hat JBoss EAP instance as the Red Hat JBoss EAP instance where you installed the Decision Server, enter one of the following commands:
On Linux or UNIX-based systems:
./standalone.sh -c standalone-full.xml
$ ./standalone.sh -c standalone-full.xmlCopy to Clipboard Copied! Toggle word wrap Toggle overflow On Windows:
standalone.bat -c standalone-full.xml
standalone.bat -c standalone-full.xmlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
If you installed the headless Decision Manager controller on a separate Red Hat JBoss EAP instance from the Red Hat JBoss EAP instance where you installed the Decision Server, you can start the headless Decision Manager controller with the
standalone.shscript:NoteIn this case, ensure that you made all required configuration changes to the
standalone.xmlfile.On Linux or UNIX-based systems:
./standalone.sh
$ ./standalone.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow On Windows:
standalone.bat
standalone.batCopy to Clipboard Copied! Toggle word wrap Toggle overflow
To verify that the headless Decision Manager controller is working on Red Hat JBoss EAP, enter the following command where
<CONTROLLER>and<CONTROLLER_PWD>is the user name and password. The output of this command provides information about the Decision Server instance.curl -X GET "http://<HOST>:<PORT>/controller/rest/controller/management/servers" -H "accept: application/xml" -u '<CONTROLLER>:<CONTROLLER_PWD>'
curl -X GET "http://<HOST>:<PORT>/controller/rest/controller/management/servers" -H "accept: application/xml" -u '<CONTROLLER>:<CONTROLLER_PWD>'Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Alternatively, you can use the Decision Server Java API Client to access the headless Decision Manager controller.
6.4. Clustering Decision Servers with the headless Decision Manager controller Copy linkLink copied to clipboard!
The Decision Manager controller is integrated with Business Central. However, if you do not install Business Central, you can install the headless Decision Manager controller and use the REST API or the Decision Server Java Client API to interact with it.
Prerequisites
-
A backed-up Red Hat JBoss EAP installation version 7.2 or later is available. The base directory of the Red Hat JBoss EAP installation is referred to as
EAP_HOME. - Sufficient user permissions to complete the installation are granted.
- An NFS server with a mounted partition is available.
Procedure
Navigate to the Software Downloads page in the Red Hat Customer Portal (login required), and select the product and version from the drop-down options:
- Product: Decision Manager
- Version: 7.4
-
Download Red Hat Decision Manager 7.4.0 Add Ons (the
rhdm-7.4.0-add-ons.zipfile). -
Unzip the
rhdm-7.4.0-add-ons.zipfile. Therhdm-7.4-controller-ee7.zipfile is in the unzipped directory. -
Extract the
rhdm-7.4-controller-ee7archive to a temporary directory. In the following examples this directory is calledTEMP_DIR. Copy the
TEMP_DIR/rhdm-7.4-controller-ee7/controller.wardirectory toEAP_HOME/standalone/deployments/.WarningEnsure that the names of the headless Decision Manager controller deployments you copy do not conflict with your existing deployments in the Red Hat JBoss EAP instance.
-
Copy the contents of the
TEMP_DIR/rhdm-7.4-controller-ee7/SecurityPolicy/directory toEAP_HOME/bin. When asked to overwrite files, select Yes. -
In the
EAP_HOME/standalone/deployments/directory, create an empty file namedcontroller.war.dodeploy. This file ensures that the headless Decision Manager controller is automatically deployed when the server starts. -
Open the
EAP_HOME/standalone/configuration/standalone.xmlfile in a text editor. Add the following properties to the
<system-properties>element and replace<NFS_STORAGE>with the absolute path to the NFS storage where the template configuration is stored:<system-properties> <property name="org.kie.server.controller.templatefile.watcher.enabled" value="true"/> <property name="org.kie.server.controller.templatefile" value="<NFS_STORAGE>"/> </system-properties>
<system-properties> <property name="org.kie.server.controller.templatefile.watcher.enabled" value="true"/> <property name="org.kie.server.controller.templatefile" value="<NFS_STORAGE>"/> </system-properties>Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the value of the
org.kie.server.controller.templatefile.watcher.enabledproperty is set to true, a separate thread is started to watch for modifications of the template file. The default interval for these checks is 30000 milliseconds and can be further controlled by theorg.kie.server.controller.templatefile.watcher.intervalsystem property. If the value of this property is set to false, changes to the template file are detected only when the server restarts.To start the headless Decision Manager controller, navigate to
EAP_HOME/binand enter the following command:On Linux or UNIX-based systems:
./standalone.sh
$ ./standalone.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow On Windows:
standalone.bat
standalone.batCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For more information about running Red Hat Decision Manager in a Red Hat JBoss Enterprise Application Platform clustered environment, see Installing and configuring Red Hat Decision Manager in a Red Hat JBoss EAP clustered environment.
Chapter 7. Configuring a Decision Server to connect to Business Central Copy linkLink copied to clipboard!
If a Decision Server is not already configured in your Red Hat Decision Manager environment, or if you require additional Decision Servers in your Red Hat Decision Manager environment, you must configure a Decision Server to connect to Business Central.
If you are deploying Decision Server on Red Hat OpenShift Container Platform, see Deploying a Red Hat Decision Manager authoring or managed server environment on Red Hat OpenShift Container Platform for instructions about configuring it to connect to Business Central.
Prerequisites
- Decision Server is installed. For installation options, see Planning a Red Hat Decision Manager installation.
Procedure
-
In your Red Hat Decision Manager installation directory, navigate to the
standalone-full.xmlfile. For example, if you use a Red Hat JBoss EAP installation for Red Hat Decision Manager, go to$EAP_HOME/standalone/configuration/standalone-full.xml. Open
standalone-full.xmland under the<system-properties>tag, set the following properties:- org.kie.server.controller.user: The user name of a user who can log in to the Business Central.
- org.kie.server.controller.pwd: The password of the user who can log in to the Business Central.
-
org.kie.server.controller: The URL for connecting to the API of Business Central. Normally, the URL is
http://<centralhost>:<centralport>/decision-central/rest/controller, where<centralhost>and<centralport>are the host name and port for Business Central. If Business Central is deployed on OpenShift, removedecision-central/from the URL. -
org.kie.server.location: The URL for connecting to the API of Decision Server. Normally, the URL is
http://<serverhost>:<serverport>/kie-server/services/rest/server, where<serverhost>and<serverport>are the host name and port for Decision Server. - org.kie.server.id: The name of a server configuration. If this server configuration does not exist in Business Central, it is created automatically when Decision Server connects to Business Central.
Example:
<property name="org.kie.server.controller.user" value="central_user"/> <property name="org.kie.server.controller.pwd" value="central_password"/> <property name="org.kie.server.controller" value="http://central.example.com:8080/decision-central/rest/controller"/> <property name="org.kie.server.location" value="http://kieserver.example.com:8080/kie-server/services/rest/server"/> <property name="org.kie.server.id" value="production-servers"/>
<property name="org.kie.server.controller.user" value="central_user"/> <property name="org.kie.server.controller.pwd" value="central_password"/> <property name="org.kie.server.controller" value="http://central.example.com:8080/decision-central/rest/controller"/> <property name="org.kie.server.location" value="http://kieserver.example.com:8080/kie-server/services/rest/server"/> <property name="org.kie.server.id" value="production-servers"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Start or restart the Decision Server.
Chapter 8. Configuring the environment mode in Decision Server and Business Central Copy linkLink copied to clipboard!
You can set Decision Server to run in production mode or in development mode. Development mode provides a flexible deployment policy that enables you to update existing deployment units (KIE containers) while maintaining active process instances for small changes. It also enables you to reset the deployment unit state before updating active process instances for larger changes. Production mode is optimal for production environments, where each deployment creates a new deployment unit.
In a development environment, you can click Deploy in Business Central to deploy the built KJAR file to a Decision Server without stopping any running instances (if applicable), or click Redeploy to deploy the built KJAR file and stop any running instances. The next time you deploy or redeploy the built KJAR, the previous deployment unit (KIE container) is automatically updated in the same target Decision Server.
In a production environment, the Redeploy option in Business Central is disabled and you can click only Deploy to deploy the built KJAR file to a new deployment unit (KIE container) on a Decision Server.
Procedure
-
To configure the Decision Server environment mode, set the
org.kie.server.modesystem property toorg.kie.server.mode=developmentororg.kie.server.mode=production. To configure the deployment behavior for a project in Business Central, go to project Settings → General Settings → Version and toggle the Development Mode option.
NoteBy default, Decision Server and all new projects in Business Central are in development mode.
You cannot deploy a project with Development Mode turned on or with a manually added
SNAPSHOTversion suffix to a Decision Server that is in production mode.
Chapter 9. Configuring Decision Server Managed by Business Central Copy linkLink copied to clipboard!
This section provides a sample setup that you can use for testing purposes. Some of the values are unsuitable for a production environment, and are marked as such.
Use this procedure to configure Business Central to manage a Decision Server instance.
Prerequisites
Users with the following roles exist:
-
In Business Central, a user with the role
rest-all -
On the Decision Server, a user with the role
kie-server
-
In Business Central, a user with the role
In production environments, use two distinct users, each with one role. In this sample situation, we use only one user named controllerUser that has both the rest-all and the kie-server roles.
Procedure
Set the following JVM properties.
The location of Business Central and the Decision Server may be different. In such case, ensure you set the properties on the correct server instances.
On Red Hat JBoss EAP, modify the
<system-properties>section in:-
EAP_HOME/standalone/configuration/standalone*.xmlfor standalone mode. -
EAP_HOME/domain/configuration/domain.xmlfor domain mode.
-
Expand Table 9.1. JVM Properties for Managed Decision Server Instance Property Value Note org.kie.server.iddefault-kie-serverThe Decision Server ID.
org.kie.server.controllerhttp://localhost:8080/decision-central/rest/controllerThe location of Business Central.
org.kie.server.controller.usercontrollerUserThe user name with the role
rest-allas mentioned in the previous step.org.kie.server.controller.pwdcontrollerUser1234;The password of the user mentioned in the previous step.
org.kie.server.locationhttp://localhost:8080/kie-server/services/rest/serverThe location of the Decision Server.
Expand Table 9.2. JVM Properties for Business Central Instance Property Value Note org.kie.server.usercontrollerUserThe user name with the role
kie-serveras mentioned in the previous step.org.kie.server.pwdcontrollerUser1234;The password of the user mentioned in the previous step.
Verify the successful start of the Decision Server by sending a GET request to
http://SERVER:PORT/kie-server/services/rest/server/. Once authenticated, you get an XML response similar to this:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify successful registration:
- Log in to Business Central.
Click Menu → Deploy → Execution Servers.
If registration is successful, you can see the registered server ID.
9.1. Configuring Smart Router for TLS support Copy linkLink copied to clipboard!
You can now configure Smart Router (previously, KIE Server Router) for TLS support to allow HTTPS traffic.
Procedure
Open a terminal and enter the following command to start the smart router with TLS support:
java -Dorg.kie.server.router.tls.keystore=PATH_TO_YOUR_KEYSTORE -Dorg.kie.server.router.tls.keystore.password=YOUR_KEYSTORE_PASSWD -Dorg.kie.server.router.tls.keystore.keyalias=YOUR_KEYSTORE_ALIAS -jar kie-server-router-proxy-YOUR_VERSION.jarjava -Dorg.kie.server.router.tls.keystore=PATH_TO_YOUR_KEYSTORE -Dorg.kie.server.router.tls.keystore.password=YOUR_KEYSTORE_PASSWD -Dorg.kie.server.router.tls.keystore.keyalias=YOUR_KEYSTORE_ALIAS -jar kie-server-router-proxy-YOUR_VERSION.jarCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
PATH_TO_YOUR_KEYSTORE,YOUR_KEYSTORE_PASSWD,YOUR_KEYSTORE_ALIAS, andYOUR_VERSIONwith the relevant data.
Chapter 10. Managed Decision Server Copy linkLink copied to clipboard!
A managed instance requires an available Decision Manager controller to start the Decision Server.
A Decision Manager controller manages the Decision Server configuration in a centralized way. Each Decision Manager controller can manage multiple configurations at once, and there can be multiple Decision Manager controllers in the environment. Managed Decision Server can be configured with a list of Decision Manager controllers, but will only connect to one at a time.
All Decision Manager controllers should be synchronized to ensure that the same set of configuration is provided to the server, regardless of the Decision Manager controller to which it connects.
When the Decision Server is configured with a list of Decision Manager controllers, it will attempt to connect to each of them at startup until a connection is successfully established with one of them. If a connection cannot be established, the server will not start, even if there is a local storage available with configuration. This ensures consistence and prevents the server from running with redundant configuration.
To run the Decision Server in standalone mode without connecting to Decision Manager controllers, see Chapter 11, Unmanaged Decision Server.
Chapter 11. Unmanaged Decision Server Copy linkLink copied to clipboard!
An unmanaged Decision Server is a standalone instance, and therefore must be configured individually using REST/JMS API from the Decision Server itself. The configuration is automatically persisted by the server into a file and that is used as the internal server state, in case of restarts.
The configuration is updated during the following operations:
- Deploy KIE container
- Undeploy KIE container
- Start KIE container
- Stop KIE container
If the Decision Server is restarted, it will attempt to re-establish the same state that was persisted before shutdown. Therefore, KIE containers (deployment units) that were running will be started, but the ones that were stopped will not.
Chapter 12. Deployment descriptors Copy linkLink copied to clipboard!
Processes and rules are stored in Apache Maven based packaging and are known as knowledge archives, or KJAR. The rules, processes, assets, and other project artifacts are part of a JAR file built and managed by Maven. A file kept inside the META-INF directory of the KJAR called kmodule.xml can be used to define the KIE bases and sessions. This kmodule.xml file, by default, is empty.
Whenever a runtime component such as Business Central is about to process the KJAR, it looks up kmodule.xml to build the runtime representation.
Deployment descriptors supplement the kmodule.xml file and provide granular control over your deployment. The presence of these descriptors is optional and your deployment will proceed successfully without them. You can set purely technical properties using these descriptors, including meta values such as persistence, auditing, and runtime strategy.
These descriptors allow you to configure the Decision Server on multiple levels, including server level default, different deployment descriptor per KJAR, and other server configurations. You can use descriptors to make simple customizations to the default Decision Server configuration, possibly per KJAR.
You can define these descriptors in a file called kie-deployment-descriptor.xml and place this file next to your kmodule.xml file in the META-INF folder. You can change this default location and the file name by specifying it as a system parameter:
-Dorg.kie.deployment.desc.location=file:/path/to/file/company-deployment-descriptor.xml
-Dorg.kie.deployment.desc.location=file:/path/to/file/company-deployment-descriptor.xml
12.1. Deployment descriptor configuration Copy linkLink copied to clipboard!
Deployment descriptors allow the user to configure the execution server on multiple levels:
- Server level: The main level and the one that applies to all KJARs deployed on the server.
- KJAR level: This enables you to configure descriptors on a per KJAR basis.
- Deploy time level: Descriptors that apply while a KJAR is being deployed.
The granular configuration items specified by the deployment descriptors take precedence over the server level ones, except in case of configuration items that are collection based, which are merged. The hierarchy works like this: deploy time configuration > KJAR configuration > server configuration.
The deploy time configuration applies to deployments done via the REST API.
For example, if the persistence mode (one of the items you can configure) defined at the server level is NONE but the same mode is specified as JPA at the KJAR level, the actual mode will be JPA for that KJAR. If nothing is specified for the persistence mode in the deployment descriptor for that KJAR (or if there is no deployment descriptor), it will fall back to the server level configuration, which in this case is NONE (or to JPA if there is no server level deployment descriptor).
What Can You Configure?
High level technical configuration details can be configured via deployment descriptors. The following table lists these along with the permissible and default values for each.
| Configuration | XML Entry | Permissible Values | Default Value |
|---|---|---|---|
| Persistence unit name for runtime data | persistence-unit | Any valid persistence package name | org.jbpm.domain |
| Persistence unit name for audit data | audit-persistence-unit | Any valid persistence package name | org.jbpm.domain |
| Persistence mode | persistence-mode | JPA, NONE | JPA |
| Audit mode | audit-mode | JPA, JMS or NONE | JPA |
| Runtime Strategy | runtime-strategy | SINGLETON, PER_REQUEST or PER_PROCESS_INSTANCE | SINGLETON |
| List of Event Listeners to be registered | event-listeners |
Valid listener class names as | No default value |
| List of Task Event Listeners to be registered | task-event-listeners |
Valid listener class names as | No default value |
| List of Work Item Handlers to be registered | work-item-handlers |
Valid Work Item Handler classes given as | No default value |
| List of Globals to be registered | globals |
Valid Global variables given as | No default value |
| Marshalling strategies to be registered (for pluggable variable persistence) | marshalling-strategies |
Valid | No default value |
| Required Roles to be granted access to the resources of the KJAR | required-roles | String role names | No default value |
| Additional Environment Entries for KIE session | environment-entries |
Valid | No default value |
| Additional configuration options of KIE session | configurations |
Valid | No default value |
| Classes used for serialization in the remote services | remoteable-class |
Valid | No default value |
Do not use the Singleton runtime strategy with the EJB Timer Scheduler (the default scheduler in Decision Server) in a production environment. This combination can result in Hibernate problems under load. Per process instance runtime strategy is recommended if there is no specific reason to use other strategies. For more information about this limitation, see Hibernate issues with Singleton strategy and EJBTimerScheduler.
12.2. Managing deployment descriptors Copy linkLink copied to clipboard!
Deployment descriptors can be configured in Business Central in Menu → Design → $PROJECT_NAME → Settings → Deployments.
Every time a project is created, a stock kie-deployment-descriptor.xml file is generated with default values.
It is not necessary to provide a full deployment descriptor for all KJARs. Providing partial deployment descriptors is possible and recommended. For example, if you need to use a different audit mode, you can specify that for the KJAR only, all other properties will have the default value defined at the server level.
When using OVERRIDE_ALL merge mode, all configuration items must be specified, because the relevant KJAR will always use specified configuration and will not merge with any other deployment descriptor in the hierarchy.
12.3. Restricting access to the runtime engine Copy linkLink copied to clipboard!
The required-roles configuration item can be edited in the deployment descriptors. This property restricts access to the runtime engine on a per-KJAR or per-server level by ensuring that access to certain processes is only granted to users that belong to groups defined by this property.
The security role can be used to restrict access to process definitions or restrict access at run time.
The default behavior is to add required roles to this property based on repository restrictions. You can edit these properties manually if required by providing roles that match actual roles defined in the security realm.
Procedure
- To open the project deployment descriptors configuration in Business Central, open Menu → Design → $PROJECT_NAME → Settings → Deployments.
- From the list of configuration settings, click Required Roles, then click Add Required Role.
- In the Add Required Role window, type the name of the role that you want to have permission to access this deployment, then click Add.
- To add more roles with permission to access the deployment, repeat the previous steps.
- When you have finished adding all required roles, click Save.
Chapter 13. Prometheus metrics monitoring in Red Hat Decision Manager Copy linkLink copied to clipboard!
Prometheus is an open-source systems monitoring toolkit that you can use with Red Hat Decision Manager to collect and store metrics related to the execution of business rules, processes, Decision Model and Notation (DMN) models, and other Red Hat Decision Manager assets. You can access the stored metrics through a REST API call to the Decision Server, through the Prometheus expression browser, or using a data-graphing tool such as Grafana.
You can configure Prometheus metrics monitoring for an on-premise Decision Server instance, for Decision Server on Spring Boot, or for a Decision Server deployment on Red Hat OpenShift Container Platform.
For the list of available metrics that Decision Server exposes with Prometheus, download the Red Hat Decision Manager 7.4.0 Source Distribution from the Red Hat Customer Portal and navigate to ~/rhdm-7.4.0-sources/src/droolsjbpm-integration-$VERSION/kie-server-parent/kie-server-services/kie-server-services-prometheus/src/main/java/org/kie/server/services/prometheus.
13.1. Configuring Prometheus metrics monitoring for Decision Server Copy linkLink copied to clipboard!
You can configure your Decision Server instances to use Prometheus to collect and store metrics related to your business asset activity in Red Hat Decision Manager. For the list of available metrics that Decision Server exposes with Prometheus, download the Red Hat Decision Manager 7.4.0 Source Distribution from the Red Hat Customer Portal and navigate to ~/rhdm-7.4.0-sources/src/droolsjbpm-integration-$VERSION/kie-server-parent/kie-server-services/kie-server-services-prometheus/src/main/java/org/kie/server/services/prometheus.
Prerequisites
- Decision Server is installed.
-
You have
kie-serveruser role access to Decision Server. - Prometheus is installed. For information about downloading and using Prometheus, see the Prometheus documentation page.
Procedure
-
In your Decision Server instance, set the
org.kie.prometheus.server.ext.disabledsystem property tofalseto enable the Prometheus extension. You can define this property when you start Decision Server or in thestandalone.xmlorstandalone-full.xmlfile of Red Hat Decision Manager distribution. If you are running Red Hat Decision Manager on Spring Boot, add the following dependencies in the
pom.xmlfile of your Maven project and configure the required key in theapplication.propertiessystem property:Spring Boot pom.xml dependencies for Prometheus
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Spring Boot application.properties key for Red Hat Decision Manager and Prometheus
kieserver.drools.enabled=true kieserver.dmn.enabled=true kieserver.prometheus.enabled=true
kieserver.drools.enabled=true kieserver.dmn.enabled=true kieserver.prometheus.enabled=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow In the
prometheus.yamlfile of your Prometheus distribution, add the following settings in thescrape_configssection to configure Prometheus to scrape metrics from Decision Server:Scrape configurations in prometheus.yaml file
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Scrape configurations in prometheus.yaml file for Spring Boot (if applicable)
scrape_configs: job_name: 'kie' metrics_path: /rest/metrics static_configs: - targets: ["HOST:PORT"]
scrape_configs: job_name: 'kie' metrics_path: /rest/metrics static_configs: - targets: ["HOST:PORT"]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the values according to your Decision Server location and settings.
Start the Decision Server instance.
Example start command for Red Hat Decision Manager on Red Hat JBoss EAP
cd ~/EAP_HOME/bin ./standalone.sh --c standalone-full.xml
$ cd ~/EAP_HOME/bin $ ./standalone.sh --c standalone-full.xmlCopy to Clipboard Copied! Toggle word wrap Toggle overflow After you start the configured Decision Server instance, Prometheus begins collecting metrics and Decision Server publishes the metrics to the REST API endpoint
http://HOST:PORT/SERVER/services/rest/metrics(or on Spring Boot, tohttp://HOST:PORT/rest/metrics).In a REST client or curl utility, send a REST API request with the following components to verify that Decision Server is publishing the metrics:
For REST client:
-
Authentication: Enter the user name and password of the Decision Server user with the
kie-serverrole. HTTP Headers: Set the following header:
-
Accept:application/json
-
-
HTTP method: Set to
GET. -
URL: Enter the Decision Server REST API base URL and metrics endpoint, such as
http://localhost:8080/kie-server/services/rest/metrics(or on Spring Boot,http://localhost:8080/rest/metrics).
For curl utility:
-
-u: Enter the user name and password of the Decision Server user with thekie-serverrole. -H: Set the following header:-
accept:application/json
-
-
-X: Set toGET. -
URL: Enter the Decision Server REST API base URL and metrics endpoint, such as
http://localhost:8080/kie-server/services/rest/metrics(or on Spring Boot,http://localhost:8080/rest/metrics).
curl -u 'baAdmin:password@1' -H "accept: application/json" -X GET "http://localhost:8080/kie-server/services/rest/metrics"
curl -u 'baAdmin:password@1' -H "accept: application/json" -X GET "http://localhost:8080/kie-server/services/rest/metrics"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example server response
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the metrics are not available in Decision Server, review and verify the Decision Server and Prometheus configurations described in this section.
You can also interact with your collected metrics in the Prometheus expression browser at
http://HOST:PORT/graph, or integrate your Prometheus data source with a data-graphing tool such as Grafana:Figure 13.1. Prometheus expression browser with Decision Server metrics
Figure 13.2. Prometheus expression browser with Decision Server target
Figure 13.3. Grafana dashboard with Decision Server metrics for DMN models
Figure 13.4. Grafana dashboard with Decision Server metrics for solvers
-
Authentication: Enter the user name and password of the Decision Server user with the
Additional resources
13.2. Configuring Prometheus metrics monitoring for Decision Server on Red Hat OpenShift Container Platform Copy linkLink copied to clipboard!
You can configure your Decision Server deployment on Red Hat OpenShift Container Platform to use Prometheus to collect and store metrics related to your business asset activity in Red Hat Decision Manager. For the list of available metrics that Decision Server exposes with Prometheus, download the Red Hat Decision Manager 7.4.0 Source Distribution from the Red Hat Customer Portal and navigate to ~/rhdm-7.4.0-sources/src/droolsjbpm-integration-$VERSION/kie-server-parent/kie-server-services/kie-server-services-prometheus/src/main/java/org/kie/server/services/prometheus.
Prerequisites
- Decision Server is installed and deployed on Red Hat OpenShift Container Platform. For more information about Decision Server on OpenShift, see the relevant OpenShift deployment option in the Product documentation for Red Hat Decision Manager 7.4.
-
You have
kie-serveruser role access to Decision Server. - Prometheus Operator is installed. For information about downloading and using Prometheus Operator, see the Prometheus Operator project on GitHub.
Procedure
In the
DeploymentConfigobject of your Decision Server deployment on OpenShift, set thePROMETHEUS_SERVER_EXT_DISABLEDenvironment variable tofalseto enable the Prometheus extension. You can set this variable in the OpenShift web console or use theoccommand in a command terminal:oc set env dc/<dc_name> PROMETHEUS_SERVER_EXT_DISABLED=false -n <namespace>
oc set env dc/<dc_name> PROMETHEUS_SERVER_EXT_DISABLED=false -n <namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you have not yet deployed your Decision Server on OpenShift, then in the OpenShift template that you plan to use for your OpenShift deployment (for example,
rhdm74-prod-immutable-kieserver.yaml), you can set thePROMETHEUS_SERVER_EXT_DISABLEDtemplate parameter tofalseto enable the Prometheus extension.If you are using the OpenShift Operator to deploy Decision Server on OpenShift, then in your Decision Server configuration, set the
PROMETHEUS_SERVER_EXT_DISABLEDenvironment variable tofalseto enable the Prometheus extension:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
service-metrics.yamlfile to add a service that exposes the metrics from Decision Server to Prometheus:Copy to Clipboard Copied! Toggle word wrap Toggle overflow In a command terminal, use the
occommand to apply theservice-metrics.yamlfile to your OpenShift deployment:oc apply -f service-metrics.yaml
oc apply -f service-metrics.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Create an OpenShift secret, such as
metrics-secret, to access the Prometheus metrics on Decision Server. The secret must contain the "username" and "password" elements with Decision Server user credentials. For information about OpenShift secrets, see the Secrets chapter in the OpenShift Developer Guide. Create a
service-monitor.yamlfile that defines theServiceMonitorobject. A service monitor enables Prometheus to connect to the Decision Server metrics service.Copy to Clipboard Copied! Toggle word wrap Toggle overflow In a command terminal, use the
occommand to apply theservice-monitor.yamlfile to your OpenShift deployment:oc apply -f service-monitor.yaml
oc apply -f service-monitor.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow After you complete these configurations, Prometheus begins collecting metrics and Decision Server publishes the metrics to the REST API endpoint
http://HOST:PORT/kie-server/services/rest/metrics.You can interact with your collected metrics in the Prometheus expression browser at
http://HOST:PORT/graph, or integrate your Prometheus data source with a data-graphing tool such as Grafana.The host and port for the Prometheus expression browser location
http://HOST:PORT/graphwas defined in the route where you exposed the Prometheus web console when you installed the Prometheus Operator. For information about OpenShift routes, see the Routes chapter in the OpenShift Architecture documentation.Figure 13.5. Prometheus expression browser with Decision Server metrics
Figure 13.6. Prometheus expression browser with Decision Server target
Figure 13.7. Grafana dashboard with Decision Server metrics for DMN models
Figure 13.8. Grafana dashboard with Decision Server metrics for solvers
Additional resources
Chapter 14. Configuring OpenShift connection timeout Copy linkLink copied to clipboard!
By default, the OpenShift route is configured to time out HTTP requests that are longer than 30 seconds. This may cause session timeout issues in Business Central resulting in the following behaviors:
- "Unable to complete your request. The following exception occurred: (TypeError) : Cannot read property 'indexOf' of null."
- "Unable to complete your request. The following exception occurred: (TypeError) : b is null."
- A blank page is displayed when clicking the Project or Server links in Business Central.
All Business Central templates already include extended timeout configuration.
To configure longer timeout on Business Central OpenShift routes, add the haproxy.router.openshift.io/timeout: 60s annotation on the target route:
For a full list of global route-specific timeout annotations, see the OpenShift Documentation.
Chapter 15. Define the LDAP login domain Copy linkLink copied to clipboard!
When you are setting up Red Hat Decision Manager to use LDAP for authentication and authorization, define the LDAP login domain because the the Git SSH authentication may use another security domain.
To define the LDAP login domain, use the org.uberfire.domain system property. For example, on Red Hat JBoss Enterprise Application Platform, add this property in the standalone.xml file as shown:
<system-properties> <!-- other system properties --> <property name="org.uberfire.domain" value="LDAPAuth"/> </system-properties>
<system-properties>
<!-- other system properties -->
<property name="org.uberfire.domain" value="LDAPAuth"/>
</system-properties>
Ensure that the authenticated user has appropriate roles (admin,analyst,reviewer) associated with it in LDAP.
Chapter 16. Authenticating third-party clients through RH-SSO Copy linkLink copied to clipboard!
To use the different remote services provided by Business Central or by Decision Server, your client, such as curl, wget, web browser, or a custom REST client, must authenticate through the RH-SSO server and have a valid token to perform the requests. To use the remote services, the authenticated user must have the following roles:
-
rest-allfor using Business Central remote services. -
kie-serverfor using the Decision Server remote services.
Use the RH-SSO Admin Console to create these roles and assign them to the users that will consume the remote services.
Your client can authenticate through RH-SSO using one of these options:
- Basic authentication, if it is supported by the client
- Token-based authentication
16.1. Basic authentication Copy linkLink copied to clipboard!
If you enabled basic authentication in the RH-SSO client adapter configuration for both Business Central and Decision Server, you can avoid the token grant and refresh calls and call the services as shown in the following examples:
For web based remote repositories endpoint:
curl http://admin:password@localhost:8080/decision-central/rest/repositories
curl http://admin:password@localhost:8080/decision-central/rest/repositoriesCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Decision Server:
curl http://admin:password@localhost:8080/kie-execution-server/services/rest/server/
curl http://admin:password@localhost:8080/kie-execution-server/services/rest/server/Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 17. Decision Server system properties Copy linkLink copied to clipboard!
The Decision Server accepts the following system properties (bootstrap switches) to configure the behavior of the server:
| Property | Values | Default | Description |
|---|---|---|---|
|
|
|
|
If set to |
|
|
|
|
If set to |
|
|
|
|
If set to |
|
|
|
|
If set to |
|
|
|
|
If set to |
Some Decision Manager controller properties listed in the following table are marked as required. Set these properties when you create or remove Decision Server containers in Business Central. If you use the Decision Server separately without any interaction with Business Central, you do not need to set the required properties.
| Property | Values | Default | Description |
|---|---|---|---|
|
| String | N/A | An arbitrary ID to be assigned to the server. If a headless Decision Manager controller is configured outside of Business Central, this is the ID under which the server connects to the headless Decision Manager controller to fetch the KIE container configurations. If not provided, the ID is automatically generated. |
|
| String |
| The user name used to connect with the Decision Server from the Decision Manager controller, required when running in managed mode. Set this property in Business Central system properties. Set this property when using a Decision Manager controller. |
|
| String |
| The password used to connect with the Decision Server from the Decision Manager controller, required when running in managed mode. Set this property in Business Central system properties. Set this property when using a Decision Manager controller. |
|
| String | N/A | A property that enables you to use token-based authentication between the Decision Manager controller and the Decision Server instead of the basic user name and password authentication. The Decision Manager controller sends the token as a parameter in the request header. The server requires long-lived access tokens because the tokens are not refreshed. |
|
| URL | N/A |
The URL of the Decision Server instance used by the Decision Manager controller to call back on this server, for example, |
|
| Comma-separated list | N/A |
A comma-separated list of URLs to the Decision Manager controller REST endpoints, for example, |
|
| String |
| The user name to connect to the Decision Manager controller REST API. Setting this property is required when using a Decision Manager controller. |
|
| String |
| The password to connect to the Decision Manager controller REST API. Setting this property is required when using a Decision Manager controller. |
|
| String | N/A | A property that enables you to use token-based authentication between the Decision Server and the Decision Manager controller instead of the basic user name and password authentication. The server sends the token as a parameter in the request header. The server requires long-lived access tokens because the tokens are not refreshed. |
|
| Long |
| The waiting time in milliseconds between repeated attempts to connect the Decision Server to the Decision Manager controller when the server starts. |
| Property | Values | Default | Description |
|---|---|---|---|
|
| URL | N/A |
The URL is used to load a Java Cryptography Extension KeyStore (JCEKS). For example, |
|
| String | N/A | The password is used for the JCEKS. |
|
| String | N/A | The alias name of the key for REST services where the password is stored. |
|
| String | N/A | The password of an alias for REST services. |
|
| String | N/A | The alias of the key for default REST Decision Manager controller. |
|
| String | N/A | The password of an alias for default REST Decision Manager controller. |
| Property | Values | Default | Description |
|---|---|---|---|
|
| Path | N/A |
The location of a custom |
|
| String |
| The response queue JNDI name for JMS. |
|
|
|
|
When set to |
|
| String | N/A |
The JAAS |
|
| Path |
| The location where Decision Server state files are stored. |
|
|
|
| A property that instructs the Decision Server to hold the deployment until the Decision Manager controller provides the container deployment configuration. This property only affects servers running in managed mode. The following options are available:
* |
|
|
|
| The Startup strategy of Decision Server used to control the KIE containers that are deployed and the order in which they are deployed. |
|
|
|
|
When set to |
|
|
Java packages like | N/A | A property that specifies additional packages to whitelist for marshalling using XStream. |
|
| String |
|
Fully qualified name of the class that implements |
Chapter 18. Decision Server capabilities and extensions Copy linkLink copied to clipboard!
The capabilities in Decision Server are determined by plug-in extensions that you can enable, disable, or further extend to meet your business needs. Decision Server supports the following default capabilities and extensions:
| Capability name | Extension name | Description |
|---|---|---|
|
|
| Provides the core capabilities of Decision Server, such as creating and disposing KIE containers on your server instance |
|
|
| Provides the Business Rule Management (BRM) capabilities, such as inserting facts and executing business rules |
|
|
| Provides the Business Resource Planning (BRP) capabilities, such as implementing solvers |
|
|
| Provides the Decision Model and Notation (DMN) capabilities, such as managing DMN data types and executing DMN models |
|
|
| Provides the Swagger web-interface capabilities for interacting with the Decision Server REST API |
To view the supported extensions of a running Decision Server instance, send a GET request to the following REST API endpoint and review the XML or JSON server response:
Base URL for GET request for Decision Server information
http://SERVER:PORT/kie-server/services/rest/server
http://SERVER:PORT/kie-server/services/rest/server
Example JSON response with Decision Server information
To enable or disable Decision Server extensions, configure the related *.server.ext.disabled Decision Server system property. For example, to disable the BRM capability, set the system property org.drools.server.ext.disabled=true. For all Decision Server system properties, see Chapter 17, Decision Server system properties.
By default, Decision Server extensions are exposed through REST or JMS data transports and use predefined client APIs. You can extend existing Decision Server capabilities with additional REST endpoints, extend supported transport methods beyond REST or JMS, or extend functionality in the Decision Server client.
This flexibility in Decision Server functionality enables you to adapt your Decision Server instances to your business needs, instead of adapting your business needs to the default Decision Server capabilities.
If you extend Decision Server functionality, Red Hat does not support the custom code that you use as part of your custom implementations and extensions.
18.1. Extending an existing Decision Server capability with a custom REST API endpoint Copy linkLink copied to clipboard!
The Decision Server REST API enables you to interact with your KIE containers and business assets (such as business rules, processes, and solvers) in Red Hat Decision Manager without using the Business Central user interface. The available REST endpoints are determined by the capabilities enabled in your Decision Server system properties (for example, org.drools.server.ext.disabled=false for the BRM capability). You can extend an existing Decision Server capability with a custom REST API endpoint to further adapt the Decision Server REST API to your business needs.
As an example, this procedure extends the Drools Decision Server extension (for the BRM capability) with the following custom REST API endpoint:
Example custom REST API endpoint
/server/containers/instances/{containerId}/ksession/{ksessionId}
/server/containers/instances/{containerId}/ksession/{ksessionId}
This example custom endpoint accepts a list of facts to be inserted into the working memory of the decision engine, automatically executes all rules, and retrieves all objects from the KIE session in the specified KIE container.
Procedure
Create an empty Maven project and define the following packaging type and dependencies in the
pom.xmlfile for the project:Example pom.xml file in the sample project
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Implement the
org.kie.server.services.api.KieServerApplicationComponentsServiceinterface in a Java class in your project, as shown in the following example:Sample implementation of the
KieServerApplicationComponentsServiceinterfaceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Delivers REST endpoints to the Decision Server infrastructure that is deployed when the application starts.
- 2
- Specifies the extension that you are extending, such as the
Droolsextension in this example. - 3
- Returns all resources that the REST container must deploy. Each extension that is enabled in your Decision Server instance calls the
getAppComponentsmethod, so theif ( !OWNER_EXTENSION.equals(extension) )call returns an empty collection for any extensions other than the specifiedOWNER_EXTENSIONextension. - 4
- Lists the services from the specified extension that you want to use, such as the
RulesExecutionServiceandKieServerRegistryservices from theDroolsextension in this example. - 5
- Specifies the transport type for the extension, either
RESTorJMS(RESTin this example), and theCustomResourceclass that returns the resource as part of thecomponentslist.
Implement the
CustomResourceclass that the Decision Server can use to provide the additional functionality for the new REST resource, as shown in the following example:Sample implementation of the
CustomResourceclassCopy to Clipboard Copied! Toggle word wrap Toggle overflow In this example, the
CustomResourceclass for the custom endpoint specifies the following data and behavior:-
Uses the base endpoint
server/containers/instances/{containerId}/ksession -
Uses
POSTHTTP method Expects the following data to be given in REST requests:
-
The
containerIdas a path argument -
The
ksessionIdas a path argument - List of facts as a message payload
-
The
Supports all Decision Server data formats:
- XML (JAXB, XStream)
- JSON
-
Unmarshals the payload into a
List<?>collection and, for each item in the list, creates anInsertCommandinstance followed byFireAllRulesandGetObjectcommands. -
Adds all commands to the
BatchExecutionCommandinstance that calls to the decision engine.
-
Uses the base endpoint
-
To make the new endpoint discoverable for Decision Server, create a
META-INF/services/org.kie.server.services.api.KieServerApplicationComponentsServicefile in your Maven project and add the fully qualified class name of theKieServerApplicationComponentsServiceimplementation class within the file. For this example, the file contains the single lineorg.kie.server.ext.drools.rest.CusomtDroolsKieServerApplicationComponentsService. -
Build your project and copy the resulting JAR file into the
~/kie-server.war/WEB-INF/libdirectory of your project. For example, on Red Hat JBoss EAP, the path to this directory isEAP_HOME/standalone/deployments/kie-server.war/WEB-INF/lib. Start the Decision Server and deploy the built project to the running Decision Server. You can deploy the project using either the Business Central interface or the Decision Server REST API (a
PUTrequest tohttp://SERVER:PORT/kie-server/services/rest/server/containers/{containerId}).After your project is deployed on a running Decision Server, you can start interacting with your new REST endpoint.
For this example, you can use the following information to invoke the new endpoint:
-
Example request URL:
http://localhost:8080/kie-server/services/rest/server/containers/instances/demo/ksession/defaultKieSession -
HTTP method:
POST HTTP headers:
-
Content-Type: application/json -
Accept: application/json
-
Example message payload:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Example server response:
200(success) Example server log output:
13:37:20,347 INFO [stdout] (default task-24) Hello mary 13:37:20,348 INFO [stdout] (default task-24) Hello john
13:37:20,347 INFO [stdout] (default task-24) Hello mary 13:37:20,348 INFO [stdout] (default task-24) Hello johnCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Example request URL:
18.2. Extending Decision Server to use a custom data transport Copy linkLink copied to clipboard!
By default, Decision Server extensions are exposed through REST or JMS data transports. You can extend Decision Server to support a custom data transport to adapt Decision Server transport protocols to your business needs.
As an example, this procedure adds a custom data transport to Decision Server that uses the Drools extension and that is based on Apache MINA, an open-source Java network-application framework. The example custom MINA transport exchanges string-based data that relies on existing marshalling operations and supports only JSON format.
Procedure
Create an empty Maven project and define the following packaging type and dependencies in the
pom.xmlfile for the project:Example pom.xml file in the sample project
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Implement the
org.kie.server.services.api.KieServerExtensioninterface in a Java class in your project, as shown in the following example:Sample implementation of the
KieServerExtensioninterfaceCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
KieServerExtensioninterface is the main extension interface that Decision Server can use to provide the additional functionality for the new MINA transport. The interface consists of the following components:Overview of the
KieServerExtensioninterfaceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specifies the capability that is covered by this extension. The capability must be unique within Decision Server.
- 2
- Defines a human-readable name for the extension.
- 3
- Determines when the specified extension should be started. For extensions that have dependencies on other extensions, this setting must not conflict with the parent setting. For example, in this case, this custom extension depends on the
Droolsextension, which hasStartOrderset to0, so this custom add-on extension must be greater than0(set to20in the sample implementation).
In the previous
MinaDroolsKieServerExtensionsample implementation of this interface, theinitmethod is the main element for collecting services from theDroolsextension and for bootstrapping the MINA server. All other methods in theKieServerExtensioninterface can remain with the standard implementation to fulfill interface requirements.The
TextBasedIoHandlerAdapterclass is the handler on the MINA server that reacts to incoming requests.Implement the
TextBasedIoHandlerAdapterhandler for the MINA server, as shown in the following example:Sample implementation of the
TextBasedIoHandlerAdapterhandlerCopy to Clipboard Copied! Toggle word wrap Toggle overflow In this example, the handler class receives text messages and executes them in the
Droolsservice.Consider the following handler requirements and behavior when you use the
TextBasedIoHandlerAdapterhandler implementation:- Anything that you submit to the handler must be a single line because each incoming transport request is a single line.
-
You must pass a KIE container ID in this single line so that the handler expects the format
containerID|payload. - You can set a response in the way that it is produced by the marshaller. The response can be multiple lines.
-
The handler supports a stream mode that enables you to send commands without disconnecting from a Decision Server session. To end a Decision Server session in stream mode, send either an
exitorquitcommand to the server.
-
To make the new data transport discoverable for Decision Server, create a
META-INF/services/org.kie.server.services.api.KieServerExtensionfile in your Maven project and add the fully qualified class name of theKieServerExtensionimplementation class within the file. For this example, the file contains the single lineorg.kie.server.ext.mina.MinaDroolsKieServerExtension. -
Build your project and copy the resulting JAR file and the
mina-core-2.0.9.jarfile (which the extension depends on in this example) into the~/kie-server.war/WEB-INF/libdirectory of your project. For example, on Red Hat JBoss EAP, the path to this directory isEAP_HOME/standalone/deployments/kie-server.war/WEB-INF/lib. Start the Decision Server and deploy the built project to the running Decision Server. You can deploy the project using either the Business Central interface or the Decision Server REST API (a
PUTrequest tohttp://SERVER:PORT/kie-server/services/rest/server/containers/{containerId}).After your project is deployed on a running Decision Server, you can view the status of the new data transport in your Decision Server log and start using your new data transport:
New data transport in the server log
Drools-Mina KIE Server extension -- Mina server started at localhost and port 9123 Drools-Mina KIE Server extension has been successfully registered as server extension
Drools-Mina KIE Server extension -- Mina server started at localhost and port 9123 Drools-Mina KIE Server extension has been successfully registered as server extensionCopy to Clipboard Copied! Toggle word wrap Toggle overflow For this example, you can use Telnet to interact with the new MINA-based data transport in Decision Server:
Starting Telnet and connecting to Decision Server on port 9123 in a command terminal
telnet 127.0.0.1 9123
telnet 127.0.0.1 9123Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example interactions with Decision Server in a command terminal
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example server log output
16:33:40,206 INFO [stdout] (NioProcessor-2) Hello john 16:34:03,877 INFO [stdout] (NioProcessor-2) Hello mary 16:34:19,800 INFO [stdout] (NioProcessor-2) Hello james
16:33:40,206 INFO [stdout] (NioProcessor-2) Hello john 16:34:03,877 INFO [stdout] (NioProcessor-2) Hello mary 16:34:19,800 INFO [stdout] (NioProcessor-2) Hello jamesCopy to Clipboard Copied! Toggle word wrap Toggle overflow
18.3. Extending the Decision Server client with a custom client API Copy linkLink copied to clipboard!
Decision Server uses predefined client APIs that you can interact with to use Decision Server services. You can extend the Decision Server client with a custom client API to adapt Decision Server services to your business needs.
As an example, this procedure adds a custom client API to Decision Server to accommodate a custom data transport (configured previously for this scenario) that is based on Apache MINA, an open-source Java network-application framework.
Procedure
Create an empty Maven project and define the following packaging type and dependencies in the
pom.xmlfile for the project:Example pom.xml file in the sample project
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Implement the relevant
ServicesClientinterface in a Java class in your project, as shown in the following example:Sample
RulesMinaServicesClientinterfacepublic interface RulesMinaServicesClient extends RuleServicesClient { }public interface RulesMinaServicesClient extends RuleServicesClient { }Copy to Clipboard Copied! Toggle word wrap Toggle overflow A specific interface is required because you must register client implementations based on the interface, and you can have only one implementation for a given interface.
For this example, the custom MINA-based data transport uses the
Droolsextension, so this exampleRulesMinaServicesClientinterface extends the existingRuleServicesClientclient API from theDroolsextension.Implement the
RulesMinaServicesClientinterface that the Decision Server can use to provide the additional client functionality for the new MINA transport, as shown in the following example:Sample implementation of the
RulesMinaServicesClientinterfaceCopy to Clipboard Copied! Toggle word wrap Toggle overflow This example implementation specifies the following data and behavior:
- Uses socket-based communication for simplicity
-
Relies on default configurations from the Decision Server client and uses
ServerUrlfor providing the host and port of the MINA server - Specifies JSON as the marshalling format
-
Requires received messages to be JSON objects that start with an open bracket
{ - Uses direct socket communication with a blocking API while waiting for the first line of the response and then reads all lines that are available
- Does not use stream mode and therefore disconnects the Decision Server session after invoking a command
Implement the
org.kie.server.client.helper.KieServicesClientBuilderinterface in a Java class in your project, as shown in the following example:Sample implementation of the
KieServicesClientBuilderinterfaceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Enables you to provide additional client APIs to the generic Decision Server client infrastructure
- 2
- Defines the Decision Server capability (extension) that the client uses
- 3
- Provides a map of the client implementations, where the key is the interface and the value is the fully initialized implementation
-
To make the new client API discoverable for the Decision Server client, create a
META-INF/services/org.kie.server.client.helper.KieServicesClientBuilderfile in your Maven project and add the fully qualified class name of theKieServicesClientBuilderimplementation class within the file. For this example, the file contains the single lineorg.kie.server.ext.mina.client.MinaClientBuilderImpl. -
Build your project and copy the resulting JAR file into the
~/kie-server.war/WEB-INF/libdirectory of your project. For example, on Red Hat JBoss EAP, the path to this directory isEAP_HOME/standalone/deployments/kie-server.war/WEB-INF/lib. Start the Decision Server and deploy the built project to the running Decision Server. You can deploy the project using either the Business Central interface or the Decision Server REST API (a
PUTrequest tohttp://SERVER:PORT/kie-server/services/rest/server/containers/{containerId}).After your project is deployed on a running Decision Server, you can start interacting with your new Decision Server client. You use your new client in the same way as the standard Decision Server client, by creating the client configuration and client instance, retrieving the service client by type, and invoking client methods.
For this example, you can create a
RulesMinaServiceClientclient instance and invoke operations on Decision Server through the MINA transport:Sample implementation to create the
RulesMinaServiceClientclientCopy to Clipboard Copied! Toggle word wrap Toggle overflow Sample configuration to invoke operations on Decision Server through the MINA transport
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 19. Additional resources Copy linkLink copied to clipboard!
- Installing and configuring Red Hat Decision Manager on Red Hat JBoss EAP 7.2
- Planning a Red Hat Decision Manager installation
- Installing and configuring Red Hat Decision Manager on Red Hat JBoss EAP 7.2
- Deploying a Red Hat Decision Manager immutable server environment on Red Hat OpenShift Container Platform
- Deploying a Red Hat Decision Manager authoring or managed server environment on Red Hat OpenShift Container Platform
- Deploying a Red Hat Decision Manager environment on Red Hat OpenShift Container Platform using Automation Broker
- Deploying a Red Hat Decision Manager environment on Red Hat OpenShift Container Platform using Operators
Appendix A. Versioning information Copy linkLink copied to clipboard!
Documentation last updated on Wednesday, July 08, 2020.