搜索

此内容没有您所选择的语言版本。

Chapter 2. Project deployment in Business Central

download PDF

You can use Business 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 Business Central and deploy it automatically to the Decision Server. To enable automatic deployment, Business Central includes a built-in Maven repository. From Business 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 Business Central instance and group them into different server configurations (in Menu Deploy Execution 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 Business 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 Business 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 Business 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 Business 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 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, 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 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.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"/>
  3. Start or restart the Decision Server.

2.2. Configuring the environment mode in Decision Server and Business Central

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

  1. To configure the Decision Server environment mode, set the org.kie.server.mode system property to org.kie.server.mode=development or org.kie.server.mode=production.
  2. To configure the deployment behavior for a project in Business Central, go to project Settings General Settings Version and toggle the Development Mode option.

    Note

    By 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 SNAPSHOT version suffix to a Decision Server that is in production mode.

2.3. Configuring an external Maven repository for Business Central and Decision Server

You can configure Business Central and Decision Server to use an external Maven repository, such as Nexus or Artifactory, instead of the built-in repository. This enables Business 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 the following documents: Deploying a Red Hat Decision Manager authoring or managed server environment on Red Hat OpenShift Container Platform.

Prerequisite

Business 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 Business Central and Decision Server.

Next steps

For each Business 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.4, “Exporting a Business Central project to an external Maven repository”.

2.4. Exporting a Business Central project to an external Maven repository

If you configured an external Maven repository for Business Central and Decision Server, you must add the repository information in the pom.xml file for each Business 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 Business Central or the Decision Server REST API.

Prerequisite

You configured Business Central and Decision Server to use an external Maven repository. If you deployed Business Central on-premise, for more information about configuring an external Maven repository, see Section 2.3, “Configuring an external Maven repository for Business 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 Business Central, go to Menu Design Projects, 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 View pom.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 Business Central project that you want to export or push as a KJAR artifact to the external Maven repository.

2.5. Building and deploying a project in Business Central

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

Procedure

  1. In Business Central, go to Menu Design Projects and click the project name.
  2. In the upper-right corner, click Deploy to build the project and deploy it to a Decision Server. To compile the project without deploying it to Decision Server, click Build.

    Note

    You can also select the Build & Install option to build the project and publish the KJAR file to the configured Maven repository without deploying to a Decision Server. In a development environment, you can click Deploy 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 is disabled and you can click Deploy only to deploy the built KJAR file to a new deployment unit (KIE container) on a Decision Server.

    To configure the Decision Server environment mode, set the org.kie.server.mode system property to org.kie.server.mode=development or org.kie.server.mode=production. To configure the deployment behavior for a corresponding project in Business Central, go to project Settings General Settings Version and toggle the Development Mode option. By 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 SNAPSHOT version suffix to a Decision Server that is in production mode.

    If only one Decision Server is connected to Business 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 Business 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.6. Deployment units in Business 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 Business Central, the deployment unit is created automatically in the configured server. You can start, stop, or remove deployment units in Business 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 Business Central.

2.6.1. Creating a deployment unit in Business 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 Business Central.

Prerequisite

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

Procedure

  1. In Business Central, go to Menu Deploy Execution servers.
  2. Under Server Configurations, select an existing configuration or click New Server Configuration to create a 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.6.2. Starting, stopping, and removing deployment units in Business 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 Business 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 Business Central to manage your deployed services as needed.

Procedure

  1. In Business Central, go to Menu Deploy Execution 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.7. Editing the GAV values for a project in Business Central

The GroupId, ArtifactId, and Version (GAV) values identify a project in a Maven repository. When Business 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 Business 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 toggle the Development Mode option in project Settings General Settings Version to add the SNAPSHOT suffix in the project version. This suffix instructs Maven to get a new snapshot update according to the Maven policy. Do not use Development Mode or manually add the SNAPSHOT version suffix for a production environment.

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

Procedure

  1. In Business Central, go to Menu Design Projects 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 toggle the Development Mode option in project Settings General Settings Version to add the SNAPSHOT suffix in the project version. This suffix instructs Maven to get a new snapshot update according to the Maven policy. Do not use Development Mode or manually add the SNAPSHOT version suffix for a production environment.

  4. Click Save to finish.

2.8. Duplicate GAV detection in Business Central

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.

Note

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.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.8.1. Managing duplicate GAV detection settings in Business Central

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.

Note

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

  1. In Business Central, go to Menu Design Projects 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 Business Central at system startup:

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

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.