Rule model API for Rule Designer
You use the rule model API for Rule Designer to access and manipulate rule model elements such as rules, rule packages, and decision tables, and to manage their mapping to files in the Eclipse workspace.
The rule model API for Rule Designer (ilog.rules.studio.model.* packages) is the Rule Designer data model. The rule model API also provides notification and services over rule artifacts (for example, search and queries).
Rule model and Eclipse workspace
The class IlrStudioModelPlugin is the main entry point for the Rule Model API. It contains static methods to access the main model classes (getWorkspace, getResourceManager, getRuleModel). The interface IlrResourceManager manages the mapping between the rule model and the Eclipse workspace. In this interface, you use the method getElementFromResource to map a workspace resource to a rule model element, and the method saveElement to save a rule model element as a workspace resource. If a file is modified in the workspace on the disk, changes are automatically transferred to the rule model.
The interface IlrResourceElement is the superclass of all rule model elements that have a corresponding resource in the workspace. In this interface, the method getResouce lets you retrieve the resource corresponding to a rule model element.

Rule model services
You use the rule model API to do the following tasks:
Navigate rule model elements. For example you can navigate the rule model to retrieve a rule artifact:
IlrRuleModel ruleModel = IlrStudioModelPlugin.getRuleModel(); IlrRuleProject ruleProject = ruleModel.getRuleProject("balsample"); IlrRulePackage pkg = ruleProject.getRulePackage("toto.titi"); IlrRule rule = pkg.getRule("myrule");Persist rule model elements as workspace resources. For example, you can retrieve the resource corresponding to a rule, update the documentation of the rule in the rule model, and then save the rule back as a resource:
IlrResourceManager resourceMgr = IlrStudioModelPlugin.getResourceManager(); IlrRuleArtefact rule = resourceMgr.getElementFromResource(file); rule.setDocumentation("updated doc"); resourceMgr.saveElement(rule);Notify the rule model of changes on elements, with the method IlrRuleModel.getModelListeners.
With services on top of the rule model API, you can:
Create a ruleset archive from a rule project with IlrRulesetArchiveExporter.
Customize the build of rule project with IlrBusinessChecker and its corresponding extension point.
Query a rule project, for example:
IlrQueryService queryService = IlrRuleProject.getService(IlrQueryService.SERVICE_ID);Search a rule project for rule artifacts, BOM elements, and XOM elements.
Rule model structure
The Rule Designer model plug-ins are modular: ilog.rules.studio.model is the generic plug-in. All its subplug-ins are specific. When you create a plug-in that references one of the Rule Designer model plug-ins, it is good practice to reference them all, although you might not require some of the specific ones.