Skip to content

Process third-party retention

This operation is the entire body of ThirdPartyRetentionProcessor.Execute. It retrieves the retention records due for the processing date, splits them into batches, sends each batch to OnBase, and marks the batch's records as processed in the Imaging API.

Attribute Value
Operation ID OP-OB3P-001
Lifecycle stage Execute
Owner ThirdPartyRetentionProcessor.Execute
Inputs Month, Day, Year (arguments); processob3pretention.processbatchsize
Outputs Console log lines; exit code 0 or 5
Business rules BR-OB3P-001, BR-OB3P-002, BR-OB3P-003, BR-OB3P-004, BR-OB3P-005, BR-OB3P-006, BR-OB3P-007, BR-OB3P-008

Steps

  1. Write Processing Third Party retention document deletion. to the log.
  2. Call the Imaging API GET toProcess endpoint with the month, day, and year arguments, and log one line per claim: SAIF Claim Num: <n> - Close Date: <d>. See BR-OB3P-001 and BR-OB3P-003.
  3. Imaging API exceptions (SAIF.API.Exceptions.*) are caught by step 8 and end the run with exit code 5.
  4. An unparseable response body is treated as an empty result by the HTTP client, which leads to step 3.*
  5. If no claims were returned, write No claims eligible for retention policy deletion. and finish with exit code 0. See BR-OB3P-006.
  6. Read processob3pretention.processbatchsize from the Environment API. A positive integer is used; an empty, non-integer, or non-positive value yields 100. See BR-OB3P-002.
  7. A missing key throws ApplicationException (exit code 5).
  8. Write Processing n claims in b batch(es) of up to size. and split the claims into consecutive batches.
  9. For each batch, call OnBaseService.ProcessRetention, which invokes the SOAP ArchiveDocument operation with a placeholder text document keyed by the batch's claim numbers, then log Claims sent to OnBase for Retention Processing. OnBase Document ID: <id>. See BR-OB3P-004 and the OBRetentionService client documentation.
  10. FaultException, CommunicationException, or TimeoutException* from OnBase is caught by step 8 (exit code 5).
  11. Call the Imaging API PUT processed/mark endpoint with the batch's retention ids and the fixed audit user, then log THRDPARTY_RETENTION records marked as processed. ID List: followed by the ids. See BR-OB3P-005 and BR-OB3P-008. Repeat steps 6 and 7 for the next batch.
  12. A failure here leaves the batch archived in OnBase but not marked, so the next run may resubmit it.*
  13. On any exception raised from step 2 onward, write Error: <message> to stderr and rethrow; remaining batches are not attempted and the run exits with code 5. See BR-OB3P-007.
  14. Step 1's log write executes before the try block; if it throws, the exception is not caught here and no Error: line is written.*

Process flow

The diagram shows this operation's own steps, including the empty-result exit and the failure exit.

flowchart TD
    S["Log start message"] --> G["GET toProcess for month/day/year"]
    G --> Q{"Any claims?"}
    Q -- "No" --> N["Log no claims eligible"]
    N --> Z["Exit code 0"]
    Q -- "Yes" --> B["Read batch size (default 100)"]
    B --> P["Split claims into batches"]
    P --> L{"Next batch?"}
    L -- "No" --> Z
    L -- "Yes" --> O["OnBase ArchiveDocument"]
    O --> M["PUT processed/mark"]
    M --> L
    G -- "Exception" --> E["Write Error to stderr and rethrow"]
    B -- "Exception" --> E
    O -- "Exception" --> E
    M -- "Exception" --> E
    E --> X["Exit code 5"]

Logging

Output goes through IConsoleLogService only: Write for progress (stdout) and WriteError for the Error: line (stderr). Claim numbers, close dates, and retention ids are written to the log, so captured output contains claim data.

Error handling

Execute wraps the workflow in a single try/catch (Exception) that writes Error: <message> and rethrows with throw ex;, resetting the stack trace. The framework runner then reports the exception again and exits with code 5. There is no retry in the application; the Imaging HTTP client retries transient statuses internally.† No transaction spans the OnBase and Imaging calls.

Note: Statements marked with † are derived from dependency library documentation via the Legends CLI. Statements marked with * were inferred from code structure or contextual evidence.

Sources

  • ProcessOB3PRetention/ThirdPartyRetentionProcessor.cs
  • ProcessOB3PRetention/Services/ImagingApiClient.cs
  • ProcessOB3PRetention/Services/OnBaseService.cs
  • ProcessOB3PRetention/ArgContainer.cs
  • ProcessOB3PRetention/Contracts/ThirdPartyRetention.cs