検索

第7章 Example decisions in Red Hat Decision Manager for an IDE

download PDF

Red Hat Decision Manager provides example decisions distributed as Java classes that you can import into your integrated development environment (IDE). You can use these examples to better understand decision engine capabilities or use them as a reference for the decisions that you define in your own Red Hat Decision Manager projects.

The following example decision sets are some of the examples available in Red Hat Decision Manager:

  • Hello World example: Demonstrates basic rule execution and use of debug output
  • State example: Demonstrates forward chaining and conflict resolution through rule salience and agenda groups
  • Fibonacci example: Demonstrates recursion and conflict resolution through rule salience
  • Banking example: Demonstrates pattern matching, basic sorting, and calculation
  • Pet Store example: Demonstrates rule agenda groups, global variables, callbacks, and GUI integration
  • Sudoku example: Demonstrates complex pattern matching, problem solving, callbacks, and GUI integration
  • House of Doom example: Demonstrates backward chaining and recursion
注記

For optimization examples provided with Red Hat Business Optimizer, see Getting started with Red Hat Business Optimizer.

7.1. Importing and executing Red Hat Decision Manager example decisions in an IDE

You can import Red Hat Decision Manager example decisions into your integrated development environment (IDE) and execute them to explore how the rules and code function. You can use these examples to better understand decision engine capabilities or use them as a reference for the decisions that you define in your own Red Hat Decision Manager projects.

Prerequisites

  • Java 8 or later is installed.
  • Maven 3.5.x or later is installed.
  • An IDE is installed, such as Red Hat JBoss Developer Studio.

Procedure

  1. Download and unzip the Red Hat Decision Manager 7.3.0 Source Distribution from the Red Hat Customer Portal to a temporary directory, such as /rhdm-7.3.0-sources.
  2. Open your IDE and select File Import Maven Existing Maven Projects, or the equivalent option for importing a Maven project.
  3. Click Browse, navigate to ~/rhdm-7.3.0-sources/src/drools-$VERSION/drools-examples (or, for the Conway’s Game of Life example, ~/rhdm-7.3.0-sources/src/droolsjbpm-integration-$VERSION/droolsjbpm-integration-examples), and import the project.
  4. Navigate to the example package that you want to run and find the Java class with the main method.
  5. Right-click the Java class and select Run As Java Application to run the example.

    To run all examples through a basic user interface, run the DroolsExamplesApp.java class (or, for Conway’s Game of Life, the DroolsJbpmIntegrationExamplesApp.java class) in the org.drools.examples main class.

    図7.1 Interface for all examples in drools-examples (DroolsExamplesApp.java)

    drools examples run all

    図7.2 Interface for all examples in droolsjbpm-integration-examples (DroolsJbpmIntegrationExamplesApp.java)

    droolsjbpm examples run all
Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.