A RuleOnAttribute attribute placed on the class indicates what type of object the rule works on and when the rule should fire, either inline, local transaction commit, or top level transaction commit.
The rule is called when a change occurs to the object of the specified type in the model, whether the change is made in the UI or programmatically.