Red Hat Training

A Red Hat training course is available for Red Hat Decision Manager

Chapter 3. Using Decision Central to deploy and manage decision services

You can use Decision Central to build and deploy decision services. If you connect multiple Decision Servers to the Decision Central, you can use the web UI to deploy and manage decision services on all the servers.

You can group Decision Servers into different server templates. The same decision services are automatically run servers belonging to the same server template. But you can deploy different decision services or different versions of decision services on different templates.

You can configure the template name for each Decision Server in the configuration file for that server.

Important

You can not move a Decision Server into a different template using Decision Central. You must change the configuration file of the server to change the server template name for it.

3.1. Building and deploying a decision service in Decision Central

You can build a decision service in Decision Central and automatically deploy it on a Decision Server.

Procedure

  1. In the main menu, click Projects.
  2. Click the project name.
  3. Click the Build & Deploy button.
  4. If only one Decision Server is connected to the Decision Central, or if all connected Decision Servers are in the same server template, the project is automatically built and deployed. Otherwise, Decision Central displays a dialog. In this dialog, set the following values:

    • Container ID and Container Alias identify the container running the service within the Decision Server. You normally do not need to change these settings.
    • Server template : select the server template for deploying this project. You can later deploy it to other templates without rebuilding it.
    • Start container? : if you clear this box, the service is deployed onto the server but not started. Normally, leave this box checked.

3.2. Managing deployment of decision services in Decision Central

You can use Decision Central to manage deployment of decision services on one or more Decision Servers. Each Decision Server must be configured to connect to the Decision Central.

A decision service always runs in a container on a Decision Server. You can create containers and start them on Decision Servers; when you build and deploy a project, the container is created automatically. A container is always created in a particular server template.

You can also start, stop, and delete containers.

3.2.1. Creating a container

You can create a container from a decision service that was previously built in Decision Central.

Procedure

  1. In the main menu, click Execution servers.
  2. Under Server templates, select a template.
  3. Under KIE Containers, click Add Container.
  4. Decision Central displays a dialog. In the table in the dialog, select a GAV and click the Select button next to the GAV.
  5. If you want to start the service immediately, select the Start container? box.
  6. Click the Finish button.

Result

A container is created for the service. This container is placed on the Decision Servers that are configured for this server template. If you have selected Start container?, the service is started.

3.2.2. Managing containers

When a container is started, the service in the container is available for use. You can start, stop, or remove containers with decision services as necessary.

Procedure

  1. In the main menu, click Execution servers.
  2. Under Server templates, select a template.
  3. Under KIE Containers, select a container.
  4. Click the Start, Stop, or Remove button.
Important

You cannot remove a container that is running. To remove a running container, stop it and then remove it.

3.3. Configuring a Decision Server to connect to Decision Central

You can configure a Decision Server to connect to an existing Decision Central. You can also configure the name of the server template. The server becomes a part of that server template; any decision services deployed on the template are deployed on this server.

Important

If you are deploying the Decision Server on OpenShift, see Deploying Red Hat Decision Manager on Red Hat OpenShift Container Platform for instructions about configuring it to connect to a Decision Central.

Procedure

  1. Install the Decision Server. See Installing Red Hat Decision Manager on premise for instructions.
  2. Create a settings.xml file for connecting to the Maven repository that the Decision Central uses. If you have not changed the configuration of Decision Central, it uses its own built-in Maven repository. Use the following contents for settings.xml:

    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    
      <servers>
        <server>
          <id>remote-repo</id>
          <username>user</username>
          <password>pwd</password>
        </server>
      </servers>
      <profiles>
        <profile>
          <id>additional-maven-repos</id>
          <repositories>
            <repository>
              <id>remote-repo</id>
              <url>http://centralhost:centralport/decision-central/maven2/</url>
            </repository>
          </repositories>
        </profile>
      </profiles>
      <activeProfiles>
        <activeProfile>additional-maven-repos</activeProfile>
      </activeProfiles>
    </settings>

    Replace the following values:

    • user: the user name for a user that can log into Decision Central
    • pwd: the password for the user that can log into Decision Central
    • centralhost: the host name for the Decision Central
    • centralport: the port for the Decision Central

      If the Decision Central is deployed on OpenShift, remove decision-central/ from the URL.

      Save the file in a known location, for example, /opt/maven/settings.xml .

  3. In the <eap_home>/standalone/configuration/standalone.xml file, under the <system-properties> tag, set the following properties:

    • org.kie.server.controller.user: user name of an account that can log on to the Decision Central.
    • org.kie.server.controller.pwd: password for the account.
    • org.kie.server.controller: the URL for connecting to the API of the Decision Central. Normally, it is http://<centralhost>:<centralport>/decision-central/rest/controller , where <centralhost> and <centralport> are the host name and port for the Decision Central. If the Decision Central is deployed on OpenShift, remove decision-central/ from the URL.
    • org.kie.server.location: the URL for connecting to the API of the Decision Server. Normally, it is http://<serverhost>:<serverport>/kie-server/services/rest/server , where <serverhost> and <serverport> are the host name and port for the Decision Server.
    • org.kie.server.id: the name of a server template. If this server template does not exist on the Decision Central, it is created automatically when the Decision Server connects to the Decision Central.
    • kie.maven.settings.custom : the full path to the settings.xml file for connecting to the Maven repository.

      For example:

      <property name="org.kie.server.controller.user" value="central_user"/>
      <property name="org.kie.server.controller.password" 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="kie.maven.settings.custom" value="/opt/maven/settings.xml"/>
  4. Start or restart the Decision Server.