Build rule definitions¶
NotificationRule has only a private constructor, so this operation — its four static factory methods — is the only supported way for a caller to construct a rule definition.
| Field | Value |
|---|---|
| Operation ID | OP-CIA-04 |
| Trigger | A caller request. |
| Inputs | Position, type name, member/method name, target value, and (for conditional rules) out-property or out-value data, depending on the factory used. |
| Outputs | A NotificationRule instance. |
| Primary components | NotificationRule.PropertyRule, NotificationRule.MethodRule, NotificationRule.EvalRuleOutProperty, NotificationRule.EvalRuleOutValue |
| Entry point | Services/SAIF.Services.ClaimInfoApi.Core/NotificationRule.cs (lines 43–69) |
Steps¶
PropertyRule(position, typeName, name, propertyName)creates a rule that reads a property of typetypeName(CIA-BR-010).MethodRule(position, name, methodName, parameterValue)creates a rule withTypeName = "System.Object"andTargetValue = parameterValue, targeting a method call on the model.- Because
System.Objectis neitherintnorbool, Evaluate one rule evaluates it through the string branch, so the method must returnstringor compilation fails*. (CIA-BR-009) EvalRuleOutProperty(int position, string typeName, string name, string memberName, string operatorName, string evalProperty, string outProperty, string outPropertyTypeName)creates a conditional rule that, when true, returns the value of another property (OutProperty, typedOutPropertyTypeName) (CIA-BR-005).EvalRuleOutValue(int position, string typeName, string name, string memberName, string operatorName, string evalProperty, string outValue)creates a conditional rule that, when true, returns a constantOutValue(CIA-BR-006).- All four factories call the private constructor, which sets
Position,TypeName,Name, andMemberName._idis set to a newGuidby the field initializer (CIA-BR-001, CIA-BR-013).
Process flow¶
The following diagram visualizes the four construction paths, all converging on the private constructor.
flowchart TD
Start([Caller request]) --> Choice{"Which factory?"}
Choice -->|PropertyRule| Prop["Set property-read metadata"]
Choice -->|MethodRule| Method["Set TypeName=System.Object<br>TargetValue=parameterValue"]
Choice -->|EvalRuleOutProperty| OutProp["Set OutProperty and<br>OutPropertyTypeName"]
Choice -->|EvalRuleOutValue| OutVal["Set OutValue"]
Prop --> Ctor["Private constructor:<br>set Position, TypeName,<br>Name, MemberName"]
Method --> Ctor
OutProp --> Ctor
OutVal --> Ctor
Ctor --> Done(["Return NotificationRule<br>with new Guid _id"])
Failure and edge-case behavior¶
NotificationRulecannot be constructed by any means other than these four factories, since the constructor is private and there is no parameterless constructor; deserializers requiring a public default constructor cannot materialize it*.- A
MethodRulewhose target method does not returnstringfails during Compile a rule into a delegate, not at construction time*.
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Related documentation¶
Sources¶
Services/SAIF.Services.ClaimInfoApi.Core/NotificationRule.cs