You are here: Configuration > Transactions > Configuration Panes > MathLoop

Oracle® Insurance Rules Palette 9.4.1.0 E23637_01

# MathLoop

The MathLoop math variable provides a method of executing a set of instructions that are to be repeated. Each type of repetition is called an iteration. There are four types of Loops currently supported in OIPA: FOR, SEGMENT, OBJECT and VALUATION.

The FOR Loop allows the system to repeat instructions to loop for a specified number of iterations. The number of iterations can be specified by using a hard-coded integer value or a defined math variable. If a math variable is used the math variable can hold a calculated integer value.

The SEGMENT Loop allows the system to loop through segments listed on/for a specific policy/certificate. By default, the SEGMENTLOOP will loop through all segments, inactive as well as active, unless the math variable Condition is specified. The Condition attribute/property is typically used to instruct the system to only loop through active segments based on the value of a specified segment field (e.g. CONDITION=”FieldName = 'SegmentActiveCode' And TextValue = '01'”).

The OBJECT Loop provides a method to loop through any OIPA database table. OBJECT and OBJECTFIELD math variables are used inside the OBJECTLOOP to set up the table to be looped through and then retrieve the values from the table.

The VALUATION Loop provides a method to loop through the values of Valuation records held in memory as the activity processes but before it is written to the database tables.

Note: The Valuation looping method is only available to the PostAssignmentValidateExpressions rule and is not expressed as an option inside the Math pane of the Rules Palette.

MathLoop Math Variable in Palette

Note: For a comprehensive explanation of the characteristics of this math variable, refer to the XML Configuration Guide in the Help menu.

## Define the MathLoop Math Variable

Drag and drop the MathLoop math variable from the Palette window onto the Math Pane. Enter the following information for the math variable.

- Type a name in the Name field. This is required.

- Make sure variable type is defined MathLoop. This is required.

- LoopType is required. The options in the drop down selection are FOR, SEGMENT, OBJECT or VALUATION loops must be manually configured in the XML Source pane for the transaction’s attached PostAssignmentValidateExpressions rule.

- FOR Loop Only: Iterations requires the number of times the system will loop through the configuration. The value of this property may be hard-coded with a value or designated as a previously defined Math variable of the Integer data type.

- SEGMENT and OBJECT Loops only: Condition requires a comparison statement for evaluation. SEE OPERATORS LINK list for details to configure the condition. The Condition allows the system to filter keys to be returned within the array. For example, if you are retrieving values from Client, you may filter via a condition stating TypeCode = '02' to return values where the client is an individual.

- SEGMENT Loop Only: Policy property will always be set to [Policy:PolicyGUID] always. This is required.

- OBJECT Loop Only: Object Name allows you to select a radio button option of Object or Free Form. Selecting Object will provide you with a list of all database tables. Free Form allows you to enter the table name (No As prefix when typing the table name free form).

- OBJECT Loop Only: Key is the property that defines the primary GUID / key of the database table. For example, ClientGUID is the Key for Client database table.
- VALUATION Loop Only: This loop type will allow the math to loop though the values of the valuation record that the activity will write or has already written but has not committed to the database yet. These values are held in system memory as the transaction processes. The loop can only be run in the PostAssignmentValidateExpressions rule and will not work in normal transaction Math. It can either loop through all the valuation records for the activity or just those records for a specific fund. All columns on the AsValuation and AsUnitLinkedCalcValue tables are available by using a math variable with a VALUATIONFIELD type inside the loop to retrieve the column value.

Math Loop with Activity and ActivityArray:In order to populate the array with more than one Activity math object, a standard loop can be used (optional).

- Steps include: Create the ActivityArray, Begin the MathLoop, Create the Activity Object, Set Value of the Activity Object, Add the object to the ActivityArray, and Close the MathLoop.

Note: The ActivityArray variable must be instantiated outside of the loop and the Activity object math object inside the loop.

Check-in the transaction to save the information to the database.

Copyright © 2009, 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices