Skip to content

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

  1. Construct OnBaseKeywordSyncClient (one per batch): read OnBaseKeywordUpdateServiceUrl and create HylandOutBoundContractClient("BasicHttpBinding_HylandOutBoundContract", url)
  2. On failure: a missing setting or bad endpoint throws an exception → exit code 5
  3. Read OnBaseKeywordSync.getdocumentcount and Convert.ToBoolean it (BR-OBKS-003)
  4. On failure: an unconvertible value throws FormatException → exit code 5
  5. For each record, evaluate OP-004 and log the record header block (BR-OBKS-004, BR-OBKS-005, BR-OBKS-006, BR-OBKS-009)
  6. When PerformUpdate is true, for each KeywordUpdate in the record: skip with "No document to update" when document counting is on and DocumentCount == 0; otherwise delegate to OP-005 (BR-OBKS-007)
  7. Raise OnBaseKeywordUpdateSetComplete for the record — unconditionally, including when no update was sent (BR-OBKS-010)
  8. On failure: a handler failure aborts the batch
  9. Handler Updater_OnBaseKeywordUpdateSetComplete calls POST ImageKeywordSyncs/MarkProcessed?id={Keyword.Id} (BR-OBKS-010)
  10. On failure: propagates → exit code 5; MarkAsProcessedException exists but is never constructed or thrown
  11. 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, converting getdocumentcount, or in the OnBaseKeywordUpdateSetComplete handler propagates to OnBaseKeywordSyncRunner.Execute's catch block, which logs and rethrows → exit code 5.
  • There is no per-record error isolation: one failed record aborts the remaining batch*.

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.cs
  • OnBaseKeywordSync/Services/OnBaseKeywordSyncClient.cs
  • OnBaseKeywordSync/OnBaseKeywordSyncRunner.cs
  • OnBaseKeywordSync/Services/ImagingApiClient.cs
  • OnBaseKeywordSync/Exceptions/MarkAsProcessedException.cs