Calculate

This business rule calculates various segment and policy values.  When a segment is added to a policy, the math configured in this business rule takes into account various aspects of the policy and arrives at the values, which may be stored in the database tables.  The standard naming convention for the rule is to attach a suffix to the rule name with a common name for the segment to which it is associated, such as CalculateGeneral-BaseCoverage. Calculate business rules are always identified by their <Calculate> parent element. 

Note: You can create a plan override of a Calculate business rule for each segment. In the SegmentScreen business rule, associate the calculate button with a specific CalculateGeneral rule that is tailored to a specific segment.    

CalculateGeneral Attributes/Elements
Element/Tag Attribute Definition Element/Attribute Value and Description

<Calculate>

 

The opening and closing tag of the Calculate business rule.

 

<Input>

 

The opening and closing tag that contains the MathVariables for the rule.

 

<MathVariables>

 

Please see MathVariable Elements.

 

<MathVariable>

 

 

 

<MathIF>

 

Please see MathIF Elements.

 

<MathLoop>

 

Please see MathLoop Elements.

 

<CopyBook>

 

Please see CopyBook Rule.

 

<Validation>

 

   

<Expression>

 

An expression using MathVariables and operators.

Allows validation of the values contained in MathVariables. See Validation for full details.

String 

TYPE

 

ErrorOnTrue  

ErrorOnFalse  

MESSAGE

The error message to be displayed to the user.

Note: The value of a Math Variable or a Segment Field can be substituted in the validation message surrounded by $$$. See General Structure and Best Practices

String  

<Output>

 

Identifies the values that were calculated and will be written to the database.

 

<Mappings>

 

Starting tag that identifies which MathVariable will be mapped.

 

<Mapping>

 

Identifies the MathVariable with the value that will be copied to the database table. The value identifies the Math Variable.

 

OUTPUTNAME  

Defines the name of the field that will be updated.

String  

TYPE

Always specify a value of "FIELD".

String 

GROUP

Identifies the table to which the data will be saved.

Segment: The data will be saved to the AsSegment database table. This is the default behavior.

Policy: The data will be saved to the AsPolicy database table.

ROLEGUID    
ROLEGUIDARRAY    
DEFAULT    

<BenefitSplit>

 

Optional element   

Defines Benefit Split parameters for calculations.

Note: The precision of the resulting BenefitSplit units will be set by the Plan’s AllocationScreen rule using the Policy level settings.

 

<Allocations>

 

 

 

Required element

Selects the allocation from which the benefit split will be built.

 

TYPECODE

Holds a literal or variable indicating the Allocation Type Code to merge.

 

LEVEL

Holds a literal or a Policy/Plan variable indicating the level of the type code to merge.

 

<MergeAllocations>

 

 

Optional element

Controls choosing the fixed fund allocations outside of the Allocation Screen.

 

MERGE

Holds a literal or variable (Yes/No) indicating if merge logic is required.

Yes | No   

No is the default value.

<AddAllocations>

 

 

 

 

Required if MERGE is 'Yes'.

 

TYPECODE

Holds a literal or variable indicating the Allocation Type Code to merge.

 

LEVEL

Holds a literal or a Policy/Plan variable indicating the level of the type code to merge.

 

PERCENT

Holds a literal or variable percentage of the allocation to be applied. The precision of the resulting merged allocations will be set by the Plan’s AllocationScreen rule using the Policy level settings

 

<FinalAllocations>

 

 

Controls writing new AsAllocation records with the result of the merged allocations. Final Allocations are saved at the Segment level.

 

TYPECODE

Holds a literal or variable indicating the Allocation Type Code of the FinalAllocation AsAllocation record.

 

<Relation>

 

Required element

Contains relation keys to link benefit funds to the parent/child allocations.

 

<Criteria>

 

 

 

Required, repeatable element   

Identifies the fund field with which to match the Input Math value. The value of the Criteria is a Math Variable from the CalculateGeneral input math, or a literal value, for matching the criteria name.

 

NAME

Identifies the Fund Field.

 

DATATYPE

Specifies the data type of the criteria value and Fund Field.

 

<FixedBenefitFund>

 

Required if the segment supports fixed benefit payouts. The element holds a variable containing a fund type code 03 FundGUID to which all fund type code 01 fixed allocation(s) will merge.

 

<EffectiveDate>

 

Required element

Holds a Math Variable date value used to look up the unit values of the benefit funds.

 

<CreateDeferredSplit>

 

Optional element   

Holds a Math Variable or literal value of Yes or No indicating if type 51 benefit split records are to be created.

Yes | No   

No is the default value.

<VariableBenefit>

 

Required element

Specifies a currency or decimal Math Variable representing the calculated variable benefit amount. The currency is assumed to be the Plan default.

Note: Currently only used when 'Solve for Benefit' is selected.

 

<FixedBenefit>

 

Required element

Specifies a currency or decimal Math Variable representing the calculated fixed benefit amount. The currency is assumed to be the Plan default.

Note:Currently only used when 'Solve for Benefit' is selected.

 

<GeneratePendingRequirements>

  Optional element

Yes/No   

XML Examples

Calculate General Example

<Calculate>
<Input>
<MathVariables>
<!-- SegmentFields -->
<MathVariable VARIABLENAME="True" TYPE="VALUE" DATATYPE="INTEGER">1</MathVariable>
<MathVariable VARIABLENAME="False" TYPE="VALUE" DATATYPE="INTEGER">0</MathVariable>
<MathVariable VARIABLENAME="GMDBEffectiveDate" TYPE="SEGMENTFIELD" DATATYPE="DATE">StartDate</MathVariable>
<!-- Clients On Policy DOB Collection -->
<MathVariable VARIABLENAME="AnnuitantExists" TYPE="SQL" DATATYPE="INTEGER" DEFAULT="-999999999">
SELECT (CASE WHEN COUNT(*) &gt; 0 THEN 1 ELSE 0 END) 
FROM AsCode JOIN AsRole ON AsRole.PolicyGUID = '[Policy:PolicyGUID]' 
AND AsRole.RoleCode = AsCode.CodeValue WHERE AsCode.CodeName = 'AsCodeRole' 
AND AsRole.RoleCode='27'</MathVariable>
<MathVariable VARIABLENAME="AnnuitantDOB" TYPE="SQL" DATATYPE="DATE">
SELECT AsClient.DateOfBirth FROM AsCode LEFT JOIN AsRole 
ON AsRole.RoleCode = AsCode.CodeValue AND AsRole.PolicyGUID = '[Policy:PolicyGUID]' 
LEFT JOIN AsClient ON AsClient.ClientGUID = AsRole.ClientGUID 
WHERE AsCode.CodeName = 'AsCodeRole' AND AsCode.CodeValue = '27'</MathVariable>
<MathVariable VARIABLENAME="AnnuitantDOBExist" TYPE="FUNCTION" DATATYPE="BOOLEAN">IsEmpty(AnnuitantDOB)</MathVariable>
<MathIF IF="AnnuitantDOBExist=false">
<MathVariable VARIABLENAME="AnnuitantAgeMV" TYPE="FUNCTION" DATATYPE="INTEGER">ANBAgeOf(AnnuitantDOB,GMDBEffectiveDate)</MathVariable>
</MathIF>
<MathVariable VARIABLENAME="GMDBMaximumAgeMV" TYPE="PLANFIELD" DATATYPE="INTEGER">GMDBMaximumAge</MathVariable>
</MathVariables>
</Input>
<Validation>
<Expression TYPE="ErrorOnTrue" MESSAGE="Annuitant Date of Birth is blank.">
IsEmpty(AnnuitantDOB) And AnnuitantExists &gt; 0</Expression>
<Expression TYPE="ErrorOnTrue" MESSAGE="Annuitant must be of age 70 or less.">
AnnuitantAgeMV &gt; GMDBMaximumAgeMV</Expression>
</Validation>
<Output>
<Mappings>
<Mapping OUTPUTNAME="AnnuitantAge" TYPE="FIELD" GROUP="Segment">AnnuitantAgeMV</Mapping>
</Mappings>
</Output>
<GeneratePendingRequirements>No</GeneratePendingRequirements>
</Calculate>

Calculate Benefit Split Example

<Calculate>
<Input>
<MathVariables>
<MathVariable VARIABLENAME="PolicyBandVariable" TYPE="POLICYFIELD" DATATYPE="TEXT">BandVariable</MathVariable>
<MathVariable VARIABLENAME="BenefitSplitBand" TYPE="SEGMENTFIELD" DATATYPE="TEXT">BenefitSplitBand</MathVariable>
<MathVariable VARIABLENAME="UnitValueDate" TYPE="SEGMENTFIELD" DATATYPE="DATE">BenefitValuationDate</MathVariable>
<MathVariable VARIABLENAME="DeferredSplit" TYPE="SEGMENTFIELD" DATATYPE="TEXT">DeferredSplit</MathVariable>
<MathVariable VARIABLENAME="VariableBenefitAmount" TYPE="SEGMENTFIELD" DATATYPE="DECIMAL">VariableBenefitAmount</MathVariable>
<MathVariable VARIABLENAME="FixedBenefitAmount" TYPE="SEGMENTFIELD" DATATYPE="DECIMAL">FixedBenefitAmount</MathVariable>
<MathVariable VARIABLENAME="TotalBenefitAmount" TYPE="EXPRESSION" DATATYPE="DECIMAL">VariableBenefitAmount + FixedBenefitAmount</MathVariable>
<MathVariable VARIABLENAME="TotalBenefitAmountCurrency" TYPE="FUNCTION" DATATYPE="CURRENCY">ToCurrency(TotalBenefitAmount,'USD')</MathVariable>
<MathVariable VARIABLENAME="FixedBenefitFundGUID" TYPE="SQL" DATATYPE="TEXT">
SELECT AsFund.FundGUID FROM AsPlanFund 
JOIN AsFund ON AsFund.FundGUID = AsPlanFund.FundGUID 
AND AsFund.TypeCode = '03' AND AsFund.FundName = 'Dynamic Fixed' 
WHERE PlanGUID = '[Policy:PlanGUID]'</MathVariable>
<MathVariable VARIABLENAME="MergeAllocations" TYPE="SEGMENTFIELD" DATATYPE="TEXT">MergeAllocations</MathVariable>
<MathVariable VARIABLENAME="MergePercent" TYPE="SEGMENTFIELD" DATATYPE="DECIMAL">MergePercent</MathVariable>
<MathVariable VARIABLENAME="AllocationTypeMV" TYPE="SEGMENTFIELD" DATATYPE="TEXT">AllocationType</MathVariable>
</MathVariables>
</Input>
<Output>
<Mappings>
<Mapping OUTPUTNAME="SegmentAmount" TYPE="FIELD">TotalBenefitAmountCurrency</Mapping>
</Mappings>
</Output>
<BenefitSplit>
<Allocations TYPECODE="AllocationTypeMV" LEVEL="Policy">
<MergeAllocations MERGE="MergeAllocations">
<AddAllocations TYPECODE="01" LEVEL="Plan" PERCENT="MergePercent">
<FinalAllocations TYPECODE="05"/>
</AddAllocations>
</MergeAllocations>
</Allocations>
<Relation>
<Criteria NAME="BandVariable" DATATYPE="TEXT">PolicyBandVariable</Criteria>
<Criteria NAME="InvestmentRate" DATATYPE="TEXT">BenefitSplitBand</Criteria>
<FixedBenefitFund>FixedBenefitFundGUID</FixedBenefitFund>
</Relation>
<EffectiveDate>UnitValueDate</EffectiveDate>
<CreateDeferredSplit>DeferredSplit</CreateDeferredSplit>
<VariableBenefit>VariableBenefitAmount</VariableBenefit>
<FixedBenefit>FixedBenefitAmount</FixedBenefit>
</BenefitSplit>
</Calculate>

XML Schema

<Calculate>
<Input>
<MathVariables />
</Input>
<Output>
<Mappings />
</Output>
<BenefitSplit>
<Allocations TYPECODE="[CodeValue]" LEVEL="[Policy, Plan]">
<MergeAllocations MERGE="">
<AddAllocations TYPECODE="[CodeValue]" LEVEL="[Policy, Plan]" PERCENT="">
<FinalAllocations TYPECODE="[CodeValue]"/>
</AddAllocations>
</MergeAllocations>
</Allocations>
<Relation>
<Criteria NAME="" DATATYPE="" />
<FixedBenefitFund />
</Relation>
<EffectiveDate />
<CreateDeferredSplit />
<VariableBenefit />
<FixedBenefit />
</BenefitSplit>
<GeneratePendingRequirements>[Yes|No]</GeneratePendingRequirements>
</Calculate>

 

 

 

 

Oracle Insurance Logo Copyright © 2017, Oracle and/or its affiliates. All rights reserved. About Oracle Insurance | Contact Us