Coverage B task management¶
Coverage B tasks are a Task-source-system variant (TaskSourceSystem.CoverageB) with their own claim-binding, category-description lookup, and validation rules. clsCoverageBTask and clsCoverageBTaskCollection are documented as a single operation because both are driven by the same Coverage B rule set and business object family: the collection resolves the tasks and their claim/category context, and the task object enforces Coverage B–specific validation before saving through the inherited BOF pipeline.
| Field | Value |
|---|---|
| Operation ID | OP-TC-03 |
| Trigger | Caller calls clsCoverageBTaskCollection.GetTasks(dpi, criteria) to retrieve, or clsCoverageBTask.NewTask(dpi, claimId[, createUser]) to create, followed by property edits and Save()/SaveChild() |
| Inputs | IDataPortalInfo; CoverageBTaskCriteria (claim list, filter dates) for retrieval; ClaimID/ClaimNum, Text, TaskDate, MailID, CreateUser for create/save |
| Outputs | Populated clsCoverageBTaskCollection; saved clsCoverageBTask row; resolved WorkerName and category description; broken-rule collection on validation failure |
| Primary components | clsCoverageBTaskCollection.GetTasks, clsCoverageBTaskCollection.AddClaimNum, clsCoverageBTaskCollection.GetCategoryDescr, clsCoverageBTask.NewTask, clsCoverageBTask.PostFill, clsCoverageBTask.AddBusinessRules, clsCoverageBTask.OverrideRules, clsCoverageBTask.Save |
| Entry point | Business\SAIF.Business.Tasks.Claim\clsCoverageBTaskCollection.vb |
Steps¶
- Retrieve.
clsCoverageBTaskCollection.GetTasks(dpi, criteria)setscriteria.DataPortalInfo, callsAddTaskSourceSystem(TaskSourceSystem.CoverageB)to restrict the retrieve to Coverage B tasks, and callsdpi.DataAccessLayer.RetrieveObject(criteria).
Origin: The filtered collection query and row-materialization pipeline are implemented by
clsTaskCollectioninSAIF.Business.Tasks. That library is documented in the previous format, so no per-operation page exists; see Retrieve task collection in theSAIF.Business.Tasksdocumentation set. 2. Filter by claim number.CoverageBTaskCriteria.AddClaimNum(claimNum)creates a throwawayclsCoverageBTaskbound to claim ID0, sets itsClaimNum(which resolvesclsClaimDataand derivesClaimID), and adds the resolvedClaimIDtoClaimList— an alternative to filtering by claim ID directly. 3. Create.NewTask(dpi, claimId[, createUser])builds aCriteriawith the claim ID (and create user, if supplied) and callsdpi.DataAccessLayer.CreateObject(crit). The constructor setsTaskDateModifier = TaskDateModifierType.NextWorkDay. 4. BOFCreate()override. SetsClaimIDfrom the criteria and callsGetClaimData(), loadingclsClaimDatafor the claim if not already cached. 5.PostFill()unconditionally callsGetClaimData()— unlikeclsClaimTask, Coverage B tasks always resolve claim data regardless of whether the task is claim-bound at fill time. 6.ClaimNumproperty setter. Re-resolvesclsClaimDatafor the new claim number (treating a passed-inNothingas an empty string), setsClaimID, and runs theClaimNumrule check. 7.WorkerNameis read-only and returnsm_ClaimData.WorkerName.Last, or empty when no claim data is resolved yet. 8.CategoryDescrresolves the category description forCategoryCode: if the taskIsChild, it delegates to the parent collection'sGetCategoryDescr; otherwise it loads aclsTaskCategoryCodeCollectionfor the Coverage B source and looks up the code directly. 9. Validation (AddBusinessRules). Two rules are registered in addition to those inherited fromclsTask: -ValidClaimNum(BR-007) — skipped when deleted; fails whenClaimID = 0; fails with "Claim number is not a Coverage B Claim." when the resolved claim'sCoverageCode <> "B". -CommonBusinessRules.TextRequired(BR-008) — enforces non-empty task text.
> **Origin**: `CommonBusinessRules.TextRequired` is implemented in `SAIF.BOF.Business`; see [CommonBusinessRules](../../saif-business/api/SAIF.Business/commonbusinessrules.md) in the `SAIF.BOF.Business` documentation set.
-
Due-date override (
OverrideRules). For the inherited"TASK2"due-date rule, if the taskIsDirty, is notDeleted, andTaskDateis before today or after one year from today:OverrideRulesreplaces the rule's message with "Error: Due date must be between today and one year from today." and forces the result toFalse(BR-012).Origin: The base
"TASK2"rule and theOverrideRulesextension point are implemented byclsTaskinSAIF.Business.Tasks. That library is documented in the previous format, so no per-operation page exists; see Operations and processes in theSAIF.Business.Tasksdocumentation set. 11. Save.Save()andSaveChild()both callApplyEdit()then the corresponding base method, delegating 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. 12. Copy and complete.CopyTo(mailID)creates a fresh task bound to the same claim viaNewTask, copies fields with the inheritedCopyTask, and sets the new task'sMailID.MarkCompleted()always sets the delete flag and marks the task dirty (unlikeclsClaimTask, Coverage B tasks have no notepad-entry gate).
Process flow¶
The following diagram visualizes Coverage B task retrieval, creation, validation (including the due-date override), and save.
flowchart TD
Start([GetTasks or NewTask]) --> Which{Retrieve or create?}
Which -->|Retrieve| SetSource[AddTaskSourceSystem CoverageB]
SetSource --> RetrieveCall[RetrieveObject executes<br>inherited BOF collection query]
RetrieveCall --> DoneRetrieve([Return collection])
Which -->|Create| CreateTask[Create: set ClaimID,<br>GetClaimData]
CreateTask --> PostFillStep[PostFill: GetClaimData<br>always resolved]
PostFillStep --> Edit[Caller sets ClaimNum,<br>Text, TaskDate...]
Edit --> Validate{ValidClaimNum,<br>TextRequired}
Validate -->|Fails| Errors([Broken rules returned])
Validate -->|Passes| Override{TASK2 override:<br>due date within 1 year?}
Override -->|No| DateError([Due-date error added])
Override -->|Yes| Save[Save / SaveChild]
Save --> Persist[Inherited clsTask<br>insert/update/delete]
Persist --> DoneSave([Task persisted])
Failure and edge-case behavior¶
ValidClaimNumblocks the save both when the claim is unresolved (ClaimID = 0) and when the resolved claim is not a Coverage B claim, but a deleted task bypasses the check entirely.- The
OverrideRulesdue-date narrowing only applies to dirty, non-deleted tasks; it does not run for tasks that are already clean or marked for deletion. CategoryDescrdepends on the task's parent collection when the taskIsChild; a standalone task always issues its ownclsTaskCategoryCodeCollectionlookup.*AddClaimNumsilently does nothing when passed an empty claim number, rather than raising a validation error.
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\clsCoverageBTask.vbBusiness\SAIF.Business.Tasks.Claim\clsCoverageBTaskCollection.vb