Skip to content

Establish claim context and load a claim

This operation is the entry point every claim-oriented manager uses to bind to a claim: it validates the supplied key, replaces the immutable context object, and runs the fixed retrieve/security/screen-data pipeline.

Field Value
Operation ID OP-CLM-1
Trigger A UI screen or derived manager calls SetClaimContext or SetWorkerContext
Inputs Claim number, claim id, or worker id
Outputs Populated ClaimData, an access classification, and a user Message
Primary components ClaimAppManager.SetClaimContext, ClaimAppManager.SetWorkerContext, ClaimAppManager.ChangeContext
Entry point SAIF.Application.Claim/ClaimAppManager.vb

Steps

  1. Validate the supplied key: a claim number must be non-blank after trim; a claim id or worker id must be greater than zero (BR-CLM-001).
  2. On failure: clear m_ClaimData, call MarkContextNotSet(), set Message = ClaimAppConstants.PLEASEENTERCLAIM, and return without any retrieval. SetWorkerContext returns silently on an invalid worker id without setting a message.
  3. Replace the context object: construct a new ClaimContext (by claim number, claim id, or worker id), which sets ContextSet = True (BR-CLM-002).
  4. ChangeContext() runs the fixed pipeline: OnContextChanged() → OnCheckSecurity() → OnRetrieve() (BR-CLM-003).
  5. OnContextChanged() calls GetClaimData(): when Context.ContextSet, retrieve the claim by claim id if ClaimID > 0, otherwise by claim number; then MarkContextSet().
  6. Delegated logic: retrieval of the claim row is implemented in clsClaimData.GetData(DPI, key) (SAIF.BOF.Business.View.Claim); SQL and tables were not traced in this pass.**

    Origin: The claim row retrieval is implemented in SAIF.BOF.Business.View.Claim (clsClaimData) and executed on behalf of this operation; its SQL was not traced in this analysis pass.

  7. Evaluate the retrieval outcome: set Message = ClaimAppConstants.CLAIMNOTFOUND and MarkContextNotSet(); then, if m_ClaimData.IsValid, clear the message and MarkContextSet() (BR-CLM-004).
  8. If the context is worker-only (WorkerID set, ClaimID = 0, blank claim number): step 4 runs with an empty claim number, so ClaimData is not expected to be valid.*
  9. OnCheckSecurity() runs — see Evaluate claim access.
  10. OnRetrieve() — abstract in this library; the derived manager loads its screen-specific data. Not traced here.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Set*Context called]) --> Valid{Key valid?}
    Valid -->|No| Blocked(["Message: enter valid claim<br>number, no retrieval"])
    Valid -->|Yes| NewCtx[Construct new ClaimContext]
    NewCtx --> Pipeline["ChangeContext:<br>OnContextChanged"]
    Pipeline --> LoadClaim["GetClaimData via<br>clsClaimData"]
    LoadClaim --> Found{ClaimData.IsValid?}
    Found -->|No| NotFound(["Message: claim not found,<br>MarkContextNotSet"])
    Found -->|Yes| SetOk[MarkContextSet]
    SetOk --> CheckSec[OnCheckSecurity]
    CheckSec --> OnRetrieve["OnRetrieve: derived screen<br>load"]

Failure and edge-case behavior

  • An invalid key short-circuits at step 1; no exception is thrown for a missing claim.
  • If ClaimData is Nothing (context never set), OnCheckSecurity will dereference it — reachability in production is unknown.**

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • SAIF.Application.Claim/ClaimAppManager.vb
  • SAIF.Application.Claim/ClaimContext.vb
  • SAIF.Application.Claim/ClaimAppConstants.vb