Generate claim tasks¶
This operation creates a clsClaimTaskGenerator bound either to the claim currently in context or to multiple claims, and optionally persists whatever tasks the generator produces. It is a helper used by concrete ClaimAppManager subclasses rather than something triggered directly by an external caller.
| Field | Value |
|---|---|
| Operation ID | OP-AC-05 |
| Trigger | Subclass code calls NewTaskGenerator(inMultiClaim) and later SaveTasks() |
| Inputs | inMultiClaim flag; the active ClaimData (for single-claim mode); the data portal (DPI) |
| Outputs | Populated clsClaimTaskGenerator (Tasks); Boolean save result |
| Primary components | ClaimAppManager.NewTaskGenerator, ClaimAppManager.SaveTasks, clsClaimTaskGenerator |
| Entry point | Application\SAIF.Application.Claim\ClaimAppManager.vb |
Steps¶
NewTaskGenerator(Optional inMultiClaim As Boolean = False)branches oninMultiClaim:- If true: assigns
m_Tasks = New clsClaimTaskGenerator(DPI), a generator that is not bound to the claim currently in context and is intended to create tasks across multiple claims. - If false (default): assigns
m_Tasks = New clsClaimTaskGenerator(DPI, ClaimData), a generator bound to the single claim in context. -
Sub-step:
clsClaimTaskGenerator's constructor and generation logic are implemented inSAIF.Business.Tasks.Claim.Origin: Batch and single-claim task generation is implemented by
clsClaimTaskGeneratorinSAIF.Business.Tasks.Claim. That library is documented in the previous format, so no per-operation page exists; see Generate batch claim tasks in theSAIF.Business.Tasks.Claimdocumentation set. 2.SaveTasks()checksTasks.Count > 0. - If tasks exist: callsTasks.Save(), then returnsTasks.ErrorCount = 0as the save outcome. - Sub-step:Tasks.Save()persists the generated task rows and accumulates any validation errors on the collection.Origin: Task persistence follows the inherited entity save lifecycle documented for
clsClaimTaskGenerator's base type inSAIF.Business.Tasks.Claim(fromclsBusinessBase,saif-framework-core). That library is documented in the previous format, so no per-operation page exists; see Save entity lifecycle (inherited) in theSAIF.Business.Tasks.Claimdocumentation set. - If no tasks exist (Tasks.Count = 0):SaveTasks()returnsTruewithout callingSave()— an empty task set is treated as a successful no-op.
Process flow¶
The following diagram visualizes generator creation and the conditional save.
flowchart TD
Start([Subclass requests task generation]) --> Mode{inMultiClaim?}
Mode -->|True| Multi[New clsClaimTaskGenerator DPI<br>multi-claim mode]
Mode -->|False| Single[New clsClaimTaskGenerator DPI, ClaimData<br>single-claim mode]
Multi --> Ready[Tasks populated on manager]
Single --> Ready
Ready --> SaveCall{SaveTasks called?}
SaveCall -->|No| Deferred([Tasks remain unsaved])
SaveCall -->|Yes| Count{Tasks.Count > 0?}
Count -->|No| NoOp([Return True; nothing saved])
Count -->|Yes| DoSave[Tasks.Save]
DoSave --> ErrCheck{Tasks.ErrorCount = 0?}
ErrCheck -->|Yes| Success([Return True])
ErrCheck -->|No| Failure([Return False])
Failure and edge-case behavior¶
SaveTasks()treats an empty task collection as success (True) rather than as a no-op failure or a distinguishable "nothing to do" result — callers cannot tell from the return value alone whether tasks were actually saved.*SaveTasks()'s success determination depends entirely onTasks.ErrorCount, which is populated byclsClaimTaskGenerator.Save()inSAIF.Business.Tasks.Claim; any validation or persistence failures inside that call surface only through the error count, not through a thrown exception at this layer.*- Calling
NewTaskGenerator(True)(multi-claim mode) without a validDPIwould leave the generator unable to resolve claims to attach tasks to, since no singleClaimDatais bound in that mode.*
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¶
Application\SAIF.Application.Claim\ClaimAppManager.vb