Differences between ARL and Java 7

ARL is a read-only rule language that is similar in syntax to Java™ 7. To understand the difference between ARL and Java 7, review this list of ARL keywords and operators.

Aggregates

Unlike Java, ARL has aggregate operators that are used in rule descriptions.

Anonymous classes

In Java, you can create anonymous class directly in the body of a method or constructor. In ARL, you cannot create anonymous classes.

Back-quotes

Unlike Java, ARL uses back-quotes (``) to name variables that are not parsed as Java identifies. See the following example:

String `the lazy dog` = "pluto";

Cast Operators

Much like in C®#, you can use the cast operator "as" to do certain types of conversions between compatible reference types or nullable types. See the following example:
AClass anObject = o as AClass;

Goto

ARL does not support goto.

Inner classes

You can refer to the fields of an enclosing class by using the syntax 'A.this', where A represents the enclosing class. This mechanism is extended to refer to certain classes of the engine. For example, if 'ruleName' is ambiguous, you can print a rule name by writing the following code:

if (RuleInstance.this != null)  note("ARL mapping of method M being called by rule "+ RuleInstance.this.ruleName);

ARL Keywords

The following list is the complete set of keywords in the ARL rule language:

abstract continue final in not queryTemplate select throw refresh
aggregate default finally insert null query signature throws retract
as do for instanceof operator once static transient void
assert else from interface out over stipulation true volatile
break enum goto match package repeatable strictfp try when
case evaluate groupby method priority restricts super typedef where
catch exists if modal private return switch update while
class explicit implements modify property rule synchronized updateEngineData xpath
conditionTemplate extends implicit native protected ruleset then updateGenerator xs
const false import new public ruleTemplate this updateGenerators  

Loops

foreach loops have a different syntax.

Switch

It is not necessary to use the keyword "break" at the end of each "case" section.