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. Open the Samples Console (see Running samples from the the Samples Console).
  3. In the Samples and Tutorials tab, expand Rule Designer > Samples > Authoring extension.
  4. Under Context-aware rule definition, 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
  5. Click Window  > Preferences. (On Mac, click Eclipse  > Preferences.)
  6. In the Preferences dialog, select Rule Designer  > Rule Model Extension.
  7. Select Model: Default extension.
  8. Click Change from Workspace and navigate to the file ruleawareofcontext-rules > data/ruleawareofcontext.brmx.
  9. Select Data: Default extension.
  10. Click Change from Workspace and navigate to the file ruleawareofcontext-rules > data > ruleawareofcontext.brdx.
  11. Click Apply and Close.
    A dialog reminds you that you must restart Eclipse to see the changes.
  12. Click File  > Switch Workspace > Other and click Launch 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.