Retrieve policy associations¶
Builds the full list of policies associated with a given policy — manual affiliations, policy-relationship links, discount combinations, and experience-rating combinations — and separately supports a data-driven, per-association-type lookup path used for grouped/typed associations.
| Field | Value |
|---|---|
| Operation ID | op-04-retrieve-policy-associations |
| Trigger | Consumer reads Associations (backed by PolicyAssociationList.GetPolicyAssociationList), or calls the typed clsPolicyHeaderAssociationFactory.GetPolicyHeaderAssociations |
| Inputs | Policy number, optional IncludeSourcePolicy flag, optional as-of date |
| Outputs | IEnumerable(Of PolicyAssociation) / IEnumerable(Of IPolicyHeaderAssociation) |
| Primary components | PolicyAssociationList.GetPolicyAssociationList, clsPolicyHeaderAssociationFactory, clsAssociationTypeFactory, clsAssociationTypeCode.GetNonTypedAssociations |
| Entry point | SAIF.Business.View.Policy/PolicyAssociations.vb |
Steps¶
- Caller invokes
PolicyAssociationList.GetPolicyAssociationList(inDPI, inPolicyNumber[, IncludeSourcePolicy, inAsOfDate]). - If
inAsOfDateis not supplied (Date.MinValue), the method bindsecDatetoinDPI.DataSourceDateandcppDatetoGetMaxPolicyEffectiveDate(inDPI, inPolicyNumber)— a separate scalar query againstpolicy_periodformax(policy_period_eff_date)(SQL-035). If an as-of date is supplied, both parameters use that date instead (BR-VP-024). - The method executes the constant
RetrieveSQL— a four-wayUNIONofManualAffiliationSQL,PolicyRelationshipSQL,DiscountCombinationSQL, andERCombinationSQL(SQL-034) — asCommandType.Text/RequestType.ResultSet, bindingecDate,cppDate, andPolicyNumber. - Each result row is converted to a
PolicyAssociationviaConvertAssociationType, which maps raw relationship-type strings ("WRAP","OREGN","LEASE","SUBAC", the"M."-prefixed manual variants,"DiscountCombination","ExperienceCombination") to theAssociationTypesenum, defaulting toNotSpecifiedfor anything unrecognized. - By default (
IncludeSourcePolicy = False), the source policy itself is filtered out of the returned list (BR-VP-014);PeriodDateSQL-based lookups (SQL-003) supply supporting period dates used elsewhere in association classification.* - Separately,
clsPolicyHeaderAssociationFactory.GetPolicyHeaderAssociations(inDPI, inPolicyNumber[, inTargetAssociationTypes])retrieves the full set of configured association types viaclsAssociationTypeFactory.GetAssociationTypes(SQL-005, tableASSOCIATION_TYPE_CODE), partitions them into groupable (non-NoneAssociationCategory) and non-groupable sets, and unions the results ofGetPolicyHeaderAssociationscalled on each partition. - For each association type,
clsAssociationTypeCode.GetNonTypedAssociationsexecutes a data-driven stored procedure whose name comes fromASSOCIATION_TYPE_CODE.SOURCE_PROCEDURE_NAME(SQL-004) — the procedure to call is not known until the association-type row is read from the database (BR-VP-021). PreferredAssociationType, when set on the consumingclsPolicyData/clsAffiliatedPolicyCollection, overrides the type otherwise derived from the association source (BR-VP-015); association types flagged as secured are gated by security-group membership (BR-VP-020).
Process flow¶
flowchart TD
Start(["Consumer reads<br>Associations"]) --> A["Resolve ecDate/cppDate<br>(as-of date or defaults)"]
A --> B["Execute 4-way UNION query<br>(manual/relationship/discount/ER)"]
B --> C["ConvertAssociationType maps<br>raw strings to AssociationTypes"]
C --> D{IncludeSourcePolicy?}
D -->|No| E["Filter out source policy"]
D -->|Yes| F["Keep source policy"]
E --> End(["Return PolicyAssociation list"])
F --> End
Start2(["Caller invokes<br>GetPolicyHeaderAssociations"]) --> G["Load configured<br>ASSOCIATION_TYPE_CODE rows"]
G --> H["Partition groupable /<br>non-groupable types"]
H --> I["Per type: execute data-driven<br>SOURCE_PROCEDURE_NAME"]
I --> End2(["Return IPolicyHeaderAssociation list"])
Failure and edge-case behavior¶
ConvertAssociationTypesilently returnsNotSpecifiedfor any unrecognized relationship-type string rather than raising — a schema/data change upstream would surface as silently-miscategorized associations, not an error.*- Because
SOURCE_PROCEDURE_NAMEis read from data, a missing or invalid procedure name for a given association type is not detectable by inspecting this library's source; it fails only at execution time.** GetMaxPolicyEffectiveDatereturns the CLR default (Date.MinValue) if the policy has no periods, which is then used unchanged ascppDatein the union query.*
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.
Related documentation¶
Sources¶
SAIF.Business.View.Policy/PolicyAssociations.vbSAIF.Business.View.Policy/Associations/clsPolicyAssociationFactory.vbSAIF.Business.View.Policy/Associations/clsAssociationTypeCode.vb