Overview

A repository consists of a list of records, each with its own set of attributes. Each attribute is defined as being of a particular type and having a certain length.

A repository rule allows you to specify more complex constraints on attributes. For example, a repository defines Price as a Number. Using a repository rule, you can specify that this number must be between 0 and 100. You can also specify that, if Price is not zero, another attribute (Currency) must have a specified value.

A repository rule is an encapsulated piece of business logic that specifies validations, transformations, and access controls for a record. Some examples are:

  • The storage temperature must be between –20F and 80F.
  • The product effective date must be before the product first ship date.
  • The subclass code must be Chicken, Beef, or Vegetable when the product class code is Soup.
  • Volume is calculated by multiplying height x depth x length.
  • Only Supervisors can access records with Product Code equal to ‘HS’.

Repository rules are specified in Rulebase files. Two files can be defined for a repository:

  • New record file — called to initialize a new record
  • Validation file — called for existing records
  • Search control rules file — called from record search.

For detailed information on the Rulebase files, refer to the section Establish a Rulebase File.

The Rulebase file of a repository rule consists of a header, variable declarations, and a constraint. The header gives the name and description of the rule. The constraint contains a condition and an action. The condition describes when the rule needs to be applied. The action describes what the rule actually does and controls which attributes the rule is applicable to. For detailed information, refer to the sectionGlobal Property Settings for Rules.