First page Back Continue Last page Graphics

Creating the Java Class for a Global Rule


Creating the Java Class for a Global Rule

The Java class needs to implement the JboValidatorInterface interface in the oracle.jbo.rules package. To create the class, invoke the New Gallery and in the Categories list, select Business Tier > ADF Business Components. Select Validation Rule in the Items list to create a class where you can add the validation rule code.

In the Create Validation Rule Class dialog box, enter a name and package for the rule, along with a display name and description. The display name should be the name you want to appear in the list of validators to choose from when adding validation to an attribute, whereas the description becomes a comment in the code to describe the validation that is implemented. When you click OK, the Java class is created.

The example in the slide shows creating a validation rule that compares two dates, validating that one date is not later than another. The intention is that this rule can be used to compare any two date attributes in any entity object.