Define an attribute to use in a rule

Define an attribute to use in a rule

An attribute is a single unit of data or fact. For example:

Rules are constructed by combining attributes. For example:

CONCLUSION: the cost of the movie ticket = $12 if

CONDITION: the person is a full-time student

Attributes can either have a Boolean values (true/false) or take on a Variable value (eg a number, date, text etc.). The following are some examples of attributes and types:

A variable attribute must be created before it can be used in a rule. Creating a variable tells Oracle Policy Modeling how you are intending to use the variable and the type of information you want it to represent. (Boolean attributes do not need to be created before they can be used in rules but it can be useful to do so in order to define public names. For more information, see Define attribute names for use by external applications.)

Attributes are typically created in a properties file in Oracle Policy Modeling. This allows the attribute to be added once and used across all rule documents. This also allows you to define public names, validation and other properties for the attribute. Attributes can be added to an existing properties file from within Word while writing the rules.

Attributes can also be created directly in a Word or Excel rules file. This method is only appropriate for variables that are only used in a single rule document.

Every attribute is assigned to an entity. An attribute is assigned to an entity if it contains the entity text.

What do you want to do?

Create a new attribute from within a Word document

Create a new attribute in an Excel document

Create a new attribute in a properties file

Check attribute entity levels

Create a new attribute from within a Word document

To add an attribute within Word:

  1. Write your rules using your yet-to-be-created attribute, but before compiling your rules, select the attribute text and click the Add Attribute button on the Oracle Policy Modeling toolbar. NOTE: The text of the attribute must contain the name of the entity to which it belongs, otherwise it will not be associated with that entity. For more information on naming attributes, see Choose non-boolean attribute text and Check attribute entity levels.
  2. In the Add Attribute dialog box, select the Type of the attribute from the drop-down list. For more information on attribute data types, see Choose a data type for an attribute.



  3. Select the properties file that you want to add the attribute to from the File drop-down list. Alternatively, if the attribute is only going to be used in this document, you can put the attribute at the top of the document rather than in a properties file by selecting <Top>.
  4. If you have chosen to add the attribute to a properties file, enter a Public name for the attribute if required. (NOTE: All base level attributes and all top level attributes need public names. Important intermediate attributes also need to have public names. For more information, see Set public identifiers for entities and attributes.)
  5. If you have chosen to add the attribute to a properties file, select the Entity that the attribute belongs to. (NOTE: Usually this will have been automatically determined based on the inclusion of entity text in the attribute text, but if the entity is ambiguous you will need to select the appropriate entity.)
  6. Click OK.

Create a new attribute in an Excel document

Attributes that are not used by any other document can be created directly in the Excel document itself, rather than in the project's properties files.

To create an attribute directly in an Excel document:

  1. Open the Declarations worksheet.
  2. In the Attribute Type column enter the type of attribute, and in the Attribute Text column enter the text of the attribute.

TIP: If the default Declarations worksheet has been deleted or altered and these columns don't exist, simply enter your attribute type and attribute text in adjacent cells and apply the appropriate Oracle Policy Modeling styles using either the Oracle Policy Modeling menu or the Oracle Policy Modeling toolbar.

Create a new attribute in a properties file

To create an attribute in a properties file:

  1. In Oracle Policy Modeling, double click the properties file in the Project Explorer to open it for editing.
  2. On the Attributes tab, right-click and select New Attribute...
  3. In the Data type drop-down list, select the type of attribute from the drop-down list.



  4. In the Text field, enter the attribute text.
  5. Click OK to create your attribute.

Check attribute entity levels

After you have defined an entity, every attribute added to a Word document which contains the entity text will attach to that entity. Attributes which do not contain entity text are global.

For example, assume the attributes in the following table have been added to a Word document where "the household member" has been defined as an entity in the rulebase:

 

Attribute Text Entity Level Explanation
the household member is male the household member contains "the household member"
a household member is eligible global "a household member" does not match "the household member"
the former household member has left global "former" interrupts the attribute text
the household member’s annual income the household member adding extra letters or characters on the left or right hand side is ok
the date of birth of the household member the household member entity text may appear anywhere in the attribute text

 

Both Boolean and non-Boolean attributes can be defined to belong to an entity in this way.

Once you have compiled your rules, you can check that all attributes have been associated with the correct entity in the Build Model in Oracle Policy Modeling.

Attributes which do not contain any entity text are placed in the Global level. The list of global attributes are displayed in the right-hand pane:

 

 

To view a list of entity-level attributes, click on the entity name. The list of entity-level attributes will be displayed in the right-hand pane:

 

 

See also: