OP-001: Run the OnBase keyword sync¶
This is the entire business operation of the application. It logs the run mode, clears invalid person keyword syncs, retrieves and orders the unprocessed batch, delegates the sync to OnBase, and rethrows any exception so the framework can map it to an exit code.
| Field | Value |
|---|---|
| Operation ID | OP-001 |
| Trigger | ConsoleBase.Run() after Initialize() returns and Environment.ExitCode is set to 0† |
| Lifecycle stage | Execute |
| Owning component | OnBaseKeywordSyncRunner.Execute |
| Inputs | None from the command line; all inputs are environment settings and Imaging API data |
| Outputs | OnBase keyword updates applied; Imaging API records marked processed; narrated console/log output |
| Failure exit code | 5 — any unhandled exception rethrown from Execute() |
Steps¶
- Log
"OnBase Keyword Sync execution started." - Read
OnBaseKeywordSync.onbaseasyncasbooland log the resulting mode (BR-OBKS-001) - On failure: a
boolconversion failure throws an exception → exit code5 - Construct
ImagingApiClient: readimagingapiurl, appendv1/Integration, readonbasekeywordsync.imagingClientTimeoutSeconds, and build aJsonHttpClientwithClientInfo { ApplicationId = "OnBaseKeywordSync", MachineName = <machine, upper>, UserId = <Windows user, upper> }and a timeout in milliseconds - On failure: a missing/invalid setting throws an exception → exit code
5 - Delegate to OP-002 (clear invalid person keyword syncs) (BR-OBKS-002)
- On failure: propagates → exit code
5 GET ImageKeywordSyncs?getDocumentCount={OnBaseKeywordSync.getdocumentcount}, order the result byIdascending (BR-OBKS-003)- On failure: propagates → exit code
5 - Log the record count and the sum of
TotalDocumentUpdates - On failure:
KeywordUpdatesnull on any record throwsNullReferenceException→ exit code5* - Delegate to OP-003 (sync the batch with OnBase) (BR-OBKS-004, BR-OBKS-005, BR-OBKS-006, BR-OBKS-007, BR-OBKS-008, BR-OBKS-009)
- On failure: propagates → exit code
5 - On any exception:
LogErrorthe message,LogExceptionthe exception, rethrow - The framework maps the rethrown exception to exit code
5†
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
A["Log execution started"] --> B["Read onbaseasync<br>and log the mode"]
B --> C["Construct ImagingApiClient"]
C --> D["OP-002: Clear invalid<br>person keyword syncs"]
D --> E["Retrieve unprocessed<br>keyword syncs, order by Id"]
E --> F["Log record count<br>and total document updates"]
F --> G["OP-003: Sync a keyword<br>batch with OnBase"]
G --> H["Complete"]
B -.->|Conversion failure| ERR["Exit code 5"]
C -.->|Missing setting| ERR
D -.->|Exception| ERR
E -.->|Exception| ERR
F -.->|NullReferenceException| ERR
G -.->|Exception| ERR
Logging¶
| Log id | Written content |
|---|---|
Not application-assigned (fans out to all registered file0–file4 writers) |
"OnBase Keyword Sync execution started.", "Updates will be sent to OnBase {asynchronously\|synchronously}", "Found {n} unprocessed image_keyword_sync records with a total of {m} total docs to update." |
Error handling¶
- Any exception raised during this operation is logged (
WriteError+LogException) and rethrown;ProgramRunnerBasemaps the rethrown exception to exit code5, since noSaifConsoleExceptionsubclass is ever thrown by this application. - There is no per-record error isolation: one failed record aborts the remaining batch, and already-processed records are not rolled back*.
Related documentation¶
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¶
OnBaseKeywordSync/OnBaseKeywordSyncRunner.csOnBaseKeywordSync/Services/ImagingApiClient.cs