Este contenido no está disponible en el idioma seleccionado.
Chapter 26. Pricing Rule Example
26.1. Pricing Rule Example: Executing the Pricing Rule Example Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Procedure 26.1. Task
- Open your console.
- Open the file
PricingRuleDTExample.javaand execute it as a Java application. It will produce the following output in the console window:Cheapest possible BASE PRICE IS: 120 DISCOUNT IS: 20
Cheapest possible BASE PRICE IS: 120 DISCOUNT IS: 20Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use the following code to execute the example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow TheDecisionTableConfigurationobject's type is set toDecisionTableInputType.XLS.There are two fact types used in this example,DriverandPolicy. Both are used with their default values. TheDriveris 30 years old, has had no prior claims and currently has a risk profile ofLOW. ThePolicybeing applied for isCOMPREHENSIVE, and it has not yet been approved.
26.2. Pricing Rule Example: Decision Table Configuration Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Figure 26.1. Decision Table Configuration
- The
RuleSetdeclaration provides the package name. There are also other optional items you can put here, such asVariablesfor global variables, andImportsfor importing classes. In this case, the namespace of the rules is the same as the fact classes and thus can be omitted. - The name after the
RuleTabledeclaration (Pricing bracket) is used as the prefix for all the generated rules. - "CONDITION or ACTION", indicates the purpose of the column, that is, whether it forms part of the condition or the consequence of the rule that will be generated.
- The driver's data is spread across three cells which means that the template expressions below it are applied. You can observe the driver's age range (which uses
$1and$2with comma-separated values),locationRiskProfile, andpriorClaimsin the respective columns. - You can set a policy base price and message log in the Action column.
26.3. Pricing Rule Example: Base Price Calculation Example Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Figure 26.2. Base Price Calculation Example
- Broad category brackets are indicated by the comment in the leftmost column.
- The details of the drivers match row number 18 as they have no prior accidents and are 30 years old. This gives us a base price of 120.
26.4. Pricing Rule Example: Discount Calculation Example Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
Figure 26.3. Discount Calculation Example
- The discount results from the
Agebracket, the number of prior claims, and the policy type. - The driver is 30 with no prior claims and is applying for a
COMPREHENSIVEpolicy. This means a 20% discount can be applied. Note that this is actually a separate table in the same worksheet, so different templates apply. - The evaluation of the rules is not necessarily in the given order, since all the normal mechanics of the rule engine still apply.