Generate batch claim tasks¶
clsClaimTaskGenerator is a clsBusinessBase orchestration object — not a task itself — that wraps an internal clsClaimTaskCollection and provides a family of AddTask overloads for building one or more claim tasks with sensible defaults (next working day, medium priority, "manage claim" category, assignee inferred from the responsible adjuster). It can be scoped to a single claim at construction or left unscoped so each AddTask call supplies its own claim ID, and it validates every task it builds with a level-three claim-ID rule before a single Save() persists the whole batch through the wrapped collection.
| Field | Value |
|---|---|
| Operation ID | OP-TC-04 |
| Trigger | Caller constructs New clsClaimTaskGenerator(dpi[, claimId or claimNumber or claimData][, createUser]), calls one or more AddTask overloads, then calls Save() |
| Inputs | IDataPortalInfo; optional default claim (by ClaimID, claim number, or clsClaimData) and create user; per-task text, optional assignee mail ID, due date or offset, TaskPriority, clsClaimTask.ClaimCategories, and notepad-required flag |
| Outputs | Populated Tasks (clsClaimTaskCollection); IsValid, IsDirty, ErrorMessages, and ErrorCount mirrored from the inner collection; Save() boolean result; ToXML()/GetReportXML() projections of the batch |
| Primary components | clsClaimTaskGenerator.New, clsClaimTaskGenerator.AddTask (nine overloads), clsClaimTaskGenerator.NewTask (private), clsClaimTaskGenerator.IsValidClaimID, clsClaimTaskGenerator.Save, clsClaimTaskGenerator.GetPriorityText |
| Entry point | Business\SAIF.Business.Tasks.Claim\clsClaimTaskGenerator.vb |
Steps¶
- Construct the generator.
Initialize()(called from every constructor overload) creates the wrappedclsClaimTaskCollectionviaNewTaskCollection(dpi)(see Retrieve claim tasks for that collection's retrieval mechanics, which also apply to its empty-collection construction) and defaultsCreateUsertodpi.UserIDwhen the caller did not supply one. -
The five constructor overloads differ only in how the default claim context is established: no default claim (
ClaimID = 0); a create-user override with no default claim; an explicitClaimID; a claim number resolved throughclsClaimData.GetData(silently leaving no default claim if the claim is invalid); or a pre-resolvedclsClaimData.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. 2. Add one or more tasks. Nine publicAddTaskoverloads all normalize their arguments and delegate to the privateNewTask(claimId, user, text, dueDate, priority, claimCategory, notePadRequired): - Overloads that omit a claim ID use the generator's defaultm_ClaimID; overloads that omit a due date useNew clsSmartDate(Today()).NextWorkDay(today rolled forward to the next working day); overloads that take a due-date offset roll the date forward or back by that many days, snapping to the previous working day if the target lands on a non-workday. -NewTaskthrows anApplicationException("ClaimID not specified")if the resolved claim ID is0. - It creates the task viaclsClaimTask.NewTask(dpi, claimId, m_CreateUser)(see Claim task lifecycle for the create/enrich steps this triggers). - If no assignee was supplied: it resolves one viaClaimServices.GetResponsibleAdjuster(dpi, claimId)when the generator has no defaultclsClaimData, or via the cachedm_ClaimData.AdjusterMailIDwhen it does.Origin:
ClaimServices.GetResponsibleAdjusteris implemented inSAIF.BOF.Business; see ClaimServices in theSAIF.BOF.Businessdocumentation set. - IfnotePadRequiredis true: it sets the task's notepad flag to"Y"viasetNotePadFlag. - If the generator has a defaultclsClaimData: it copiesPolicyNumberonto the task. - It setsMailID,Text,PriorityCode(viaGetPriorityText), andTaskDateon the task. - It setsCategoryCodetoclsClaimTask.FASTTRACKCATEGORYwheninClaimCategory = FastTrack, otherwiseclsClaimTask.DEFAULTCATEGORY. - It registers theIsValidClaimIDrule on the new task (BR-009) and adds the task to the wrappedm_Collection. 3. Validate.IsValidClaimID(BR-009) resolvesclsClaimData.GetData(m_DPI, task.ClaimID)for the specific task and returns whether that claim'sIsValidis true, at rule-check level three. 4. Inspect batch state.Count,IsValid,IsDirty,ErrorMessages, andErrorCountall delegate directly to the wrappedm_Collection, giving the caller a single surface for the whole batch's status before saving. 5. Save the batch.Save()callsm_Collection.Save(), persisting every task added since construction through the inherited BOF task save pipeline in one call.
Origin: Insert, update, and soft-delete persistence for each task's underlying
TASKrow, and the collection-level save orchestration, are implemented byclsTask/clsTaskCollectioninSAIF.Business.Tasks. That library is documented in the previous format, so no per-operation page exists; see Insert task and Update task in theSAIF.Business.Tasksdocumentation set. 6. Export.ToXML()andGetReportXML()return XML and report-XML projections of the wrapped collection, unchanged from the base task-collection serialization.
Process flow¶
The following diagram visualizes constructing a generator, adding tasks, and saving the batch.
flowchart TD
Start([New clsClaimTaskGenerator]) --> Init[Initialize: create<br>inner clsClaimTaskCollection]
Init --> AddCall[Caller calls an AddTask overload]
AddCall --> Normalize[Normalize claimId, dueDate,<br>priority, category]
Normalize --> ClaimCheck{ClaimID resolved<br>and non-zero?}
ClaimCheck -->|No| Throw([ApplicationException:<br>ClaimID not specified])
ClaimCheck -->|Yes| CreateTask[clsClaimTask.NewTask]
CreateTask --> Assignee{MailID supplied?}
Assignee -->|No| ResolveAdjuster[Resolve responsible adjuster<br>or use cached ClaimData.AdjusterMailID]
Assignee -->|Yes| SetFields[Set MailID, Text, Priority,<br>TaskDate, CategoryCode]
ResolveAdjuster --> SetFields
SetFields --> RegisterRule[Register IsValidClaimID rule]
RegisterRule --> AddToCollection[Add task to inner collection]
AddToCollection --> More{More AddTask calls?}
More -->|Yes| AddCall
More -->|No| SaveCall[Caller calls Save]
SaveCall --> Persist[Inner collection.Save:<br>inherited task save pipeline]
Persist --> Done([Save returns success/failure])
Failure and edge-case behavior¶
NewTaskthrows anApplicationExceptionimmediately if a resolved claim ID is0; this is a hard failure, not a validation warning, so a batch that includes one bad claim ID can abort task creation before anySave()is attempted.- Constructing the generator from an invalid claim number silently leaves no default claim rather than raising an error; subsequent
AddTaskoverloads that rely on the default claim ID will then fail with the "ClaimID not specified" exception.* IsValidClaimIDre-resolvesclsClaimDataper task at validation time, independent of whatever claim data the generator cached at construction, so a claim that becomes invalid between generator construction andSave()is still caught.Save()persists the entire batch through a single collection save; a per-task contention or validation failure surfaces through the collection'sErrorCount/ErrorMessages, not as a per-task return value fromAddTask.- Overloads that specify a due-date offset roll a non-workday target to the previous working day, while overloads that specify only a due date roll a non-workday target forward to the next working day — callers must pick the right overload to get the intended rounding direction.
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\clsClaimTaskGenerator.vb