Red Hat Training

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

Chapter 2. Project deployment in Decision Central

You can use Decision Central to develop your business assets and services and to manage Decision Servers configured for project deployment. When your project is developed, you can build the project in Decision Central and deploy it automatically to the Decision Server. To enable automatic deployment, Decision Central includes a built-in Maven repository. From Decision Central, you can start, stop, or remove the deployment units (KIE containers) that contain the services and their project versions that you have built and deployed.

You can also connect several Decision Servers to the same Decision Central instance and group them into different server configurations (in MenuDeployExecution Servers). Servers belonging to the same server configuration run the same services, but you can deploy different projects or different versions of projects on different configurations.

For example, you could have test servers in the Test configuration and production servers in a Production configuration. As you develop business assets and services in a project, you deploy the project on the Test server configuration and then, when a version of the project is sufficiently tested, you can deploy it on the Production server configuration. In this case, to keep developing the project, change the version in the project settings. Then the new version and the old version are seen as different artifacts in the built-in Maven repository. You can deploy the new version on the Test server configuration and keep running the old version on the Production server configuration. This deployment process is simple but has significant limitations. Notably, there is not enough access control: a developer can deploy a project directly into a production environment.

Important

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

2.1. Configuring a Decision Server to connect to Decision Central

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 Decision Central.

Note

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 Decision Central.

Prerequisite

Decision Server is installed. For installation options, see Planning a Red Hat Decision Manager installation.

Procedure

  1. In your Red Hat Decision Manager installation directory, navigate to the standalone-full.xml file. 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.
  2. Open standalone-full.xml and 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 Decision Central.
    • org.kie.server.controller.pwd: The password of the user who can log in to the Decision Central.
    • org.kie.server.controller: The URL for connecting to the API of Decision Central. Normally, the URL is http://<centralhost>:<centralport>/decision-central/rest/controller, where <centralhost> and <centralport> are the host name and port for Decision Central. If Decision Central is deployed on OpenShift, remove decision-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 Decision Central, it is created automatically when Decision Server connects to Decision 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"/>
  3. Start or restart the Decision Server.

2.2. Configuring an external Maven repository for Decision Central and Decision Server

You can configure Decision Central and Decision Server to use an external Maven repository, such as Nexus or Artifactory, instead of the built-in repository. This enables Decision Central and Decision Server to access and download artifacts that are maintained in the external Maven repository.

Note

For information about configuring an external Maven repository for an authoring environment on Red Hat OpenShift Container Platform, see Deploying a Red Hat Decision Manager authoring or managed server environment on Red Hat OpenShift Container Platform.

Prerequisite

Decision Central and Decision Server are installed. For installation options, see Planning a Red Hat Decision Manager installation.

Procedure

  1. Create a Maven settings.xml file with connection and access details for your external repository. For details about the settings.xml file, see the Maven Settings Reference.
  2. Save the file in a known location, for example, /opt/custom-config/settings.xml.
  3. In your Red Hat Decision Manager installation directory, navigate to the standalone-full.xml file. 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.
  4. Open standalone-full.xml and under the <system-properties> tag, set the kie.maven.settings.custom property to the full path name of the settings.xml file.

    For example:

    <property name="kie.maven.settings.custom" value="/opt/custom-config/settings.xml"/>
  5. Start or restart Decision Central and Decision Server.

Next steps

For each Decision Central project that you want to export or push as a KJAR artifact to the external Maven repository, you must add the repository information in the project pom.xml file. For instructions, see Section 2.3, “Exporting a Decision Central project to an external Maven repository”.

2.3. Exporting a Decision Central project to an external Maven repository

If you configured an external Maven repository for Decision Central and Decision Server, you must add the repository information in the pom.xml file for each Decision Central project that you want to export or push as a KJAR artifact to that external repository. You can then progress the project KJAR files through the repository as necessary to implement your integration process, and deploy the KJAR files using Decision Central or the Decision Server REST API.

Prerequisite

You configured Decision Central and Decision Server to use an external Maven repository. If you deployed Decision Central on-premise, for more information about configuring an external Maven repository, see Section 2.2, “Configuring an external Maven repository for Decision Central and Decision Server”. If you deployed your authoring environment on Red Hat OpenShift Container Platform, for more information, see Deploying a Red Hat Decision Manager authoring or managed server environment on Red Hat OpenShift Container Platform.

Procedure

  1. In Decision Central, go to MenuDesignProjects, click the project name, and select any asset in the project.
  2. In the Project Explorer menu on the left side of the screen, click the Customize View gear icon and select Repository Viewpom.xml.
  3. Add the following settings at the end of the project pom.xml file (before the </project> closing tag). The values must correspond to the settings that you defined in your settings.xml file.

    <distributionManagement>
    <repository>
    <id>${maven-repo-id}</id>
    <url>${maven-repo-url}</url>
    <layout>default</layout>
    </repository>
    </distributionManagement>
  4. Click Save to save the pom.xml file changes.

Repeat this procedure for each Decision Central project that you want to export or push as a KJAR artifact to the external Maven repository.

2.4. Building and deploying a project in Decision Central

After your project is developed, you can build the project in Decision Central and deploy it to the configured Decision Server. Projects in Decision Central are packaged automatically as KJARs with all necessary components when you build and deploy the projects.

Procedure

  1. In Decision Central, go to MenuDesignProjects and click the project name.
  2. In the upper-right corner, click Deploy to build and deploy the project.

    Note

    To compile the project without deploying it to Decision Server, click Build.

    If only one Decision Server is connected to Decision Central, or if all connected Decision Servers are in the same server configuration, the services in the project are started automatically in a deployment unit (KIE container).

    If multiple server configurations are available, a deployment dialog is displayed in Decision Central, prompting you to specify server and deployment details.

  3. If the deployment dialog appears, verify or set the following values:

    • Deployment Unit Id / Deployment Unit Alias: Verify the name and alias of the deployment unit (KIE container) running the service within the Decision Server. You normally do not need to change these settings.
    • Server Configuration: Select the server configuration for deploying this project. You can later deploy it to other configured servers without rebuilding the project.
    • Start Deployment Unit?: Verify that this box is selected to start the deployment unit (KIE container). If you clear this box, the service is deployed onto the server but not started.

2.5. Deployment units in Decision Central

The services in a project are consumed at run time through an instantiated KIE container, or deployment unit, on a configured Decision Server. When you build and deploy a project in Decision Central, the deployment unit is created automatically in the configured server. You can start, stop, or remove deployment units in Decision Central as needed. You can also create additional deployment units from previously built projects and start them on existing or new Decision Servers configured in Decision Central.

2.5.1. Creating a deployment unit in Decision Central

One or more deployment units should already exist as part of your Red Hat Decision Manager configuration, but if not, you can create a deployment unit from a project that was previously built in Decision Central.

Prerequisite

The project or projects for which you are creating the new deployment unit has been built in Decision Central.

Procedure

  1. In Decision Central, go to MenuDeployExecution servers.
  2. Under Server Configurations, select an existing configuration or click New Server Configuration to create a new configuration.
  3. Under Deployment Units, click Add Deployment Unit.
  4. In the table within the window, select a GAV and click Select next to the GAV to populate the deployment unit data fields.
  5. Select the Start Deployment Unit? box to start the service immediately, or clear the box to start it later.
  6. Click Finish.

    The new deployment unit for the service is created and placed on the Decision Servers that are configured for this server configuration. If you have selected Start Deployment Unit?, the service is started.

2.5.2. Starting, stopping, and removing deployment units in Decision Central

When a deployment unit is started, the services in the deployment unit are available for use. If only one Decision Server is connected to Decision Central, or if all connected Decision Servers are in the same server configuration, services are started in a deployment unit automatically when a project is deployed. If multiple server configurations are available, you are prompted upon deployment to specify server and deployment details and to start the deployment unit. However, at any time you can manually start, stop, or remove deployment units in Decision Central to manage your deployed services as needed.

Procedure

  1. In Decision Central, go to MenuDeployExecution servers.
  2. Under Server Configurations, select a configuration.
  3. Under Deployment Units, select a deployment unit.
  4. Click Start, Stop, or Remove in the upper-right corner. To remove a running deployment unit, stop it and then remove it.

2.6. Editing the GAV values for a project in Decision Central

The GroupId, ArtifactId, and Version (GAV) values identify a project in a Maven repository. When Decision Central and Decision Server are on the same file system and use the same Maven repository, the project is automatically updated in the repository each time you build a new version of your project. However, if Decision Central and Decision Server are on separate file systems and use separate local Maven repositories, you must update a project GAV value, usually the version, for any new versions of the project to ensure that the project is seen as a different artifact alongside the old version.

Note

For development purposes only, you can add the SNAPSHOT suffix in the project version to instruct Maven to get a new snapshot update according to the Maven policy. Do not use the SNAPSHOT suffix for a production environment.

You can set the GAV values in the project Settings screen.

Procedure

  1. In Decision Central, go to MenuDesignProjects and click the project name.
  2. Click the project Settings tab.
  3. In General Settings, modify the Group ID, Artifact ID, or Version fields as necessary. If you have deployed the project and are developing a new version, usually you need to increase the version number.

    Note

    For development purposes only, you can add the SNAPSHOT suffix in the project version to instruct Maven to get a new snapshot update according to the Maven policy. Do not use the SNAPSHOT suffix for a production environment.

  4. Click Save to finish.

2.7. Duplicate GAV detection in Decision Central

In Decision 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 executed every time you perform the following operations:

  • Save a project definition for the project.
  • Save the pom.xml file.
  • Install, build, or deploy a project.

The following Maven repositories are checked for duplicate GAVs:

  • Repositories specified in the <repositories> and <distributionManagement> elements of the pom.xml file.
  • Repositories specified in the Maven settings.xml configuration file.

2.7.1. Managing duplicate GAV detection settings in Decision Central

Decision 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.

Procedure

  1. In Decision Central, go to MenuDesignProjects and click the project name.
  2. Click the project Settings tab and then click Validation to open the list of repositories.
  3. 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.

    Note

    To disable this feature, set the org.guvnor.project.gav.check.disabled system property to true for Decision Central at system startup:

    $ ~/EAP_HOME/bin/standalone.sh -c standalone-full.xml
    -Dorg.guvnor.project.gav.check.disabled=true