Selecting artifacts for extraction into a ruleset

Use Rule Designer ruleset extractors to select only the rules in a rule project that you need for execution.

About this task

You can create rules for non-production purposes, such as testing, or rules to be used in the production environment.

When you create a ruleset archive, both the rules of the project and all the rules from any referenced rule projects are included by default. You can define different extractors for a ruleset so as to create different execution packages. You can then select the required ruleset extractor when you create the ruleset archive.

You can create an extractor based on a query or on a validator class:

In Rule Designer, the extractors are found in the rule project properties.

Procedure

To select artifacts to be put in a ruleset:

  1. In Rule Designer, right-click the rule project and select Properties from the pop-up menu.
  2. In the list of types, click Ruleset Extractors.
  3. Click Add.
  4. In the New Ruleset Extractor dialog, type the name of the new ruleset extractor.
  5. Select the filter for the extractor:
    • For a Validation class, select the filter from the Validator list and click OK. For an extractor only, set Validator to none. The validator code typically examines each artifact and tests whether it is to be included in or excluded from the selection. See Creating a custom ruleset extractor validator.

      To add a custom ruleset extractor class, click Add.

      In the New Ruleset Extractor dialog, type a name for the extractor in the Name field, and select the name you defined for the validator in the Validator field.

      The Default validator selects all the rules in the project. None means no validator. In this case, you must specify a query in the Query field.

    • For a query, browse to select the query and click OK.

      If the ruleset extractor references both a query and a validator, the query is performed first to select the rule artifacts. Then the validation class is called on the selected rule artifacts and all other artifacts in the ruleset.

    Screenshot of ruleset extractors

    If you have not created the filter yet, at this point you can click OK and return to this dialog later to add the validator or query. Select an existing extractor and click Edit to add or change the definition.

  6. Click OK to exit from the Properties dialog.