Skip to content

ClaimAppManager

ClaimAppManager is the architectural centerpiece of SAIF.Application.Claim: an abstract (MustInherit) application manager that concrete claim-screen application managers inherit from to orchestrate claim/worker context changes, per-claim security enforcement (BR-CLM-001 through BR-CLM-007), and the transaction lifecycle around subclass-implemented save logic. It never issues SQL directly; it establishes an Oracle data portal and delegates all reads/writes to externally-packaged business objects (clsClaimData, clsEmployeeData, clsClaimTaskGenerator).

Purpose

  • Own and mutate the current claim/worker context (ClaimContext) and re-derive claim data whenever that context changes.
  • Enforce the primary claim-access security gate (Security enforcement), combining ClaimSecurity's computed flags with MarkViewOnly/MarkNoAccess.
  • Establish the Oracle data portal for the claim domain and wrap subclass save logic in a transaction lifecycle with rollback-on-exception.
  • Resolve the imaging API base URL via configuration to construct the claim-image API client.

Context

  • Namespace: SAIF.Application.Claim
  • Assembly/package: SAIF.Application.Claim (embedded library, referenced via project reference by concrete claim-screen application managers)

Public members

Member Signature Purpose
New(inSecurityPrincipal) Public Sub New(inSecurityPrincipal As clsSecurityPrincipal) Constructs the manager for the given authenticated principal, establishing the base for subsequent context/security operations.
ApplicationTitle Public Property ApplicationTitle As String Display title for the concrete claim-screen application, used by presentation code outside this library*.
ClaimSecurity Public ReadOnly Property ClaimSecurity As ClaimSecurity Exposes the computed per-claim access flags for the current claim/user, consumed by Security enforcement and by external callers to gate exposure/health-issue/hostile-worker data.
ClaimImageApiClient Public ReadOnly Property ClaimImageApiClient As ImagingAPI.Client.ImagingClient Lazily constructs an imaging API client using the imagingapiurl configuration setting (see Configuration).
Context Protected ReadOnly Property Context As ClaimContext Holds the current claim/worker context set by SetClaimContext/SetWorkerContext.
DPI(inKey) Public Function DPI(inKey As String) As <DPI type> Exposes the Oracle data portal instance keyed by inKey, used by claim retrieval/save operations*.
Tasks Protected ReadOnly Property Tasks As <clsClaimTaskGenerator> Holds the claim task-generator collection used by Save task list.
ClaimData Public ReadOnly Property ClaimData As clsClaimData Holds the currently retrieved claim business object, re-derived on each context change.
EmployeeData Public ReadOnly Property EmployeeData As <clsEmployeeData> Holds retrieved employee/worker data associated with the current context*.
MailMessage Public Property MailMessage As String User-facing mail/notification message content, purpose beyond declaration unknown**.
ConfidentialAccessDeniedMessage Protected ReadOnly Property ConfidentialAccessDeniedMessage As String Message shown when BR-CLM-001 denies access to a conflict claim.
NewTaskGenerator(inMultiClaim) Protected Function NewTaskGenerator(inMultiClaim As Boolean) As <clsClaimTaskGenerator> Constructs a new task generator, optionally scoped to multiple claims*.
SaveTasks() Protected Overridable Function SaveTasks() As Boolean Persists the current task list; see Save task list.
SetWorkerContext(inWorkerID) Public Sub SetWorkerContext(inWorkerID As Decimal) Establishes context from a worker ID and triggers the context-change pipeline; see Set worker context.
SetClaimContext(inClaimNumber) Public Sub SetClaimContext(inClaimNumber As String) Establishes context from a claim number, enforcing BR-CLM-006; see Set claim context and retrieve.
SetClaimContext(inClaimID) Public Sub SetClaimContext(inClaimID As Decimal) Establishes context from a claim ID. Unlike the string overload, only calls MarkContextSet() and does not trigger ChangeContext()/OnCheckSecurity()/OnRetrieve() — a tech-debt asymmetry noted in Set claim context and retrieve**.
ChangeContext() Protected Overridable Sub ChangeContext() Runs OnContextChanged(), then (if context is set) OnCheckSecurity() and OnRetrieve(), tying context changes to security enforcement and retrieval.
GetClaimData() Protected Overridable Function GetClaimData() As clsClaimData Retrieves claim data via clsClaimData.GetData by claim ID or claim number, depending on which context value is set.
Retrieve() Public Overrides Sub Retrieve() Overrides the inherited retrieval lifecycle entry point (from AppManagerBase, SAIF.Application)*.
Write() Public Overrides Function Write() As Boolean Persists pending claim changes within a transaction; see Save (Write).
OnContextChanged() Protected Overridable Sub OnContextChanged() Sets the not-found message, retrieves claim data, and marks the context set when valid, enforcing BR-CLM-007.
OnCheckSecurity() Protected Overrides Sub OnCheckSecurity() Primary authorization enforcement point; see Security enforcement.
OnValidContext() Protected Overrides Function OnValidContext() As Boolean Checks ContextSet, SecurityRole <> NoAccess, and ClaimData.IsValid — a context-validity check rather than an entity-ownership check.
CheckForSecurityOverride() Protected Overridable Function CheckForSecurityOverride() As Boolean Delegates to ClaimServices.HasOverrideAcess, the sole bypass path for the BR-CLM-001 hard-denial gate; ClaimServices's owning library is unresolved**.
OnInitialize() Protected Overrides Sub OnInitialize() Inherited lifecycle initialization hook (behavior largely defined in AppManagerBase, SAIF.Application)*.
OnCreateDataLayer() Protected Overrides Sub OnCreateDataLayer() Establishes the Oracle data portal for the claim domain; see Establish data layer.
OnTransactionStart() Protected Overrides Sub OnTransactionStart() Begins an Oracle DPI transaction if one is not already pending, as part of Save (Write).
OnTransactionStop(inCommit) Protected Overrides Sub OnTransactionStop(inCommit As Boolean) Commits or rolls back the Oracle DPI transaction based on the write result, as part of Save (Write).

Behavioral notes

  • OnCheckSecurity() unconditionally calls MarkViewOnly() before any escalation, per BR-CLM-005.
  • On exception during OnWrite(), OnTransactionStop may be invoked twice due to explicit rollback plus the Finally block's call, per VB.NET Try/Catch/Finally semantics*.
  • SetClaimContext(inClaimID As Decimal) does not run the same context-change pipeline as the string overload — see Set claim context and retrieve for the tech-debt note**.

Constraints and usage notes

  • ClaimAppManager is MustInherit; it has no independent runtime behavior without a concrete claim-screen subclass supplying OnRetrieve()/OnWrite().
  • Concrete subclasses are not part of this library and are not traceable from this library's source**.

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