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¶
- Write
Processing Third Party retention document deletion.to the log. - Call the Imaging API
GETtoProcessendpoint 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. - Imaging API exceptions (
SAIF.API.Exceptions.*) are caught by step 8 and end the run with exit code 5. - An unparseable response body is treated as an empty result by the HTTP client, which leads to step 3.*
- If no claims were returned, write
No claims eligible for retention policy deletion.and finish with exit code 0. See BR-OB3P-006. - Read
processob3pretention.processbatchsizefrom the Environment API. A positive integer is used; an empty, non-integer, or non-positive value yields 100. See BR-OB3P-002. - A missing key throws
ApplicationException(exit code 5). - Write
Processing n claims in b batch(es) of up to size.and split the claims into consecutive batches. - For each batch, call
OnBaseService.ProcessRetention, which invokes the SOAPArchiveDocumentoperation with a placeholder text document keyed by the batch's claim numbers, then logClaims sent to OnBase for Retention Processing. OnBase Document ID: <id>. See BR-OB3P-004 and the OBRetentionService client documentation. FaultException,CommunicationException, orTimeoutException* from OnBase is caught by step 8 (exit code 5).- Call the Imaging API
PUTprocessed/markendpoint with the batch's retention ids and the fixed audit user, then logTHRDPARTY_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. - A failure here leaves the batch archived in OnBase but not marked, so the next run may resubmit it.*
- 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. - Step 1's log write executes before the
tryblock; if it throws, the exception is not caught here and noError: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.csProcessOB3PRetention/Services/ImagingApiClient.csProcessOB3PRetention/Services/OnBaseService.csProcessOB3PRetention/ArgContainer.csProcessOB3PRetention/Contracts/ThirdPartyRetention.cs