Skip to content

clsTaskBusinessRules

clsTaskBusinessRules implements the shared task validation rules invoked by the BOF rules engine during save. It is the one component in this library that reaches directly into the data layer (ValidSourceCategory) rather than delegating to a code-table business object — a coupling flagged in source as a MUSTDO.

Purpose

  • Validate that a task's source system / category code combination is registered in TASK_CATEGORY_CODE (BR-005, SQL-005).
  • Enforce that a task's date is current or future, except for batch-created tasks (BR-006, BR-007).
  • Surface a non-blocking warning when AssignTaskDate has auto-shifted a due date (BR-008).

Context

  • Namespace: SAIF.Business.Tasks
  • Assembly/package: SAIF.Business.Tasks (embedded in the LegalMaintenance web deployment)

Public members

Member Signature Purpose
ValidSourceCategory Shared Function ValidSourceCategory(target As Object, e As clsRuleArgs) As Boolean Runs a scalar COUNT(*) against TASK_CATEGORY_CODE to confirm the source/category pairing is valid (BR-005, SQL-005); a zero count fails at RuleCheckLevel.LevelThree unless the descendant's OverrideRules converts the result.
CheckDate Shared Function CheckDate(target As Object, e As clsRuleArgs) As Boolean Validates the task date is current or future, skipping the check for batch-created tasks (BR-006, BR-007).
CheckDateModified Shared Function CheckDateModified(target As Object, e As clsRuleArgs) As Boolean Raises a non-blocking RuleType.Warning message when the task date was auto-shifted by AssignTaskDate (BR-008).

Behavioral notes

  • All three rule functions are decorated with <RuleData(...)>, the BOF rules-engine registration attribute.
  • ValidSourceCategory issues its own ad-hoc query directly against the target task's DPI rather than delegating to clsTaskCategoryCode/clsTaskCategoryCodeCollection — flagged in source as a MUSTDO to replace with a code-table call*.

Constraints and usage notes

  • All three functions match the BOF rule delegate signature (target As Object, e As clsRuleArgs) As Boolean and are registered via clsTask.AddBusinessRules.

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

  • SAIF.Business.Tasks/clsTaskBusinessRules.vb