Este conteúdo não está disponível no idioma selecionado.
Chapter 3. Installing supporting tools
3.1. Using the Maven repository in your project Copiar o linkLink copiado para a área de transferência!
Red Hat Decision Manager is designed to be used in combination with the Red Hat Decision Manager Maven repository. You can direct Maven to use the Red Hat Decision Manager Maven repository in your project in one of the following ways:
- Configure the Project Object Model (POM) file (pom.xml).
-
Modify the Maven
settings.xmlfile. This file is included with Maven repository available for download from the Red Hat Customer Portal.
Red Hat recommends directing Maven to use the Red Hat Decision Manager Maven repository across all projects by using the Maven global or user settings.
3.1.1. Configuring Maven using the project configuration file (pom.xml) Copiar o linkLink copiado para a área de transferência!
To use Maven for building and managing your Red Hat Decision Manager projects, you must configure your projects to be built with Maven. Maven requires the POM file (pom.xml) that holds configuration details for your project. For more information, see Apache Maven Project.
Procedure
-
Generate a Maven project. A
pom.xmlfile is automatically generated when you create a Maven project. Edit
pom.xmlto add more dependencies and new repositories.Maven downloads all of the JAR files and the dependent JAR files from the Maven repository when you compile and package your project.
Find the schema for the pom.xml file at http://maven.apache.org/maven-v4_0_0.xsd. For more information about POM files, see Apache Maven Project POM.
3.1.2. Configure Maven using the settings file Copiar o linkLink copiado para a área de transferência!
The Maven settings file (settings.xml) is used to configure Maven execution. You can locate this file in the following locations:
-
In the Maven install directory at
$M2_HOME/conf/settings.xml. These settings are called global settings. -
In the user’s install directory at
$USER_HOME/.m2/settings.xml. These settings are called user settings. -
A custom location specified by the system property
kie.maven.settings.custom.
The settings used is a merge of the files located in these locations. For more information, see Apache Maven Project.
3.1.3. Managing Maven dependencies Copiar o linkLink copiado para a área de transferência!
Prerequisite
To use the correct Maven dependencies in your Red Hat Decision Manager project, you must add relevant bill of materials (BOM) files to the project’s pom.xml file. When you add the BOM files, the correct versions of transitive dependencies from the provided Maven repositories are included in the project.
For information, see What is the mapping between RHDM product and maven library version?
Procedure
Declare the BOM in
pom.xml. For example:Example 3.1. BOM for Red Hat Decision Manager 7.0.0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Declare dependencies needed for your project in the
<dependencies>tag.For a basic Red Hat Business Automation project, declare the following dependencies:
Embedded jBPM Engine Dependencies
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For a Red Hat Business Automation project that uses CDI, declare the following dependencies:
CDI-Enabled jBPM Engine dependencies
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For a basic Red Hat Decision Manager project, declare the following dependencies:
Embedded Drools Engine Dependencies
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To use the Decision Server, declare the following dependencies:
Client Application Decision Server Dependencies
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To create a remote client for Red Hat Business Automation or Red Hat Decision Manager, declare the following dependencies:
Client Dependencies
<dependency> <groupId>org.uberfire</groupId> <artifactId>uberfire-rest-client</artifactId> </dependency>
<dependency> <groupId>org.uberfire</groupId> <artifactId>uberfire-rest-client</artifactId> </dependency>Copy to Clipboard Copied! Toggle word wrap Toggle overflow To use assets in
KJARpackaging, the recommended way is to includekie-maven-plugin:Kie Maven Plugin
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Importing projects from Git repositories Copiar o linkLink copiado para a área de transferência!
Git is a distributed version control system. It implements revisions as commit objects. When you commit your changes into a repository, a new commit object in the Git repository is created. When you create a project in Decision Central it is added to the Git repository connected to Decision Central.
If you have projects in other Git repositories, you can import them into Decision Central spaces.
Prerequisite
Red Hat Decision Manager projects in an external Git repository
Procedure
-
In Decision Central, click Menu
Design Projects. - Select or create the space into which you want to import the projects. The default space is myteam.
- Click the three verticle dots on the right side of the screen and select Import Project.
- In the Import Project window, enter the URL and credentials for the Git repository that contains the projects that you want to import and click Import. The projects are added to the current space.
3.3. Installing and setting up Red Hat JBoss Developer Studio Copiar o linkLink copiado para a área de transferência!
Red Hat JBoss Developer Studio is the JBoss Integrated Development Environment (IDE) based on Eclipse. Red Hat JBoss Developer Studio provides plug-ins with tools and interfaces for Red Hat Decision Manager.
Procedure
- Download the latest Red Hat JBoss Developer Studio from the Red Hat Customer Portal.
- Follow the setup and installation instructions in the Red Hat JBoss Developer Studio documentation.
- Install the Red Hat JBoss Developer Studio plug-ins, as described in the next section.
Because of an issue in the way multi-byte rule names are handled, you must ensure that the instance of Red Hat JBoss Developer Studio is started with the file encoding set to UTF-8. You can do this by editing the $JBDS_HOME/studio/devstudio.ini file and adding the following property: "-Dfile.encoding=UTF-8".
3.3.1. Installing Red Hat JBoss Developer Studio plug-ins Copiar o linkLink copiado para a área de transferência!
Red Hat JBoss Developer Studio provides plug-ins with tools and interfaces for Red Hat Decision Manager. These plug-ins are based on the community version of these products. For this reason, the Red Hat Decision Manager plug-in is called the Drools plug-in.
Get the latest Red Hat JBoss Developer Studio from the Red Hat Customer Portal. The Red Hat Decision Manager plug-ins for Red Hat JBoss Developer Studio are available using the update site.
Procedure
- Start Red Hat JBoss Developer Studio.
-
Click Help
Install New Software. - Click Add to enter the Add Repository menu.
-
Provide a name next to the Name field and add the following URL in the Location field:
https://devstudio.jboss.com/11/stable/updates/integration-stack/. - Click OK.
- Select the JBoss Business Process and Rule Development feature from the available options, click Next, and then click Next again.
- Read the license and accept it by selecting the appropriate radio button, and click Finish.
- Restart Red Hat JBoss Developer Studio after the installation process finishes.
3.3.2. Configuring the Red Hat Decision Manager server Copiar o linkLink copiado para a área de transferência!
You can configure Red Hat JBoss Developer Studio to run the Red Hat Decision Manager server.
Prerequisite
- Red Hat JBoss Developer Studio
- Red Hat Decision Manager installed with the Red Hat JBoss Developer Studio plug-ins
Procedure
- Start Red Hat JBoss Developer Studio.
-
To open the Drools view, click Window
Open Perspective Other, select Drools, select specific views, and click OK. -
Click Window
Show View Other… and select Server Servers to add the server view. -
Right click the Servers panel and select New
Server to open the server menu. -
Click JBoss Enterprise Middleware
JBoss Enterprise Application Platform 7.1+ and click Next to define the server. Set the home directory by clicking the Browse button. Navigate to theRed Hat JBoss EAP directory where Red Hat Decision Manager is installed.
To configure the Red Hat Decision Manager server, select the Red Hat JBoss EAP directory where Red Hat Decision Manager is installed.
- Provide a name for the server in the Name field, ensure that the configuration file is set, and click Finish.
3.3.3. Importing projects from a Git repository into Red Hat JBoss Developer Studio Copiar o linkLink copiado para a área de transferência!
You can configure Red Hat JBoss Developer Studio to connect to a central Git asset repository. The repository stores rules, models, functions, and processes.
You can either clone a remote Git repository or import a local Git repository.
3.3.4. Cloning a remote Git repository Copiar o linkLink copiado para a área de transferência!
You can clone a git repository to use with Red Hat JBoss Developer Studio.
Prerequisite
Access permission for the remote Git repository that you want to clone
Procedure
- In Red Hat JBoss Developer Studio, select the server from the Server tab and click the start icon to start your server.
Enter the following command in a terminal to start the Secure Shell server, if it is not running already.
/sbin/service sshd start
/sbin/service sshd startCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThis command is specific to Linux and Apple Macintosh. On these platforms, if
sshdhas already been started, this command fails. If this happens, you may safely ignore this step.-
In Red Hat JBoss Developer Studio , select File
Import… and navigate to the Git folder. Open the Git folder to select Projects from Git and click Next. - Select the repository source as Clone URI and click Next.
- Enter the details of the Git repository in the next window and click Next.
- Select the branch you wish to import in the following window and click Next.
- To define the local storage for this project, enter (or select) a non-empty directory, make any configuration changes and click Next.
- Import the project as a general project in the following window and click Next.
- Name the project and click Finish.
3.3.5. Importing a local Git repository Copiar o linkLink copiado para a área de transferência!
You can import a local git repository to use with Red Hat JBoss Developer Studio.
Procedure
- Select your server from the Server tab and click the start icon to start the server.
-
In Red Hat JBoss Developer Studio, select File
Import… and navigate to the Git folder. Open the Git folder to select Projects from Git and click Next. - Select the repository source as Existing local repository and click Next.
- Select the repository that is to be configured from the list of available repositories and click Next.
- In the dialog window that opens, select the Import as general project radio button from the Wizard for project import group and click Next.
- Name the project and click Finish.