Automated classic rule project deployment
This sample demonstrates how to create and use ruleset extractors. It works on the classic rule engine, and shows the use of extractors in creating a ruleset archive.
Time required
10 minutes
Prerequisites
You must have Rule Designer installed to import and run this sample.
Description
This sample shows you how to use ruleset extractors and how to filter rule project elements with extractors by using queries and validators. The sample also shows you how to generate and run a ruleset archive.
When to define a custom extractor:
- When you want to have a single rule project, and deploy distinct
rules and other artifacts to different locations.
In this sample for a human resource system, the rules are kept in single repository for easy maintenance, and deployed in distinct versions to regional application servers to process data.
- When you don't want to run certain rules.
For example, you can exclude "test" rules or rules that match a specific pattern. You might also want to discard expired rules or rules that have an incorrect status. You can apply filtering to any rule property, and you are limited by only the Rule Designer API scope of the queries or by what is defined by using the Rule Designer API inside validators.
The sample covers the following operations:
- Developing an Eclipse plug-in by using the exposed Rule Designer API.
- Using existing extractors, or creating new ones.
- Automating Rule Designer tasks through Ant tasks.
- Running a rule on the classic rule engine.
- Setting a query or a validator on an extractor.
- Checking if a query is defined in a rule project by using Rule Designer API.
- Creating a validator by extending an Eclipse plug-in extension point.
- Checking whether the validator is extending the Rule Designer validator extension point by using Eclipse API.
- Creating a query by using its text definition.
- Generating a ruleset archive by using an extractor.
- Forcing the build of a rule project by using the Eclipse API.
- Running the generated ruleset archive by using basic Java™ code.