The topics in this section describe more detail to consider when implementing a new business logic using an OPA rulebase with pre-generated data model.
The generated data model reflects the structure of the source entity. Each entity name corresponds to the xml node name and may be prefixed with the succession of parent node names and node type “qualifiers”, such as section, line, table, list, group or tablerow. This is done in order to ensure the uniqueness of the entity names within the generated model.
Each entity that represents the actual data-bearing elements, has two value-holder attributes, one for an original input value and one for the value determined as a result of the rulebase execution. The input value is named xxx_submitted_value, the output is named xxx_determined_value.
In OPA development environment create a new project, select Properties folder on the project explorer three and use the option Add Existing File to add the generated data model file as a properties file. Perform an initial sanity check: compile the rulebase and verify that the generated data model contains no errors.
Total Gross Sales' Determined Value | |
0 | The total gross sales' submitted value is unknown. |
The total gross sales' submitted value | otherwise |
Implement form data validations and calculations. The ultimate goal is to determine whether the data is valid, to correct the invalid values and/or provide the calculation results. The rulebase may also raise form exceptions. For that purpose, you should populate the entity’s attribute named xxx_error_message with the actual error text.
The rulebase outcome comprise multiple determined values, validation error(s) and error indicators. Make sure your rulebase’s output meets the expectations of the corresponding integration component:
A form rule algorithm C1-OPAVLAPRL expects the error_severity and rule_outcome indicators to be populated with numeric values. These values are mapped to the standard form rule parameters Exception Class and Rule Action and further interpreted by the product’s form rule engine. The error messages returned by OPA are captured as form exceptions.
A business service C1-DataAreaInvokeOPA expects that OPA returns a single error message and treats it as a regular application error. .
The product integration supports retrieving a single decision report associated with the root data model entity. This entity has a boolean attribute named xxx_contains_error that should be set to true or false by the rulebase.
If requested, the integration component stores the decision report and links it to the “owner” entity via log..
Refer to Viewing Decision Report for information about viewing the decision report.
Use Oracle Policy Modeling to develop the rulebase. Once the rulebase is tested and it is compiled and built, the deployment file is created.
The remaining steps for the integration involve configuring the components that invoke the rulebase.
Refer to Configuring the Shared Data Model Integration for more information.
Copyright © 2007, 2016, Oracle and/or its affiliates. All rights reserved. Documentation build: 2.5.2016 10:21:45 [T1_1454696505000]