Task reference code lookups¶
Four parallel, near-identical code-table object pairs — clsTaskActionCode/clsTaskActionCodeCollection, clsTaskCategoryCode/clsTaskCategoryCodeCollection, clsTaskPriorityCode/clsTaskPriorityCodeCollection, and clsTaskSourceCode/clsTaskSourceCodeCollection — provide read-only access to the TASK_ACTION_CODE, TASK_CATEGORY_CODE, TASK_PRIORITY_CODE, and TASK_SOURCE_CODE tables respectively. Each pair follows the same BOF code-table pattern (single-row GetCode/lookup-by-key and full-collection GetCodes), so they are documented as one merged operation. The source and priority collections additionally expose static helpers that translate between database codes and the TaskSourceSystem/TaskPriority enums used throughout the task object model.
| Field | Value |
|---|---|
| Operation ID | OP-TASK-04 |
| Trigger | A caller requests a single code row (GetCode) or a full collection (GetCodes) for any of the four code types, or calls a source/priority enum-mapping helper |
| Inputs | Optional code key (action code, category code + source code, priority code, source code); for collection reads, an optional source-code filter (category codes only) |
| Outputs | A single populated code object, or a collection of code objects ordered by description; for the enum helpers, a resolved TaskSourceSystem/TaskPriority value or its corresponding database code |
| Primary components | clsTaskActionCode.GetCode, clsTaskActionCodeCollection.GetCodes, clsTaskCategoryCode.GetCode, clsTaskCategoryCodeCollection.GetCodes, clsTaskPriorityCode.GetCode, clsTaskPriorityCodeCollection.GetCodes, clsTaskPriorityCodeCollection.Priority, clsTaskSourceCode.GetCode, clsTaskSourceCodeCollection.GetCodes, clsTaskSourceCodeCollection.TaskSource, clsTaskSourceCodeCollection.TaskSourceCode |
| Entry point | Business\SAIF.Business.Tasks\clsTaskActionCode.vb, clsTaskActionCodeCollection.vb, clsTaskCategoryCode.vb, clsTaskCategoryCodeCollection.vb, clsTaskPriorityCode.vb, clsTaskPriorityCodeCollection.vb, clsTaskSourceCode.vb, clsTaskSourceCodeCollection.vb |
Steps¶
- Single action-code lookup.
clsTaskActionCode.GetCode(dpi, code)builds a criteria keyed byCodeand retrieves one row viaTASK_ACTION_CODE.CODE = :Code(SQL-003, TASK_ACTION_CODE), fillingCodeandDescription. - Action-code collection.
clsTaskActionCodeCollection.GetCodes(dpi)retrieves the fullTASK_ACTION_CODEtable ordered by description (SQL-004, TASK_ACTION_CODE) and materializes oneclsTaskActionCodeper row. - Single category-code lookup.
clsTaskCategoryCode.GetCode(dpi, sourceSystem, code)builds a criteria keyed by bothCodeandTaskSourceCodeand retrieves one row viaTASK_CATEGORY_CODE.CODE = :Code AND TASK_CATEGORY_CODE.TASK_SOURCE_CODE = :TaskSourceCode(SQL-006, TASK_CATEGORY_CODE), fillingCode,Description,DefaultActionCode,DefaultPriorityCode,NotepadFlag, andTaskSourceCode. - The
NotepadFlagvalue drivesIsNotePadRequired, which reportsTrueonly when the flag equalsY, and which concrete task types surface through theRequiresNotePadEntrycontract (BR-011). - Category-code collection filtered by source.
clsTaskCategoryCodeCollection.GetCodes(dpi, sourceCode)retrieves every category row for one source system, ordered by description (SQL-007, TASK_CATEGORY_CODE), and setsIsValid = Trueon the collection only if at least one row was found. - Single priority-code lookup.
clsTaskPriorityCode.GetCode(dpi, code)retrieves oneTASK_PRIORITY_CODErow by code (SQL-009, TASK_PRIORITY_CODE). - Priority-code collection.
clsTaskPriorityCodeCollection.GetCodes(dpi)retrieves the fullTASK_PRIORITY_CODEtable ordered by description (SQL-010, TASK_PRIORITY_CODE). - The collection also exposes
Priority(code)andPriority(taskPriority), static helpers that map the literal codesINFO/LOW/MED/HIGH/URGto and from theTaskPriorityenum (defaulting toInformationalfor an unrecognized code or enum value); these constants back the priority-level cascade used by task collection retrieval. - Single source-code lookup.
clsTaskSourceCode.GetCode(dpi, code)retrieves oneTASK_SOURCE_CODErow by code (SQL-011, TASK_SOURCE_CODE). - Source-code collection.
clsTaskSourceCodeCollection.GetCodes(dpi)retrieves the fullTASK_SOURCE_CODEtable ordered by description (SQL-012, TASK_SOURCE_CODE). - The collection also exposes
TaskSource(code)andTaskSourceCode(sourceSystem), static helpers that map the fourteen literal source codes (AV,BATCH,CBP,CLAIM,CLMC,COVB,CLMM,IMAGE,LEGAL,PROV,RTW,THRDP,TITAN,WCIS) to and from theTaskSourceSystemenum; an unrecognized code resolves toTaskSourceSystem.NotAssigned. This mapping is what task collection retrieval's row-materialization step uses to name an unsupported source system in its thrown exception.
Process flow¶
flowchart TD
Start([Caller requests a code<br>row or collection]) --> Which{Which code type?}
Which -->|Action| ActLookup[GetCode / GetCodes<br>against TASK_ACTION_CODE]
Which -->|Category| CatLookup[GetCode by source+code /<br>GetCodes by source<br>against TASK_CATEGORY_CODE]
Which -->|Priority| PriLookup[GetCode / GetCodes<br>against TASK_PRIORITY_CODE]
Which -->|Source| SrcLookup[GetCode / GetCodes<br>against TASK_SOURCE_CODE]
CatLookup --> Notepad{NotepadFlag = 'Y'?}
Notepad -->|Yes| NotepadTrue([IsNotePadRequired = True])
Notepad -->|No| NotepadFalse([IsNotePadRequired = False])
PriLookup --> PriMap[Priority helpers map<br>code <-> TaskPriority enum]
SrcLookup --> SrcMap[TaskSource helpers map<br>code <-> TaskSourceSystem enum]
ActLookup --> Return([Object or collection returned])
NotepadTrue --> Return
NotepadFalse --> Return
PriMap --> Return
SrcMap --> Return
Failure and edge-case behavior¶
- All four lookup pairs are read-only: none implement add, remove, or save behavior on the code tables themselves.
- A single-row lookup with no matching code (action, category, priority, or source) leaves the object unfilled rather than raising an explicit not-found error, mirroring the retrieval behavior in the task record lifecycle.*
clsTaskCategoryCodeCollectionis the only one of the four collections that tracksIsValidbased on whether any row was found for the requested source code; the other three collections do not expose an equivalent found/not-found signal.TaskSource(code)andPriority(code)both silently default to a safe fallback value (NotAssignedandInformationalrespectively) for an unrecognized code rather than raising an error, so a bad or new database code degrades to a default classification instead of failing loudly.
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\clsTaskActionCode.vbBusiness\SAIF.Business.Tasks\clsTaskActionCodeCollection.vbBusiness\SAIF.Business.Tasks\clsTaskCategoryCode.vbBusiness\SAIF.Business.Tasks\clsTaskCategoryCodeCollection.vbBusiness\SAIF.Business.Tasks\clsTaskPriorityCode.vbBusiness\SAIF.Business.Tasks\clsTaskPriorityCodeCollection.vbBusiness\SAIF.Business.Tasks\clsTaskSourceCode.vbBusiness\SAIF.Business.Tasks\clsTaskSourceCodeCollection.vb