Skip Headers
Oracle® Business Rules User's Guide
10g Release 3 (10.1.3)
B15986-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

D Oracle Business Rules Troubleshooting

This appendix contains workarounds and solutions for issues you may encounter when using Oracle Business Rules. The following topics are covered:

D.1 Public Fact Variables are not Accessible with Rule Author

Public fact variables are not accessible with Rule Author. For example, the variables in the following class would be accessible with Oracle Business Rules RL Language but not with Rule Author:

public class Test {
   public int i = 0;
   public String s = "string";
}

No variable can be accessed in the Rule Author for facts of type Test. In order to access these variables, methods like the following need to be added:

public void setI(int i) { this.i = i; }
public int getI() { return i; }
public setB(boolean b) { this.b = b; }
public boolean isB() { return b; }

Note that no variable i is required for setI(int i) and getI() to work properly. For more information, please refer to the Sun Microsystems Java Bean specification.

D.2 Global Variables may not be Used in RL Functions

For RL generated from the SDK (for example, Rule Author), global variables may not be referred to directly in an RL function.

To work around this issue, if an RL function needs to access a global variable, the global variable should be passed as a parameter to the RL function. The parameter name allows access to the global variables inside the RL function body.

D.3 Importing JDK 1.4.2 Classes

If you choose to run Rule Author using JDK 1.4.2, be aware that Java classes compiled using JDK 1.5 do not import properly. If you try to import Java classes compiled using JDK 1.5 into Rule Author using JDK 1.4.2, an error message like the following appears:

Cannot perform operation. 'RUL-01527: Received exception for loadClass. 
RUL-01016: Cannot load Java class example7.Example7. Please make sure 
the class and all its dependent classes are either in the class path, 
or user specified path. Root Cause: example7/Example7 (Unsupported 
major.minor version 49.0) '

To work around this issue, run Rule Author using JDK 1.5 or recompile the classes using JDK 1.4.2.

D.4 Managing Popup Windows on Firefox

If you are running Rule Author on Firefox browser, you may encounter a problem if you close many popup windows using the X button in the upper corner of the window instead of the OK, Cancel, or Apply buttons.

The easiest way to avoid this problem is to use the OK, Cancel, or Apply buttons instead of the window controls to close the popup windows. You can also change value of the dom.popup_maximum parameter to allow for many more popup windows. To do this:

  1. Type about:config as the URL and locate the dom.popup_maximum parameter.

  2. Set the value to 10000 or higher.

D.5 Using the String Data Type with Methods

The built-in data type String does not contain any methods. Thus, if x is a String, x.substring(1) would be invalid in an advanced expression.

To work around this issue:

  1. Import java.lang.String into the data model as a Java fact type.

  2. Give this fact type an alias. The default alias is java_lang_String.

  3. Use this new fact type instead of String when you are defining RL fact types or variables in the data model.

D.6 Preserving Class Order and Hierarchies in the Data Model

Classes and interfaces used in Rule Author must follow the following rules:

  1. If you are using a class or interface and its superclass, the superclass must be declared first. Otherwise, the generated RL program throws an exception like the following:

    "FactClassException: fact class for 'pkg.Parent' should be declared earlier in rule session".
    
    
  2. If you are using a class or interface, only its superclass or one of its implemented interfaces may be mentioned. If multiple interfaces are mentioned, the generated RL Language program throws an exception like the following:

    MultipleInheritanceException: fact class 'pkg.Child' cannot extend both 'pkg.ParentInterface' and 'pkg.ParentClass' 
    
    

To work around these issues:

  1. Identify the hierarchy of classes and interfaces in the data model you want to use in your rule sets.

  2. For each class or interface in the hierarchy, check the Support Xpath Assertion box. This causes fact class statements to be generated in the correct order as part of the data model RL.

D.7 Validating Generated RL from Rule Author

In order to validate generated RL from Rule Author, make sure that the Java classes in the Data Model are in the OC4J classpath. For more information on setting the OC4J classpath, see Section 3.10, "Working with Test Rulesets".

D.8 Using RL Reserved Words as Part of a Java Package Name

Invalid RL Language is generated if an RL Language reserved word (for example, the word rule in mypkg.rule.com) is part of the Java package name. If an RL Language reserved word is used in a Java package name, an error message like the following appears:

Oracle RL 1.0: syntax error PareseException: encountered 'rule' when expectingone of: <XML_IDENTIFIER> ...<IDENTIFIER> ... "*" at line 11 column 19 in main

There is no workaround for this issue; do not use RL Language reserved words in Java package names.

D.9 Getter and Setter Methods are not Visible

Rule Author does not list the methods supporting a Java bean property in choice lists; only the bean properties are visible. For example, a Java bean with a property named "Y" must have at least a getter method (getY()) and may also have a setter method (setY(y-type-parm)). All of properties and methods (including getter and setter that compose the properties) are displayed when viewing the Java FactType. Only the properties of Java Classes (not the getter and setter methods) are displayed in choice lists. When attempting to control the visibility of the property it is best to use the properties visibility flag. Marking a getter or a setter method as not visible may not remove the properties from choice lists.

There is no current workaround for this issue.

D.10 XML Facts not Asserted at Runtime

The XML Fact page for an XML Schema generated class shows the Support XPath Assertion box. This box is checked by default. Un-checking this box and saving your changes marks the XML Fact as not supporting XML style assertion, which in turn means that any instance of this type and any of its children are not asserted by a call to assertXPath for an XML document.

There is no workaround for this issue; you should make sure the Support XPath Assertion box is checked for all XML FactTypes.