Skip to content

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

  1. Single action-code lookup. clsTaskActionCode.GetCode(dpi, code) builds a criteria keyed by Code and retrieves one row via TASK_ACTION_CODE.CODE = :Code (SQL-003, TASK_ACTION_CODE), filling Code and Description.
  2. Action-code collection. clsTaskActionCodeCollection.GetCodes(dpi) retrieves the full TASK_ACTION_CODE table ordered by description (SQL-004, TASK_ACTION_CODE) and materializes one clsTaskActionCode per row.
  3. Single category-code lookup. clsTaskCategoryCode.GetCode(dpi, sourceSystem, code) builds a criteria keyed by both Code and TaskSourceCode and retrieves one row via TASK_CATEGORY_CODE.CODE = :Code AND TASK_CATEGORY_CODE.TASK_SOURCE_CODE = :TaskSourceCode (SQL-006, TASK_CATEGORY_CODE), filling Code, Description, DefaultActionCode, DefaultPriorityCode, NotepadFlag, and TaskSourceCode.
  4. The NotepadFlag value drives IsNotePadRequired, which reports True only when the flag equals Y, and which concrete task types surface through the RequiresNotePadEntry contract (BR-011).
  5. 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 sets IsValid = True on the collection only if at least one row was found.
  6. Single priority-code lookup. clsTaskPriorityCode.GetCode(dpi, code) retrieves one TASK_PRIORITY_CODE row by code (SQL-009, TASK_PRIORITY_CODE).
  7. Priority-code collection. clsTaskPriorityCodeCollection.GetCodes(dpi) retrieves the full TASK_PRIORITY_CODE table ordered by description (SQL-010, TASK_PRIORITY_CODE).
  8. The collection also exposes Priority(code) and Priority(taskPriority), static helpers that map the literal codes INFO/LOW/MED/HIGH/URG to and from the TaskPriority enum (defaulting to Informational for an unrecognized code or enum value); these constants back the priority-level cascade used by task collection retrieval.
  9. Single source-code lookup. clsTaskSourceCode.GetCode(dpi, code) retrieves one TASK_SOURCE_CODE row by code (SQL-011, TASK_SOURCE_CODE).
  10. Source-code collection. clsTaskSourceCodeCollection.GetCodes(dpi) retrieves the full TASK_SOURCE_CODE table ordered by description (SQL-012, TASK_SOURCE_CODE).
  11. The collection also exposes TaskSource(code) and TaskSourceCode(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 the TaskSourceSystem enum; an unrecognized code resolves to TaskSourceSystem.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.*
  • clsTaskCategoryCodeCollection is the only one of the four collections that tracks IsValid based 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) and Priority(code) both silently default to a safe fallback value (NotAssigned and Informational respectively) 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.

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.vb
  • Business\SAIF.Business.Tasks\clsTaskActionCodeCollection.vb
  • Business\SAIF.Business.Tasks\clsTaskCategoryCode.vb
  • Business\SAIF.Business.Tasks\clsTaskCategoryCodeCollection.vb
  • Business\SAIF.Business.Tasks\clsTaskPriorityCode.vb
  • Business\SAIF.Business.Tasks\clsTaskPriorityCodeCollection.vb
  • Business\SAIF.Business.Tasks\clsTaskSourceCode.vb
  • Business\SAIF.Business.Tasks\clsTaskSourceCodeCollection.vb