How to Generate Code

To run the CER code generator, run the following command:

build creole.generate.test.classes

The target will also run the CER rule set validator on your rule sets. If there are any errors, the CER rule set validator reports the errors and processing halts. If there are no errors, the CER generator will output generated Java classes and interfaces for your CER rule sets and rule classes.

Tip: The CER rule set validator will also report any warnings about any non-fatal problems in your rule sets. These warnings will not prevent you running and testing your rules, but should be addressed to ensure an optimal rule set.

The CER code generator will place its output in the EJBServer/build/svr/creole.gen/source directory.

Here is an example generated interface for the HelloWorld rule class:

Figure 1. Generated Java interface for the HelloWorld rule class
/*
 * Generated by Curam CREOLE Code Generator
 * Generator Copyright 2008-2010 Curam Software Ltd.
 */
package curam.creole.ruleclass.HelloWorldRuleSet.impl;
/**
 * Code-generated interface for tests.
 * <p/>
 * Clients must not implement this interface.
 */
public interface HelloWorld extends
 curam.creole.execution.RuleObject {
  /**
   * Code-generated accessor for tests.
   * @return container for the greeting attribute value
   */
  public curam.creole.execution.AttributeValue<? extends
 java.lang.String> greeting();
}
Tip: You should regenerate your test classes if you make structural changes to your rule sets on the file system, e.g.

You do not need to regenerate the test classes if your changes are limited to the implementation of a rule attribute (i.e. its derivation expressions). The derivations are always processed dynamically from the rule set at run time and are not present in the generated test classes.