Skip to content

SAIF.Business.Tasks operations and processes

This page is the operation catalog and cross-operation hub for SAIF.Business.Tasks. The library provides the shared, reusable base implementation that concrete task types across the SAIF ecosystem inherit: an in-memory-to-Oracle CRUD lifecycle for a single task through the pk82036_task package, a dynamic multi-filter search over the TASK table, a direct-to-package purge of aged soft-deleted rows, and read-only access to the action/category/priority/source reference code tables that back task defaults, validation, and display. Each operation's detailed, step-by-step logic lives in its own page under operations/.

Operation catalog

Operation Intent Trigger Inputs Outputs Rules Tables SQL
Task record lifecycle Initialize, retrieve, insert, update, and soft-delete a single task through the shared clsTask base class Concrete subclass calls Create(), retrieves by TaskID, or calls Save() on a new/dirty/deleted instance Task field values, TaskSeqNum, UpdateSeqNum, acting user Populated task object; inserted/updated/soft-deleted TASK row with rows-affected result; broken rules on validation or contention failure BR-001, BR-002, BR-003, BR-004, BR-005, BR-006, BR-007, BR-008, BR-009, BR-010, BR-012, BR-013, BR-014, BR-015, BR-016, BR-017, BR-018, BR-019, BR-020 TASK, TASK_CATEGORY_CODE SQL-001, SQL-002, SQL-005, SQL-013, SQL-014
Task collection retrieval Search TASK with a dynamic, additive multi-filter criteria and materialize typed task instances Caller populates a clsTaskCollection.Criteria and calls GetTasks Source/category/priority/date/assignee/claim/policy/action/context filters, row limit, sort Collection of typed task instances for matching rows BR-023, BR-024 TASK SQL-008
Purge deleted tasks Physically remove aged soft-deleted rows for a source/category slice Caller invokes clsTaskCollection.PurgeTasks directly Source code, category code, keep-days value Deleted-row count BR-021, BR-022 TASK SQL-015
Task reference code lookups Read action, category, priority, and source-system lookup data, and resolve code/enum mappings Caller requests one code row, a full lookup collection, or an enum-mapping helper Optional code key or source-code filter Lookup entity or collection; resolved TaskSourceSystem/TaskPriority enum values BR-011 TASK_ACTION_CODE, TASK_CATEGORY_CODE, TASK_PRIORITY_CODE, TASK_SOURCE_CODE SQL-003, SQL-004, SQL-006, SQL-007, SQL-009, SQL-010, SQL-011, SQL-012

Process flow diagram

The following diagram shows how the four operations relate: a concrete task type drives the CRUD lifecycle of an individual task, callers separately search across many tasks, an administrative/batch process purges aged soft-deleted rows, and all of the above draw on the shared reference code tables for defaults, validation, and display.

flowchart TD
    Start([Caller requests task functionality]) --> Which{Which operation?}
    Which -->|Single task| Lifecycle[Task record lifecycle:<br>create, retrieve, insert,<br>update, soft-delete]
    Which -->|Search| Collection[Task collection retrieval:<br>dynamic multi-filter search]
    Which -->|Retention| Purge[Purge deleted tasks:<br>Task_Purge for aged<br>soft-deleted rows]
    Which -->|Lookup| Codes[Task reference code lookups:<br>action, category, priority, source]
    Lifecycle --> Validate{Validation rules pass?}
    Validate -->|No| Errors([Broken rules returned;<br>no DB call for insert/update])
    Validate -->|Yes| Save[Call task_insert / task_update /<br>task_delete via pk82036_task]
    Save --> Concurrency{RowsAffected = 1?}
    Concurrency -->|Yes| Done([Change persisted;<br>object marked clean])
    Concurrency -->|No| Contention([Contention error added])
    Collection --> Materialize[Materialize one typed<br>task instance per row]
    Materialize --> SourceCheck{NewTask factory<br>supports source code?}
    SourceCheck -->|No| Throw([ApplicationException])
    SourceCheck -->|Yes| Loaded([Row loaded into collection])
    Codes --> Ref[Read-only reference data<br>used by Lifecycle and Collection]
    Ref --> Lifecycle
    Ref --> Collection
    Purge --> PurgeExec([Aged, already-deleted rows<br>physically removed])

Database interactions

The following table summarizes which operations read from or write to the database. Per-step SQL and table citations live in each operation's detail page under operations/.

Operation SQL Tables Type
Task record lifecycle SQL-001, SQL-002, SQL-005, SQL-013, SQL-014 TASK, TASK_CATEGORY_CODE Read/Write
Task collection retrieval SQL-008 TASK Read
Purge deleted tasks SQL-015 TASK Delete
Task reference code lookups SQL-003, SQL-004, SQL-006, SQL-007, SQL-009, SQL-010, SQL-011, SQL-012 TASK_ACTION_CODE, TASK_CATEGORY_CODE, TASK_PRIORITY_CODE, TASK_SOURCE_CODE Read

Failure and edge-case behavior

  • A rows-affected value other than 1 is a hard failure on insert, update, and delete alike in the task record lifecycle; see that page for the full detail.
  • Field-level validation rules (category, source, priority, mail ID, source/category combination, date) can each be silently overridden by a concrete task subclass through OverrideRules, so documented validation outcomes assume no subclass override is applied.*
  • Task collection retrieval builds several filter fragments (task text, task-context values) as literal SQL text rather than bound parameters — a latent risk if caller-supplied values are not otherwise sanitized upstream.*
  • Purge deleted tasks bypasses the standard save/validation pipeline entirely and only ever removes rows already marked deleted by the lifecycle operation.
  • An unsupported task source code encountered during collection retrieval throws rather than skipping the row, so one bad row can fail an entire search.

Sources

  • Business\SAIF.Business.Tasks\clsTask.vb
  • Business\SAIF.Business.Tasks\clsTaskCollection.vb
  • Business\SAIF.Business.Tasks\clsTaskBusinessRules.vb
  • 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

Stored procedure operations

Operations implemented in Oracle stored procedures referenced by this library.

Operation Description Source Link
Retrieve task row Retrieve a single TASK row through the package cursor routine. pk82036_task.task_select Details
Insert task row Insert a new TASK row with sequence-based key and audit stamps. pk82036_task.task_insert Details
Update task row Update mutable task fields and increment the row version. pk82036_task.task_update Details
Soft-delete task row Mark the row deleted without physical removal. pk82036_task.task_delete Details
Purge deleted task rows Physically remove aged soft-deleted rows in a source/category slice. pk82036_task.task_purge Details