Claim task lifecycle — create, enrich, validate, save¶
clsClaimTask is a single business object whose create, field-enrichment, validation, and save steps are all governed by the same class and rule set, so this page documents them as one lifecycle rather than as separate operations. A new claim task is either bound to a claim through the constructor factory or filled from a retrieved row; either path resolves supplemental claim data (worker name, policy name, work status, and confidentiality flags) so the task can be displayed and validated, then a caller-driven edit/save cycle enforces six claim-task rules before persisting through the inherited BOF save pipeline.
| Field | Value |
|---|---|
| Operation ID | OP-TC-02 |
| Trigger | Caller calls clsClaimTask.NewTask(dpi, claimId[, createUser]) to start a new task, or the retrieval pipeline calls Load/PostFill on an existing row; the caller then edits properties and calls Save() or SaveChild() |
| Inputs | ClaimID (or ClaimNum), MailID, Text, TaskDate, PriorityTask, CategoryCode, CreateUser |
| Outputs | Saved clsClaimTask row; populated ClaimNum, SAIFClaimNum, WorkerName, PolicyName, WorkStatus, and confidentiality flags (IsWorkerConflict, IsExposure, isHostileWrkr, isHealthIssue); broken-rule collection on validation failure |
| Primary components | clsClaimTask.NewTask, clsClaimTask.Create, clsClaimTask.PostFill, clsClaimTask.GetExtraFields, clsClaimTask.AddBusinessRules, clsClaimTask.Save, clsClaimTask.SaveChild, clsClaimTask.CopyTo, clsClaimTask.MarkCompleted |
| Entry point | Business\SAIF.Business.Tasks.Claim\clsClaimTask.vb |
Steps¶
- Create a new task.
NewTask(dpi, claimId[, createUser])builds aCriteriawith the claim ID and create user, callsdpi.DataAccessLayer.CreateObject(crit), and setsCategoryCodetoDEFAULTCATEGORY("CLMM"). Criteria.extraSQLalways returns the fixed stored-procedure name"PK82284_CLAIM_TASK.SELECT_ADDITIONAL_FIELDS"used in step 3.- BOF
Create()override.Create()calls the base creation path, setsClaimIDfrom the criteria, and callsGetClaimData(), which loads aclsClaimDatafor the claim if one is not already cached.
Origin:
clsClaimData.GetDatais implemented inSAIF.Business.View.Claim. That library is documented in the previous format, so no per-operation page exists; see Operations and processes in theSAIF.Business.View.Claimdocumentation set. 3.PostFill()branches on whether the task is bound to a claim. - IfMyCriteria.ClaimID > 0(the normal create/retrieve path): callGetClaimData()and setTaskContext.Key.Valueto the resolvedClaimNum. - Otherwise (a task instantiated without a claim context): callGetExtraFields()and resetmailidNeedsValidationtoFalse, thenMarkClean(). 4.GetExtraFields()executes the package call (SQL-001). It builds a stored-procedure request againstMyCriteria.extraSQL, passingClaimIdas input andClaimNum,SAIFClaimNum,WorkerName,PolicyName,WorkStatus,conflictFlag,exposureCode,healthIssue, andhostileWrkras input/output parameters (BR-010). - On return, it copies the output parameters back into the matching member variables and derivesm_isWorkerConflict(conflictFlag = "Y"),m_isExposure(exposureCode <> "0"),m_isHealthIssue(healthIssue = "Y"), andm_isHostileWrkr(hostileWrkr <> " "). 5. Caller edits the task. SettingClaimNumre-resolvesclsClaimData, setsClaimID, updatesTaskContext.Key.Value, and runs theClaimNumrule check. SettingMailIDmarks the task dirty, flagsMailIdNeedsValidation = True, and runs theTaskUserrule check. SettingTextcleans the string (clsCharacterAnalyzer.GetCleanString), marks dirty, and runs theTextrule check. 6. Validation (AddBusinessRules). Six rules are registered, in addition to the rules inherited fromclsTask: -ValidClaimNum(BR-001) — fails whenClaimID = 0. -FutureDateWarning(BR-002) — skipped when deleted or not dirty; fails whenTaskDateis more than two years in the future (unless it is the sentinelDate.MaxValue). -ValidText(BR-004) — skipped whenPriorityCode = MailID(an informational task); fails whenTextis blank. -ValidTextLength(BR-005) — fails whenTextexceeds 4000 characters. -ValidMailId(BR-003) — skipped when validation is not needed, the task is not dirty or is deleted, the task is informational, the mail ID matches the current data-portal user, or the user ID starts with"TEST"and the mail ID matches the suffix after"TEST". - If the user does not haveCTTaskUpdateresource access: checkRTWExternalUpdateexternal access instead. - If that also fails: add an error naming the mail ID and deny access. - If it passes: register the additionalRTWAssignedClaimrule (BR-006) so the claim-assignment check in step 7 also runs. -RTWAssignedClaim(BR-006) — only registered conditionally in step 6'sValidMailIdbranch; skipped when validation is not needed; fails whenclsClaimSecurity.RTWAssignedToClaimreports the mail ID's RTW resource is not assigned to the claim.
> **Origin**: `clsClaimSecurity.RTWAssignedToClaim` is implemented in `SAIF.BOF.Business`; see [clsClaimSecurity](../../saif-business/api/SAIF.Business/clsclaimsecurity.md) in the `SAIF.BOF.Business` documentation set.
- Save.
Save()callsApplyEdit()then the baseSave;SaveChild()callsApplyEdit()then the baseSaveChild. Both delegate persistence to the inherited BOF task save pipeline.
Origin: Insert, update, and soft-delete persistence for the underlying
TASKrow are implemented byclsTaskinSAIF.Business.Tasks. That library is documented in the previous format, so no per-operation page exists; see Insert task, Update task, and Soft-delete task in theSAIF.Business.Tasksdocumentation set. 8. Copy a task to a new assignee.CopyTo(mailID)creates a fresh task bound to the same claim viaNewTask, copies the source task's fields with the inheritedCopyTask, and sets the new task'sMailIDto the passed-in value. 9. Mark completed.MarkCompleted()setsCompleted = Trueonly ifRequiresNotePadEntryis true (the notepad flag is"Y"), then always sets the delete flag and marks the task dirty so the completed/deleted task is persisted on the next save.
Process flow¶
The following diagram visualizes the create, enrich, validate, and save lifecycle.
flowchart TD
Start([NewTask claimId, createUser]) --> Create[Create: set ClaimID,<br>GetClaimData]
Create --> Bound{ClaimID > 0<br>in PostFill?}
Bound -->|Yes| Resolve[GetClaimData,<br>set TaskContext.Key]
Bound -->|No| Extra[GetExtraFields:<br>package enrichment call]
Resolve --> Edit[Caller sets ClaimNum,<br>MailID, Text, TaskDate...]
Extra --> Edit
Edit --> Validate{AddBusinessRules:<br>six claim-task rules}
Validate -->|Fails| Errors([Broken rules returned])
Validate -->|Passes| Save[Save / SaveChild:<br>ApplyEdit then base Save]
Save --> Persist[Inherited clsTask<br>insert/update/delete]
Persist --> Done([Task persisted])
Failure and edge-case behavior¶
- A task with
ClaimID = 0fails BR-001 and cannot be saved. FutureDateWarning,ValidText, andValidMailIdall short-circuit to a pass under specific conditions (not dirty, deleted, sentinel max date, informational task) rather than always evaluating the underlying check, so an already-clean or informational task can carry an otherwise-invalid value without blocking the save.*ValidMailIdcan add theRTWAssignedClaimrule dynamically at validation time; if that rule is never registered (the user has ordinaryCTTaskUpdateaccess), the RTW-assignment check never runs for that save.- If neither
CTTaskUpdatenorRTWExternalUpdateaccess is present, the save is blocked with an explicit "does not have access to RTWExternalUpdate" message. GetExtraFields()runs only when the task has no bound claim ID at fill time; a claim-bound task instead relies onclsClaimDatafor the same information, so the two enrichment paths are mutually exclusive per task instance.
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¶
Business\SAIF.Business.Tasks.Claim\clsClaimTask.vb