Delete a manual class base with referential guard¶
clsManualClassBase.CanDeleteManualClassBaseRecord then BeforeDelete/AfterDelete (clsManualClassBase.vb:1341-1383, :889-910)
| Field | Value |
|---|---|
| Operation ID | OP-006 |
| Trigger | Rate-file maintenance wants to remove a manual class from a rate file |
| Inputs | Manual class number, WCIS rate file sequence number |
| Outputs | Boolean eligibility, then the delete itself |
| Primary components | `clsManualClassBase.CanDeleteManualClassBaseRecord then BeforeDelete/AfterDelete (clsManualClassBase.vb:1341-1383, :889-910)` |
| Entry point | Business\SAIF.Business.Policy.Rating\clsManualClassBase.vb |
Steps¶
- Execute the scalar probe
- If the count is greater than zero, return
False— the class is in use by a premium history set - Any exception during the probe is wrapped and rethrown as
- If eligible,
BeforeDeletesetsSQLStatement = MyCriteria.DeleteSQL,RequestType = NonQuery, AfterDeletereadsRowsAffected; when it is not exactly 1 it calls- Use the related data-access statements and tables for this operation: SQL-017, SQL-056, PREM_HIST_CLASS_COVERAGE, MANUAL_CLASS_BASE.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Trigger: remove a manual class from a rate file]) --> S1[Execute scalar probe: premium history usage count]
S1 --> D1{Count greater than 0?}
D1 -->|Yes| S2[Return False - class in use by a premium history set]
D1 -->|No| S3[Eligible: BeforeDelete sets DeleteSQL, RequestType=NonQuery]
S3 --> S4[Execute delete; AfterDelete reads RowsAffected]
S4 --> D2{RowsAffected equals 1?}
D2 -->|Yes| S5[Delete confirmed]
D2 -->|No| S6[Raise error - unexpected row count]
S1 -.->|Exception during probe| S7[Wrapped and rethrown]
S2 --> Done([Result: not eligible])
S5 --> Done2([Result: deleted])
S6 --> Done2
S7 --> Done2
Failure and edge-case behavior¶
- Review the linked business rules and SQL documents for the validation or data-access conditions that can block this operation.
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. Statements marked with ** could not be confirmed; treat as unknown until verified.
Sources¶
Business\SAIF.Business.Policy.Rating\clsManualClassBase.vb