OP-003: Sync a keyword batch with OnBase¶
For the ordered unprocessed record array, this operation constructs one OnBaseKeywordSyncClient per batch, reads the document-counting flag, evaluates and sends each record's updates, then marks every record processed — even records that were skipped.
| Field | Value |
|---|---|
| Operation ID | OP-003 |
| Trigger | Step 7 of OP-001, via OnBaseKeywordSyncRunner.SyncDataWithOnBase |
| Lifecycle stage | Execute |
| Owning component | KeywordUpdater.Update(ImageKeywordSync[] keywordBatch, bool runAsync) |
| Inputs | The ordered unprocessed record array, the async flag |
| Outputs | OnBase keyword updates sent; every record marked processed in the Imaging API |
| Failure exit code | 5 — propagates from OnBaseKeywordSyncRunner.Execute's catch block |
Steps¶
- Construct
OnBaseKeywordSyncClient(one per batch): readOnBaseKeywordUpdateServiceUrland createHylandOutBoundContractClient("BasicHttpBinding_HylandOutBoundContract", url) - On failure: a missing setting or bad endpoint throws an exception → exit code
5 - Read
OnBaseKeywordSync.getdocumentcountandConvert.ToBooleanit (BR-OBKS-003) - On failure: an unconvertible value throws
FormatException→ exit code5 - For each record, evaluate OP-004 and log the record header block (BR-OBKS-004, BR-OBKS-005, BR-OBKS-006, BR-OBKS-009)
- When
PerformUpdateis true, for eachKeywordUpdatein the record: skip with"No document to update"when document counting is on andDocumentCount == 0; otherwise delegate to OP-005 (BR-OBKS-007) - Raise
OnBaseKeywordUpdateSetCompletefor the record — unconditionally, including when no update was sent (BR-OBKS-010) - On failure: a handler failure aborts the batch
- Handler
Updater_OnBaseKeywordUpdateSetCompletecallsPOST ImageKeywordSyncs/MarkProcessed?id={Keyword.Id}(BR-OBKS-010) - On failure: propagates → exit code
5;MarkAsProcessedExceptionexists but is never constructed or thrown - Log a blank line between records
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
A["Construct OnBaseKeywordSyncClient"] --> B["Read getdocumentcount flag"]
B --> C["For each record:<br>OP-004 decide send/skip"]
C --> D{"Send decision?"}
D -->|Send| E["For each KeywordUpdate:<br>OP-005 send to OnBase"]
D -->|Skip| F["Log skip reason"]
E --> G["Raise OnBaseKeywordUpdateSetComplete<br>unconditionally"]
F --> G
G --> H["Mark record processed<br>in Imaging API"]
H --> I{"More records?"}
I -->|Yes| C
I -->|No| J["Batch complete"]
A -.->|Missing setting| ERR["Exit code 5"]
B -.->|FormatException| ERR
G -.->|Handler failure| ERR
H -.->|Exception| ERR
Logging¶
| Log id | Written content |
|---|---|
Not application-assigned (fans out to all registered file0–file4 writers) |
Per-record block: image_keyword_sync ID, trigger type, doc type group, keyword, prior value, new value, and either the counts to update or the reason nothing will be sent; a blank line between records |
Error handling¶
- A failure constructing
OnBaseKeywordSyncClient, convertinggetdocumentcount, or in theOnBaseKeywordUpdateSetCompletehandler propagates toOnBaseKeywordSyncRunner.Execute's catch block, which logs and rethrows → exit code5. - There is no per-record error isolation: one failed record aborts the remaining batch*.
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
OnBaseKeywordSync/Services/KeywordUpdater.csOnBaseKeywordSync/Services/OnBaseKeywordSyncClient.csOnBaseKeywordSync/OnBaseKeywordSyncRunner.csOnBaseKeywordSync/Services/ImagingApiClient.csOnBaseKeywordSync/Exceptions/MarkAsProcessedException.cs