Setting up the context-aware rule definition sample

In the samples console, you create a new workspace and import the context-aware rule definition sample.

About this task

This sample extends the Rule Designer API. The required sample plug-ins are delivered as predeployed.

Procedure

To import the ruleawareofcontext sample:

  1. Click File  > Switch Workspace > Other and specify a new workspace directory. Eclipse shuts down and restarts with a blank workspace.
  2. Switch to the Samples Console perspective.
  3. In the Samples and Tutorials view, navigate to Rule Designer > Samples > Authoring extensions > Context-aware rule definition and click Import projects. If one or more files already exist in your workspace, Rule Designer displays a warning message.
    Rule Explorer displays the imported sample project files:
    • ruleawareofcontext-rules: rule project
    • ruleawareofcontext-xom: XOM project
  4. Click Window  > Preferences.
  5. In the Preferences dialog, select Rule Designer  > Rule Model Extension.
  6. Select Model: Default extension.
  7. Click Change from Workspace and navigate to the file ruleawareofcontext-rules > data/ruleawareofcontext.brmx.
  8. Select Data: Default extension.
  9. Click Change from Workspace and navigate to the file ruleawareofcontext-rules > data > ruleawareofcontext.brdx.
  10. Click OK. A dialog reminds you that you must restart Eclipse to see the changes.
  11. Click File  > Switch Workspace > Other and click OK without changing the workspace location. Eclipse shut downs and restarts. Rule Designer now recognizes the rule model extension. You might have to rebuild the rule project so that the rules include the extension.
    Note:

    The Problems view displays some errors and warnings. See step 7 in Context-aware rule definition sample details.