Skip to content

Reconcile endorsement image sequence numbers with the Imaging API

Check that stored image sequence numbers still exist in Imaging and clear any stale values.

Field Value
Operation ID OP-008
Trigger Caller invokes ClearImageSequenceNumbersForDeletedImages after loading an endorsement collection.
Inputs The in-memory collection image sequence numbers and the ImagingApiUrl configuration setting.
Outputs Any endorsement whose image is missing has ImageSequenceNumber reset to 0.
Primary components clsEndorsementCollection.ClearImageSequenceNumbersForDeletedImages; clsEndorsementCollection.ImagingApiClient
Entry point Business\SAIF.Business.Policy.Correspondence\clsEndorsementCollection.vb

Steps

  1. Scan the collection for correspondence items that currently expose an image sequence number and copy those IDs into an ImageListQuery.
  2. If the list is empty, return immediately without creating an API request (BR-015).
  3. Resolve the shared ImagingClient from the cached ImagingApiClient property and call GetImages(DocTypeGroup.POLICY, imageListQuery) using the configured imaging endpoint.
  4. Compare the IDs returned by the Imaging API with the IDs held by the collection; any missing image ID causes the corresponding correspondence item to be reset to 0 (BR-016).
  5. Leave all image sequence numbers unchanged when the API confirms that the image still exists.

Process flow

The following diagram summarizes the control flow for this operation.

flowchart TD
    Start([Reconcile images]) --> Collect[Collect image ids] --> Empty{Any ids?} -->|No| Done([Return])
    Empty -->|Yes| Call[Call Imaging API] --> Compare[Compare returned ids] --> Clear[Reset missing ids to 0] --> Done

Failure and edge-case behavior

  • Validation and framework state errors surface through the BOF error collection unless the called dependency throws directly.
  • Database-dependent operations rely on the caller-supplied data portal context and Oracle connectivity.
  • Imaging reconciliation and stored-procedure wrappers defer cross-system behavior to their external collaborators.

Sources

  • Business\SAIF.Business.Policy.Correspondence\clsEndorsementCollection.vb