Red Hat Training

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

Integrating Red Hat Developer Studio with Red Hat Decision Manager

Red Hat Decision Manager 7.1

Red Hat Customer Content Services

Abstract

This document describes how to integrate Red Hat Developer Studio with Red Hat Decision Manager.

Preface

As a developer, you can integrate Red Hat Developer Studio with Red Hat Decision Manager to write complex applications and leverage code auto-completion.

Chapter 1. Installing Red Hat Developer Studio

Red Hat Developer Studio is an integrated development environment (IDE) based on Eclipse. It integrates tooling and run time components by combining Eclipse, Eclipse Tooling, and Red Hat JBoss Enterprise Application Platform. Red Hat Developer Studio provides plug-ins with tools and interfaces for Red Hat Decision Manager.

Procedure

  1. Download Red Hat Developer Studio:

    1. Log in to the Red Hat Customer Portal.
    2. Click DOWNLOADS at the top of the page.
    3. On the Product Downloads page, navigate to the JBOSS DEVELOPMENT AND MANAGEMENT section, and click Red Hat Developer Studio.
    4. On the Software Downloads page, download Red Hat Developer Studio 12.9.0 Stand-alone Installer (devstudio-12.9.0.GA-installer-standalone.jar).
  2. In a terminal window, navigate to the directory where you downloaded the installer JAR file and enter the following command:

    java -jar devstudio-12.9.0.GA-installer-standalone.jar
  3. Follow the instructions in the installer to complete the installation.

    For more information, see the Red Hat Developer Studio Installation Guide.

Important

Because of an issue in the way multi-byte rule names are handled, you must ensure that the instance of Red Hat Developer Studio is started with the file encoding set to UTF-8. You can do this by editing the $DS_HOME/studio/devstudio.ini file and adding the following property: "-Dfile.encoding=UTF-8".

Chapter 2. Installing Red Hat Developer Studio plug-ins

The Red Hat Developer Studio plug-ins for Red Hat Decision Manager are based on the community version of the plug-ins. For this reason, the Red Hat Decision Manager plug-in is called the Drools plug-in.

Procedure

  1. Download the Red Hat Decision Manager plug-ins for Red Hat Developer Studio:

    1. Log in to the Red Hat Customer Portal.
    2. Click DOWNLOADS at the top of the page.
    3. On the Product Downloads page that opens, navigate to the JBOSS DEVELOPMENT AND MANAGEMENT section, and click Red Hat Developer Studio.
    4. On the Software Downloads page, from the Version list select 12.0.0, and then download Red Hat Developer Studio Integration Stack 12.0.0 Update Site Zip (devstudio-integration-stack-12.0.0.GA-updatesite.zip).
  2. To start Red Hat Developer Studio, select Red Hat Developer Studio from the Start menu.
  3. Click HelpInstall New Software.
  4. Click Add to display the Add Repository window.
  5. Enter a name in the Name field, for example, devstudio-12.0.0.GA.
  6. Click Archive, navigate to the devstudio-integration-stack-12.0.0.GA-updatesite.zip file, select the file, and then click OK.
  7. Click Add.
  8. In the Install window, select JBoss Business Process and Rule Development from the Available Software list, click Next, and click Next again.
  9. Read the license agreements, click I accept the terms of the license agreements to accept the license agreements, and then click Finish.
  10. After the installation process has been completed, click Restart Now in the Software Updates window to restart Red Hat Developer Studio.

Chapter 3. Configuring the Red Hat Decision Manager server

You can configure Red Hat Developer Studio to run the Red Hat Decision Manager server.

Prerequisites

  • Red Hat Developer Studio is installed with the Red Hat Decision Manager plug-ins.
  • Red Hat Decision Manager is installed in a Red Hat JBoss EAP 7.1 server instance.

Procedure

  1. Start Red Hat Developer Studio.
  2. Click WindowShow ViewOther, select ServerServers, and then click Open to add the server view.
  3. Right-click in the Servers pane and select NewServer to open the server menu.
  4. Click Red Hat JBoss MiddlewareJBoss Enterprise Application Platform 7.x and then click Next to define the server.
  5. In the Create a new Server Adapter window, select Create new runtime (next page) from the list, and then click Next.
  6. To set the home directory in the JBoss Runtime window, click the Browse button under Home Directory and navigate to the Red Hat JBoss EAP directory where Red Hat Decision Manager is installed.
  7. Enter a name for the server in the Name field, ensure that the configuration file is set, and then click Finish.

Chapter 4. Installing Red Hat Decision Manager runtime environments

In order to create Red Hat Decision Manager projects in Red Hat Developer Studio, it is necessary to install the Red Hat Decision Manager runtime environment.

A runtime environment is a collection of JAR files that represent a specific release of the software and includes the required libraries for compiling and running your business asset.

Prerequisite

Red Hat Developer Studio is installed.

Procedure

  1. Download the decision engine:

    1. Log in to the Red Hat Customer Portal.
    2. Click DOWNLOADS at the top of the page.
    3. On the Product Downloads page that opens, navigate to the JBOSS DEVELOPMENT AND MANAGEMENT section, and click Red Hat Decision Manager.
    4. On the Software Downloads page, download Red Hat Decision Manager 7.1.0 Add-Ons (rhdm-7.1.0-add-ons.zip).
    5. Extract rhdm-7.1.0-add-ons.zip and then extract the Drools runtime environment JAR files located in rhdm-7.1.0-add-ons/rhdm-7.1.0-decision-engine.zip.
  2. From the Red Hat Developer Studio menu, click WindowPreferences.
  3. Click DroolsInstalled Drools Runtimes, and then click Add.
  4. In the name field, enter a name for the new runtime environment.
  5. Click Browse and navigate to the directory where you extracted the runtime environment files.
  6. Click OK to register the selected runtime environment in Red Hat Developer Studio.
  7. To set the runtime environment as the default Drools run time, select the check box beside the runtime environment name.
  8. Click Apply and Close. If you have existing projects, you are prompted to restart Red Hat Developer Studio to update the runtime environment.

Chapter 5. Creating a Red Hat Decision Manager project

You can create and manage a Red Hat Decision Manager project in Red Hat Developer Studio.

Prerequisite

  • Red Hat Developer Studio is installed with the Red Hat Decision Manager plug-ins.
  • Red Hat Decision Manager runtime environment is installed.

Procedure

  1. In Red Hat Developer Studio, from the main menu, click FileNewProject.
  2. In the search field, enter Drools Project, select Drools Project, and then click Next.
  3. Select the second option to create a project with a Red Hat Decision Manager example, and then click Next.
  4. In the Project name field, enter a name for the project.
  5. Click Finish.
  6. Complete the following steps to test the project:

    1. Navigate to the src/main/java directory and expand the com.sample package.
    2. Right click a Java class and select Run AsJava Application.

      The output is displayed on the console tab.

Chapter 6. Importing projects from a Git repository into Red Hat Developer Studio

You can configure Red Hat 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.

6.1. Cloning a remote Git repository

You can clone a Git repository to use with Red Hat Developer Studio.

Prerequisites

  • Red Hat Developer Studio is installed with the Red Hat Decision Manager plug-ins.
  • You have access permission for the remote Git repository that you want to clone.

Procedure

  1. In Red Hat Developer Studio, select the server from the Server tab and click the start icon to start the server.
  2. Enter the following command in a terminal to start the secure shell server, if it is not running already.

    /sbin/service sshd start
    Note

    This command is specific to Linux and Apple Macintosh. On these platforms, if sshd has already been started, this command fails. If this happens, you may safely ignore this step.

  3. In Red Hat Developer Studio , select FileImport…​ and navigate to the Git folder.
  4. Open the Git folder, select Projects from Git, and click Next.
  5. Select the repository source as Clone URI and click Next.
  6. Enter the details of the Git repository and click Next.
  7. Select the branch you want to import and click Next.
  8. To define the local storage for this project, enter or select a non-empty directory, make any configuration changes, and click Next.
  9. Import the project as a general project in the following window and click Next.
  10. Name the project and click Finish.

6.2. Importing a local Git repository

You can import a local Git repository to use with Red Hat Developer Studio.

Prerequisite

Red Hat Developer Studio is installed.

Procedure

  1. In Red Hat Developer Studio, select the server from the Server tab and click the start icon to start the server.
  2. Select FileImport and navigate to the Git folder.
  3. Open the Git folder to select Projects from Git and click Next.
  4. Select Existing local repository as the repository source and click Next.
  5. Select the repository that is to be configured from the list of available repositories and click Next.
  6. In the window that opens, select Import as general project and click Next.
  7. Name the project and click Finish.

Chapter 7. Additional Resources

Appendix A. Versioning information

Documentation last updated on Wednesday, March 27, 2019.

Legal Notice

Copyright © 2019 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.