---
title: Publish rule-status notification
summary: Raises the matching rule-notification event for a broken or resolved rule.
status: draft
owner: SAIF Team
last_reviewed: 2026-07-30
library: SAIF.Framework.Bindable
reference_type: package
operation_id: OP-BIND-007
trigger: Subclass call to OnRuleBroken(rule) or OnRuleNotBroken(rule)
---

# Publish rule-status notification

This operation dispatches `clsRulesManagerBase`'s rule-status events after a subclass decides — through whatever validation logic it implements — that a rule has become broken or is no longer broken. Unlike [Notify modified-state change](modified-state-change-notification.md), the two methods here invoke their event delegates without first checking for a subscriber, which makes a listener mandatory rather than optional (see [BR-001](../business-rules.md#br-001-rule-violation-notification-requires-a-subscribed-listener)).

| Field | Value |
| --- | --- |
| **Operation ID** | `OP-BIND-007` |
| **Trigger** | Subclass call to `OnRuleBroken(rule)` or `OnRuleNotBroken(rule)`. |
| **Inputs** | `object rule`. |
| **Outputs** | `RuleBroken(rule)` or `RuleNotBroken(rule)` when a subscriber is attached; otherwise a `NullReferenceException`. |
| **Primary components** | `clsRulesManagerBase.OnRuleBroken`, `clsRulesManagerBase.OnRuleNotBroken` |
| **Entry point** | `SAIF.Framework.Bindable\clsrulesmanagerbase.cs` |

## Steps

1. A subclass calls `OnRuleBroken(rule)` or `OnRuleNotBroken(rule)` on the current `clsRulesManagerBase` instance, depending on which state transition it detected.
2. The method selects the event delegate matching that call: `RuleBroken` for a broken-state notification, `RuleNotBroken` for a resolved-state notification.
3. The method invokes the selected delegate directly with the supplied `rule` argument, with no null check beforehand ([BR-001](../business-rules.md#br-001-rule-violation-notification-requires-a-subscribed-listener)).
4. If a subscriber is attached, its handler executes and control returns normally to the caller.
5. If no subscriber is attached, the direct delegate invocation throws `NullReferenceException`, and that exception propagates up through `OnRuleBroken`/`OnRuleNotBroken` to the subclass that triggered the notification ([BR-001](../business-rules.md#br-001-rule-violation-notification-requires-a-subscribed-listener)).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Subclass calls OnRuleBroken or OnRuleNotBroken]) --> Check{Matching subscriber attached?}
	Check -->|Yes| Raise[Invoke matching rule-status event]
	Check -->|No| Err([NullReferenceException propagates])
	Raise --> EndOk([Notification delivered])
```

## Failure and edge-case behavior

- No subscriber attached: `OnRuleBroken(rule)` and `OnRuleNotBroken(rule)` throw `NullReferenceException` because they invoke their delegates without a null check; see [BR-001](../business-rules.md#br-001-rule-violation-notification-requires-a-subscribed-listener). Callers must ensure a listener is subscribed before any rule-evaluation logic can call either method safely.
- No input validation: the methods accept `object rule` with no type or null checking, so any payload — including a `null` reference — is forwarded unchanged to subscribers.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

## Sources
- `SAIF.Framework.Bindable\clsrulesmanagerbase.cs`
