Shared Rules Engine
The Shared Rules Engine (SRE) component performs activity processing for the OIPA application. Activity processing manages insurance events. SRE loads a transaction and processes the data according to the business rules and math associated with the transaction. When processing completes, the results are sent back to the calling application. The database stores both the configured transaction rules and the actual insurance data.
High Level Interaction Diagram
The above diagram shows a high level interaction between the calling application and SRE. The calling application calls SRE and provides input data and an interface to callback the calling application for extra data needed. SRE does not directly make calls to the database, except for loading rules attached to the current activity. SRE loads the transaction and retrieves any other rules associated with the transaction. When processing is complete, the results are packaged and returned to the calling application and then the results are committed to the database.
There are five components of SRE that come together in processing an activity. They are as follows:
- Processor
- Generators
- Math
- Application Process Execution (Part of the calling application, but SRE calls into the application process execution during activity processing.)
- Extensibility
Interface Between the Shared Rules Engine and OIPA
This section describes how SRE and the calling application communicate. Currently SRE and the calling application are not completely separated with interfaces. The calling application directly calls SRE to start processing and SRE libraries are required for the calling application to be compiled.
To begin activity processing, the calling application calls a process method in SRE's class; ActivityProcessorBll. The process method has three input parameters and returns an ActivityProcessResultsDcl.
Input Parameters
- VariableHashMap – A collection of key-value pairs. The key is a string and the value is an instance of VariableDcl. Data is flattened into a key-value pair for lookup.
- Activity:FieldsXX would be used for activity data.
- Policy:FieldXX would be used for policy data.
- Transaction:XXXX would be used for transaction data
- Plan:XXXX would be used for plan data
- Product:XXXX would be used for product data
- Client:XXXX would be used for client data
- Company:XXXX would be used for company data
- Address:XXXX would be used for address data
- Program:XXXX would be used for program data
- Withholding:XXXX would be used for withholding data
- AllocationFromFundGuidArray would be used for From allocation data
- AllocationToFundGuidArray would be used for To allocation data
- IApplicationCallback – An "umbrella" interface for all callback interfaces. The callback interfaces are as follows:
- ActivityProcessType – An enumerated type (enum) that specifies the type of activity processing logic
- DataRetriever – Executes SQL statements and named queries related to activity processing. Results from the database are returned to SRE as DataDcls, which contain row and column details from the result set.
- RateRetriever – Retrieves rates depending on the rate description and the criteria for the rates. The calling application can store the rates for insurance in any manner and implement this interface for processing needs specified in the rules.
- IActivityTaskExecutor – Processes other activities as part of this parent activity. This is used especially when running backdated activities. To process backdated activities, all active activities that appear in the activity timeline after the backdated activity must be undone and then the backdated activity must be processed. This interface is used to run other activities and commit them as part of the outer processing activity.
- IPolicyValuationBll – Values a policy and returns the cash value. It also is used to locate details about the funds and their cash value, as well as deposits and removal history.
- ICurrencyBll – This interface is used to load currency and round currency information.
- IActivityFunctionFactory – This interface is used to create activity functions.
- IAddressCallbackBll - This is the callback interface for the AddressScreen rule.
- IClientCallbackBll - This is the callback interface for Client details.
- IDataFieldRetriever – Retrieves or updates a value or object from the domain object model using the given xpath expression.
- ActivityProcessType – An enumerated type (enum) that specifies the type of activity processing logic
Output Result
ActivityProcessResultDcl – A complex Dcl that contains the inputs passed, math calculation variables, errors if applicable and a list of updates, inserts and deletes to the data as part of the rule processing. This data is then iterated to be updated to the database.