Chapter 4. Using an external Maven repository to deploy a decision service
You can use an external Maven repository (for example, Nexus) to set up an integration process. You can configure Decision Central to push decision service files into the external repository instead of the built-in repository.
You can still use Decision Central to deploy decision services on a test Decision Server. However, in this process, other Decision Server (for example, staging and production) are not connected to Decision Central. Instead, they retrieve the decision service KJAR files and any necessary dependencies from your Maven repository. You can progress the KJAR versions through your repository as necessary, in line with the integration process that you want to implement.
If you deploy a Decision Server on OpenShift, you can configure it to load and start a decision service from a Maven repository automatically.
If you deploy a Decision Server on premises, you can configure access to a Maven repository when setting up the server. Then you can use the REST API of the server to load and start a decision service from the repository. A Maven project and a Java client library for automating the API calls are available.
4.1. Configuring Decision Central to use an external Maven repository
You can configure Decision Central to use an external Maven repository instead of its built-in repository. In this case, Decision Central pushes all the built KJAR files into this repository. You can progress these files through the repository as necessary to implement your integration process.
Using an external Maven repository in Decision Central deployed on OpenShift is not supported.
Procedure
- Install the Decision Central. See Installing Red Hat Decision Manager on premise for instructions.
-
Create a Maven
settings.xmlfile with connetion and access details for your external repository. For details about thesettings.xmlfile, see Maven documentation: https://maven.apache.org/settings.html . In the
<eap_home>/standalone/configuration/standalone.xmlfile, under the<system-properties>tag, set thekie.maven.settings.customproperty to the full pathname of thesettings.xmlfile, for example:<property name="kie.maven.settings.custom" value="/opt/custom-config/settings.xml"/>
- Start or restart the Decision Central.
4.2. Configuring a Decision Server to run a decision service
You can configure a Decision Server to load and run a decision service automatically without using a Decision Central. The service must be present in a Maven repository. You need access information for the repository and the GAV values for the service. You can also stop and delete the service from this server at a later time. You can start several services on one Decision Server at the same time.
Do not use this procedure for a Decision Server deployed on OpenShift. See Deploying Red Hat Decision Manager on Red Hat OpenShift Container Platform for instructions about configuring a a Decision Server to load and run a decision service from a Maven repository.
4.2.1. Configuring a Decision Server to use a Maven repository
Before you can load and start a decision service on a Decision Server, you need to configure the server to use your Maven repository.
Procedure
- Install the Decision Server. See Installing Red Hat Decision Manager on premise for instructions.
-
Create a Maven
settings.xmlfile with connetion and access details for your external repository. For details about thesettings.xmlfile, see Maven documentation: https://maven.apache.org/settings.html . In the
<eap_home>/standalone/configuration/standalone.xmlfile, under the<system-properties>tag, set thekie.maven.settings.customproperty to the full pathname of thesettings.xmlfile, for example:<property name="kie.maven.settings.custom" value="/opt/custom-config/settings.xml"/>
- Start or restart the Decision Server.
4.2.2. Loading and starting a service on the Decision Server
If you have configured a Decision Server to use a Maven repository, you can use an API call to load a service. The service is started automatically.
Procedure
To load a service into a container in the Decision Server and start it, run the following command to send an API request:
$ curl --user "<username>:<password>" -H "Content-Type: application/json" -X PUT -d '{"container-id" : "<containerID>","release-id" : {"group-id" : "<groupID>","artifact-id" : "<artifactID>","version" : "<version>"}}' http://<serverhost>:<serverport>/kie-server/services/rest/server/containers/<containerID>where:
- <username> is the user name for an account that can log onto the Decision Server and administer it.
- <password> is the password for the account.
- <containerID> is the identifier for the container. You can use any random identifier but it must be the same in both places in the command (the URL and the data).
- <groupID>, <artifactID>, version are GAV values.
-
<serverhost> is the host name for the KIE server, or
localhostif you are running the command on the same host as the KIE server. <serverport> is the port number for the KIE server
For example:
curl --user "rhdmAdmin:password@1" -H "Content-Type: application/json" -X PUT -d '{"container-id" : "kie1","release-id" : {"group-id" : "org.kie.server.testing","artifact-id" : "container-crud-tests1","version" : "2.1.0.GA"}}' http://localhost:39043/kie-server/services/rest/server/containers/kie1
4.2.3. Stopping and removing a service from the Decision Server
You can use an API call to stop and remove a service from the Decision Server. You need the container identifier that was configured when loading the service.
Procedure
To stop and remove a container with a service on the Decision Server, run the following command to send an API request:
$ curl --user "<username>:<password>" -X DELETE http://<serverhost>:<serverport>/kie-server/services/rest/server/containers/<containerID>
where:
- <username> is the user name for an account that can log onto the Decision Server and administer it.
- <password> is the password for the account.
- <containerID> is the identifier for the container.
-
<serverhost> is the host name for the KIE server, or
localhostif you are running the command on the same host as the KIE server. <serverport> is the port number for the KIE server
For example:
curl --user "rhdmAdmin:password@1" -X DELETE http://localhost:39043/kie-server/services/rest/server/containers/kie1

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.