Creating a Java Project for Rules

To create a Java™ project for ruleset execution, you use the Java Project for Rules page of Rule Designer.

About this task

To run a ruleset by using an instance of a rule engine, you must first create a Java project for your rules.

Procedure

To create a Java project for rules:

  1. On the File menu, click New  >  Project.
  2. In the New Project wizard, select Java Project for Rules.
  3. Click Next.
  4. In the Java Project for Rules page, specify the name and location of your rule project:

    Type a name for your project in the Project name field.

    If you want the project to be saved in your Eclipse workspace, keep the Use default box selected.

    If you want to save your project in a different location, clear the Use default box and browse to select a directory in the Location field.

  5. Click Next.
  6. In the Java Project for Rules Settings page, specify the rule project that provides the ruleset for the Java project for rules, then click Next.
  7. In the Java Project for Rules Templates page, specify a template to generate the main class of the Java project.

    The following templates are available:

    • Simple Rule Engine Runner: Generates a simple class to run a ruleset.

    • Rule Engine Runner: Generates a class to run a ruleset with parameters and provides debug handling.

    • Rule Engine Runner Test Case: Generates a class to run a ruleset with parameters. The generated class is packaged as a JUnit test.

  8. Click Finish.
  9. When prompted to switch to the Java Perspective, click Yes.

Results

A ruleset archive was created at the root of the Java project for rules. The default archive name is ruleArchive1.jar.