Skip to content

Retrieve legacy task codes

This operation loads every row of the legacy_task_code lookup table into a clsLegacyTaskCodeCollection, giving callers an in-memory, indexable set of legacy task-code definitions (category, notepad flag, date/text day thresholds, and run-date usage) for translating legacy task codes into current task attributes. It is a simple, unfiltered, read-only lookup with no create, update, or delete path.

Field Value
Operation ID OP-TC-05
Trigger Caller calls clsLegacyTaskCodeCollection.GetLegacyTaskCodeCollection(dpi)
Inputs IDataPortalInfo only — the retrieve has no filter parameters
Outputs Populated clsLegacyTaskCodeCollection containing every legacy_task_code row as a clsLegacyTaskCode
Primary components clsLegacyTaskCodeCollection.GetLegacyTaskCodeCollection, clsLegacyTaskCodeCollection.BeforeRetrieve, clsLegacyTaskCodeCollection.AfterRetrieve, clsLegacyTaskCode.Load, clsLegacyTaskCode.Fill
Entry point Business\SAIF.Business.Tasks.Claim\clsLegacyTaskCodeCollection.vb

Steps

  1. The caller invokes GetLegacyTaskCodeCollection(dpi), which calls dpi.DataAccessLayer.RetrieveObject(New Criteria(dpi)).
  2. BeforeRetrieve configures the portal request as a Text-type command using MyCriteria.RetrieveSQL, which is the fixed statement select * from legacy_task_code (SQL-002, legacy_task_code).
  3. AfterRetrieve reads every row from the result set. For each row, it creates a new clsLegacyTaskCode, calls Load(dpi, reader), and adds it to the collection.
  4. clsLegacyTaskCode.Load calls Fill(reader), which populates CreateDate, CreateUser, DateDaysNum, LegacyTaskCode, NotepadFlag, TaskCategoryCode, TextDaysNum, TaskText, UpdateDate, UpdateUser, and UseRunDateFlag directly from the named reader columns, then sets a Criteria(dpi, legacyTaskCode) on the object.
  5. The caller looks up individual codes from the returned collection by ordinal Item(index) or by code value Item(legacyTaskCode); both are read-only indexers over the in-memory List.

Process flow

The following diagram visualizes the unfiltered lookup-table load.

flowchart TD
    Start([Caller calls GetLegacyTaskCodeCollection]) --> Before[BeforeRetrieve:<br>select * from legacy_task_code]
    Before --> Execute[Portal request executes<br>against Oracle]
    Execute --> After[AfterRetrieve: for each row,<br>create and Load a clsLegacyTaskCode]
    After --> More{More rows?}
    More -->|Yes| After
    More -->|No| Done([Return populated collection])

Failure and edge-case behavior

  • The retrieve has no filter parameters and no paging; every row in legacy_task_code is loaded on every call.
  • The Criteria class's CreateSQL, DeleteSQL, InsertSQL, and UpdateSQL properties all throw ApplicationException(clsConstants.Messages.InvalidSQLProperty), confirming this object supports only the retrieve path documented here.
  • Item(legacyTaskCode) and Contains both return a default/False result for an unmatched code rather than raising an error.

Sources

  • Business\SAIF.Business.Tasks.Claim\clsLegacyTaskCode.vb
  • Business\SAIF.Business.Tasks.Claim\clsLegacyTaskCodeCollection.vb