Skip to content

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

  1. Caller invokes PolicyAssociationList.GetPolicyAssociationList(inDPI, inPolicyNumber[, IncludeSourcePolicy, inAsOfDate]).
  2. If inAsOfDate is not supplied (Date.MinValue), the method binds ecDate to inDPI.DataSourceDate and cppDate to GetMaxPolicyEffectiveDate(inDPI, inPolicyNumber) — a separate scalar query against policy_period for max(policy_period_eff_date) (SQL-035). If an as-of date is supplied, both parameters use that date instead (BR-VP-024).
  3. The method executes the constant RetrieveSQL — a four-way UNION of ManualAffiliationSQL, PolicyRelationshipSQL, DiscountCombinationSQL, and ERCombinationSQL (SQL-034) — as CommandType.Text/RequestType.ResultSet, binding ecDate, cppDate, and PolicyNumber.
  4. Each result row is converted to a PolicyAssociation via ConvertAssociationType, which maps raw relationship-type strings ("WRAP", "OREGN", "LEASE", "SUBAC", the "M."-prefixed manual variants, "DiscountCombination", "ExperienceCombination") to the AssociationTypes enum, defaulting to NotSpecified for anything unrecognized.
  5. 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.*
  6. Separately, clsPolicyHeaderAssociationFactory.GetPolicyHeaderAssociations(inDPI, inPolicyNumber[, inTargetAssociationTypes]) retrieves the full set of configured association types via clsAssociationTypeFactory.GetAssociationTypes (SQL-005, table ASSOCIATION_TYPE_CODE), partitions them into groupable (non-None AssociationCategory) and non-groupable sets, and unions the results of GetPolicyHeaderAssociations called on each partition.
  7. For each association type, clsAssociationTypeCode.GetNonTypedAssociations executes a data-driven stored procedure whose name comes from ASSOCIATION_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).
  8. PreferredAssociationType, when set on the consuming clsPolicyData/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

  • ConvertAssociationType silently returns NotSpecified for 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_NAME is 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.**
  • GetMaxPolicyEffectiveDate returns the CLR default (Date.MinValue) if the policy has no periods, which is then used unchanged as cppDate in 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.

Sources

  • SAIF.Business.View.Policy/PolicyAssociations.vb
  • SAIF.Business.View.Policy/Associations/clsPolicyAssociationFactory.vb
  • SAIF.Business.View.Policy/Associations/clsAssociationTypeCode.vb