Skip to content

Load a group's chapters

Lazily loads chapter rows for a group and guarantees that callers see at least one chapter object.

Field Value
Operation ID OP-004
Trigger Caller reads clsGroupAssociation.Chapters or requests chapters directly
Inputs —
Outputs A clsChapterCollection, or a placeholder chapter when no rows exist.
Primary components clsGroupAssociation.Chapters, clsChapterCollection.GetChapters
Entry point Business\SAIF.Business.Policy.Group\clsChapterCollection.vb

Steps

  1. On first access to Chapters, the group calls clsChapterCollection.GetChapters(DataPortalInfo, Code).
  2. BeforeRetrieve binds :GroupAssociationCode; RetrieveSQL selects from GROUP_CHAPTER.
  3. AfterRetrieve fills one clsChapter per row.
  4. Branch — if the returned collection is empty, a placeholder chapter is added via clsChapter.NewChapter(dpi, Code, "") (blank chapter code) so callers always have at least one chapter. (BR-005)
  5. Callers filter with ActiveChapters(selectDate) and GroupChaptersByCode(code). (BR-006)
  6. Database statements executed or relied on by this operation: SQL-018; affected tables: GROUP_CHAPTER.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Trigger]) --> Step1[Build criteria / load state]
    Step1 --> Step2[Apply local business logic]
    Step2 --> Decision{Valid and complete?}
    Decision -->|Yes| Step3[Return data or persist rows]
    Decision -->|No| EndErr([Return BOF validation or SQL-state issues])
    Step3 --> EndOk([Operation completes])

Failure and edge-case behavior

  • If no rows exist in GROUP_CHAPTER, the library seeds a placeholder chapter instead of returning an empty collection (BR-005).

Sources

  • Business\SAIF.Business.Policy.Group\clsChapterCollection.vb