Define a decision table in an Excel workbook (Oracle policy modeling-define decision tables in Excel workbooks)

Source: Internet
Author: User

To write a rule in Excel, you only need to write rules in the table and use the Oracle Policy Modeling style to identify the type of information in the cell.

So that these rules can be compiled and used in Oracle determinations Engine. You can create any number of rule sheets in your document.

Understanding styles for a rule table

The Excel rules that you intend to compile in Oracle policy Modeling need to be styled with the style tags provided with the Oracle policy Modeling Excel document template. The following styles are used to write rules:

The header cell is optional. Similarly, cell order is irrelevant because each style is unique-as long as the necessary style is used for valid cell content.

Attention:

A. Regardless of the order of declarations on the worksheet, the processing order is global entity, entity, and then any property. This guarantees that the attribute appears in the correct entity.

B. To define the format of the cell as a currency value, do not use the buttons on the Excel Formatting toolbar-instead go to the format | cell and select the currency on the Number tab.

C. When working with numbers, currencies, dates, and times in Microsoft Excel, the computer's regional settings should match the area of the Rule Library project. This is because

Define the format of the data type for Microsoft Excel using the templates in the locale.

If you use Text properties, the value of the Text property can be enclosed in quotation marks, or it can be enclosed in quotation marks, and the processing method is the same. If you want to use text in the rule table

function, you need to enclose the function text in parentheses.

Create a rule table in Excel

When you add an Excel document to a project, the Rule Table worksheet for this document will contain a rule template that resembles the following:

To write a simple rule that contains a single condition and a single conclusion in Excel, follow these steps. In this example, we will be pushing according to the nationality of the person

To break out of which country it is. Note: Variable properties should be declared in the properties file before they can be used in Excel. (You do not have to use a Boolean property in a rule before

Declare these properties. In this example, the text variable "nationality" and "which nation" have been declared in the project's properties file.

A. Replace the text condition in the second column with "nationality". This cell has the correct conditional heading style. Because we will have only one set of conditions, you can delete the first condition column.

B. Replace the text conclusion with "which nationality". This cell has been styled with the correct conclusion heading . Because we will have only one set of conclusions, you can delete another conclusion column.

C. Type "United States" in the cell below the "nationality" cell. Use the TAB key to go to the next cell (the cells below the "nationality" cell) and type "American".

These cells are already in the correct style: conditions and conclusions , respectively. Delete the next two lines, because these lines are not used.

1. In the following line, enter another condition "Scotland", associated with the conclusion "Scotsman". The following line is processed in this way, with the condition "Japan" and the conclusion "Japanese".

2. Type "Indeterminate" in the cell next to the condition. This action will apply an alternative conclusion of "indeterminate".

The rule table should resemble the following:

When a rule is compiled, the decision tables written in Excel are converted from Oracle policy Modeling to internally generated rules

The table. The table above will create the following rule (xgen) in Oracle Policy Modeling. (To view this rule, you can

In the OPM Project Explorer, right-click the rule document and choose Open Rule Browser. )

Prove multiple attributes for the same set of conditions

By using only one table in Excel, you can prove multiple attributes for the same set of criteria (different from needing more than one rule table in Word).

Suppose you have declared the following variables, the text variable "nationality", "which nation", and "country/region currency", you can write the following rule table:

Proving the same set of conclusions using multiple criteria

You can specify multiple criteria for a specific conclusion in Excel, and, if appropriate, merge the concluding cells to affect the way the rules are evaluated.

For example, you may want to determine the appropriate ticket type for different combinations of adults and children. If you have the following variables:

You can write the following rule table:

The rules that are generated for this table in Oracle Policy Modeling are as follows:

If we do not want to test the attribute value of the conclusion cell, you can leave the conditional cell blank. In our example, we can

decided that two adults with children can purchase "family" tickets to enter, three adults whether or not with children, can buy "family" tickets.

This simplifies the logic and generates the following rules:

If more than one criterion row proves the same conclusion, we can also combine the cells of the concluding values.

This simplifies the appearance of the Excel rules table, emphasizing that the values inferred for tickets are the same in multiple possible scenarios. However, the Oracle Policy Modeling solution

The way the rules are interpreted will also change. The internal rule table that is generated from the Excel rules table includes one row for each Excel conclusion cell.

This means that there are not two lines in the generated rule table to justify the same conclusion value (evaluated in order from top to bottom), but only one row to prove

A conclusion value that has multiple options that can be evaluated in any order. Rules need to take into account that some condition values are unknown when this is useful.

Tip: To see an example of a complete rule library that uses merge criteria and conclusion cells, open and run the Insurance fraud score example

The library project, which is located under the Samples folder in the Oracle Policy Modeling installation folder.

Allow rule conditions to evaluate in any order and handle missing values

Oracle policy Modeling evaluates rows from top to bottom based on the internal rule table generated by the decision table in Excel. If the first row of the table cannot be

Evaluation (that is, if some of the condition values are unknown), even if subsequent rows in the table can be evaluated because all of their condition values are fully known, the rules table

The evaluation will not exceed the first line.
In some cases, this is not the most useful way to evaluate a rule. If you prove a conclusion in a variety of ways, you can use it in all different

A single conclusion cell is merged in the Criteria row. Then, Oracle Policy Modeling will allow any of these criteria lines to prove the conclusion in any order.

For example, in the following rule cell, we want any row in either row to be able to prove the conclusion.

When using the current Rule table layout, in the rules generated by Oracle Policy Modeling, for each row in the Excel rule

Have a separate line. Because the rule table is evaluated from top to bottom, this means that even if we know that a person is 16 years old and therefore entitled to

Youth benefits, the rules table is also the result of a person's occupation before we can infer the results and evaluate the first line.

However, if we merge the cells that contain the conclusions applicable to both lines, the internal rules generated by the Oracle Policy Modeling

These rows are merged with the "or" condition in a single rule table row instead of the two separate rule table rows generated above.

This new structure allows you to evaluate the criteria for proving the conclusion in any order, so now even if the value of the first row is unknown, the second line allows the rule to be evaluated.

Write a decision to apply to a series of numeric or date comparison type rules

For non-text conditions, the decision may be applied to a series of numbers or dates rather than to a specific number or date.

The simple example is to map the taxable income for a specific date range to the tax rate:

You may also want to make multiple comparisons of an attribute, for example:

Split rule table based on the application start date of the rule table

Tables can be split on multiple tables in the same file to account for periodic table updates that are applied starting from a specific date. For this

You can insert a primary table to prioritize each table. Prioritize by referencing the table name specified in the tab of the table.

For example, you might have:

The logic of these tables will be merged at compile time and therefore will not result in multiple proof properties. The main table uses the standard rule conditions and the conclusion style,

But there is a conclusion column titled "Application Table" that uses the conclusion heading style. Therefore, note that the text "application table" cannot be used as a

The column headings in the Standard Rules table.

In this example, you have three additional worksheets that contain the following rule tables. Note that you must follow the "Application table" column to

Title (case-sensitive) to the worksheet.

The following rules will be created in Oracle Policy Modeling:

Tip: To see an example of a complete rule library that uses the application table to infer an attribute that changes over time, open

and run the Insurance Fraud score Sample Rule Library project, which is located under the Samples folder in the Oracle Policy Modeling installation folder.

Using entity properties in the Excel rule table

You can prove the entity layer properties in the Excel rules table, but all the conclusion attributes in the table must be in the same entity. Rules

The condition properties in a table can be in the same entity as the conclusion, or you can refer to any entity in the containing relationship of the conclusion entity.

For example, the following rule table infers the conclusion attribute in the pet entity using the conditional attributes in the entity "child" and the global entity,

Both the entity "child" and the global entity are in their containment relationships, as follows:

Entity Layer properties can also be used in conditional cells that have most entity functions. For example, the following rule uses the total number of instances function to set her pocket money based on the number of pets a child has.

NOTE: Entity functions that cannot be used in Excel are those that work with multiple entities: a range satisfies a condition, and all is satisfied within the scope

There is a condition, a member of the collection, a member that is not a collection, an instance equal, and an instance not equal.

Tip: To see an example of a complete rule library that uses entity layer properties, functions, and calculations based on entity instances, open and run the

Risk Fraud score Sample Rule Library project, which is located under the Samples folder in the Oracle Policy Modeling installation folder.

Proof Text properties in Excel rules

When you certify text attributes in an Excel rule, you need to enclose the property text in parentheses so that the compiler recognizes it as a property.

For example, if you have the following declaration:

When you infer the text of a text property in the Rules table, you will need to enclose it in parentheses. For example:

If these attributes are not enclosed in parentheses before and after these text attributes in the rule, they will not be recognized, and the resulting rule will infer the literal string.

When you infer a specific value for a Text property, you do not have to enclose it in parentheses (note that you can put the value of the Text property in quotation marks or not in quotation marks, and the processing method is the same).

========================================================

More Reading,and 中文版 is important.

I ' m Hongten

E |  [Email protected] B | Http://www.cnblogs.com/hongten

========================================================

Define a decision table in an Excel workbook (Oracle policy modeling-define decision tables in Excel workbooks)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.