Compile rules and correct errors

Compile rules and correct errors

The rulebase project is compiled to produce the required files to conduct an investigation.

After you have written your rules you need to compile them.

Compilation in Microsoft Word and Excel is triggered by the Compile button on the Oracle Policy Modeling toolbar.

Clicking the Compile button starts the parse and validation process.

After your rules have been successfully compiled, you can then view your rules in Oracle Policy Modeling. There is a one-way direction for editing Oracle Policy Modeling documents. This means that you must alter your rule documents in Word or Excel and re-compile to make changes to your rule models. You cannot update your rules or attributes in Oracle Policy Modeling. 

What do you want to do?

Correct rule errors

Understand what parsing means

Review the attribute parses

Identify the operative verb

Select an alternate parse

Delete unused attributes

Understand attribute IDs

Compile rules from within Oracle Policy Modeling

Correct rule errors

If there are errors in your Oracle Policy Modeling format, the compilation process will cease, and you will be prompted to correct those errors.

In the Compile Errors dialog, select the error message and then click the Go To button. The part of the rule that is causing the error will be highlighted in the rules document. Fix the error and then re-compile.

After your rules have been successfully compiled, any changes to attributes will be displayed and you will be informed that the process is complete. From this point, you can then view your rules in Oracle Policy Modeling.

Understand what parsing means

All boolean attributes need to be parsed to produce their positive, negative, uncertain and question forms. The process of parsing is to identify the primary verb in the attribute and build these text forms around that verb.

For example, parsing the attribute "the dog bit the man" would generate:

 

the dog bit the man positive form
the dog did not bite the man negative form
did the dog bite the man? question form
the dog might have bitten the man uncertain form

 

Attributes can be entered in rules using the positive, negative or uncertain form. The parser can handle this and will still generate the other forms correctly.

NOTE: This description of parsing applies to the fully-featured parser (for example, English US) in Oracle Policy Modeling. If you have a project which uses a RLS (Rapid Language Support) parser, the sentence parses are generated using a generic statement defined in the configuration for that particular RLS parser. For more information on using an RLS parser, and changing individual sentence forms in such a project, see the Help available in the Rapid Language Support Tool.

Review the attribute parses

Review the attribute parses in a rules document

In Word and Excel, when you click the Compile button on the Oracle Policy Modeling toolbar, any new attributes will be automatically parsed.

You should review the attribute parses to see if any attributes have not been parsed correctly. You can do this using the Confirm New Attributes dialog which is displayed whenever you compile after adding new attributes.

In this dialog, the verb which is being used for the parse is underlined for each attribute in the list.

 

 

The table below describes what you should be looking for when reviewing this list of new attributes.

 

What to look for What this means What to do
Attributes highlighted with a gray background The attribute contains more than one recognized verb (even if the word is not functioning as a verb in that particular attribute, as in the example above)

If the underlined verb is the correct verb (ie the operative verb around which the sentence forms should be based) you can leave the parse as is.

If the underlined verb is not the correct verb around which the parse should be based, you need to select an alternate parse.

If you are not sure if the underlined verb is the correct verb around which the parse should be based, you can view the sentences forms generated for each parse. In the Confirm New Attributes dialog, select the attribute and click the Edit button. Select the parse in the top box to view the sentence forms for that parse in the box below.

Attributes shown in red (and also highlighted in gray) The attribute does not contain a recognized verb and no sentence forms have been generated Add the verb to the custom verbs list for the project and then reparse the attribute
Attributes which contain compound verbs (ie verbs made up of several words) where the entire verb is not underlined The verb has not been recognized by the parser as a compound verb, resulting in potentially incorrect sentence generation Add the verb to the custom verbs list for the project and then reparse the attribute

 

After you have confirmed your attributes, click OK in the Confirm New Attributes dialog box.

Review the attribute parses in a properties file

In Oracle Policy Modeling, when you add a new boolean attribute to your properties file, you click the Parse button in the Attribute Editor to parse the attribute. The sentence forms for that parse will be shown in the box below.

Identify the operative verb

Sometimes, attributes only include one simple verb, in which case it is easy for the parser to identify the verb and generate the correct sentence forms. Often though, a attribute will contain more than one verb. For this reason, you need to be able to identify the operative verb in an attribute so that you can assess whether the attribute has been parsed correctly.

Some attributes contain two verbs but only one verb is operating as a verb in the attribute. It is easy to identify the operative verb if you consider how the attribute should be negated.

For example, the attribute "the car started to roll down the hill" contains two verbs, 'to start' and 'to roll'.

To negate this attribute you would place the "not" in front of the verb 'to start' (ie "the car did not start to roll down the hill") so 'to start' is the operative verb.

Similarly, "the people watched the boat go by" contains two verbs, 'to watch' and 'to go. This attribute would be negated by placing the "not" in front of the verb 'to watch' (ie "the people did not watch the boat go by") so 'to watch' is the operative verb.

Select an alternate parse

If you want to change the parse for an attribute this should be done in the properties file in Oracle Policy Modeling to ensure that the change applies across all rule documents.

To select an alternate parse for an attribute:

  1. Open the properties file for the project.
  2. Double-click on the attribute in the Attribute view to open it in the Attribute Editor. (If the attribute does not already exist in the properties file, ie because it was added directly in the rules document/s, you will need to add it to the properties file. Right-click in the Attributes view and select New Attribute.)
  3. Select the Parse button to open the Select Parse dialog. In the Text field the attribute is shown with the primary verb underlined.
  4. Select an alternate parse from the list. This will display the sentence forms for that parse in the box below.
  5. Click OK. The Attribute Editor will now show the new parse for the attribute.

 

Delete unused attributes

If there are any attributes in your Word or Excel document that have been added but are not used, or that were previously used but that are no longer used, you will be prompted to delete these attributes on compile:

 

 

Select the attributes that you want to delete and click the Yes button.

Understand attribute IDs

Oracle Policy Modeling automatically assigns an ID to each attribute as it is parsed during compiling. This is evident in the Oracle Policy Modeling mark-up (red text) which is inserted into your rule document in Word on compiling:

[b7] the claimant satisfies the Financial Qualification if

[b24] the claimant's weekly rent doubled is more than one half of the claimant's weekly net pay

[(p2*2)>(p3/2)] (the claimant's weekly rent * 2) > (the claimant's weekly net pay / 2)

 

Boolean attributes are named "bx" where x is a sequential integer (eg b1, b2, b3, etc). Non-boolean attributes are named "px" where x is a sequential integer (eg p1, p2, p3 etc). These IDs are used by Oracle Policy Modeling to notate rules.

Because IDs are consecutively generated as b1, b2 etc on a per-document basis, Oracle Policy Modeling needs to distinguish between IDs from one rule document and another.

To do so, it automatically assigns a document ID to each entity and attribute ID, based on the document location and file name.

For example, b7 in the following document:

 

 

becomes:

 

Customize document IDs

Documents with long file and folder names can become somewhat unwieldy. To avoid this problem, Oracle Policy Modeling allows you to rename the document ID used in the automatic generation of attribute IDs. To do this:

  1. Select the document in the Project Explorer, right-clicking it and selecting the Properties pop-up menu option.
  2. Uncheck the Base document ID on file name check box and define a new, more comprehensible name for the document. (Names may only contain alphanumeric characters and the underscore ("_"). Spaces are not permitted.)
  3. Click OK.

The attribute IDs for that document will be updated with the new document ID:

 

Compile rules from within Oracle Policy Modeling

To compile your rules from within Oracle Policy Modeling, right-click on the document name in the Project Explorer and select Compile from the pop-up menu. Oracle Policy Modeling will open the document in the appropriate program (Word or Excel) and automatically run the compile process.

It is also possible to compile all the documents in a project by selecting Compile All from the Tools menu. Word or Excel will open each document in the project one-by-one and automatically run the compile process for each one. NOTE: Compile All only compiles documents that have been modified (ie where the source document has a more recent time-stamp than the xgen file).

Once you have compiled your rules, you can build and debug them using the debugger. This allows you to explore your rules interactively.