RULE

Defines a single rule within the RULES section. A rule consists of conditional logic expressed using WHEN clauses and resulting actions defined in THEN clauses. Rules may include metadata such as priority and category to influence evaluation order and grouping.

Properties of RULE

NameTypeDescription
TitleSTRINGThe unique name or title of the rule.
EnabledBOOLEANControls whether the rule participates in evaluation. Rules are enabled by default;
WeightDECIMALOptional rule weight used to influence priority or contribution during rule evaluation.
PriorityDECIMALDefines the relative priority of the rule during evaluation. Higher priority rules may be evaluated earlier or override lower priority rules.
ActionSTRINGThe decision outcome this rule contributes toward. The action represents a directional intent or classification target and is not executed directly. During evaluation, multiple rules may contribute to the same action with varying confidence.

Syntax

	RULE <Title> <CONDITIONS>

Examples

	
MODULE
    MODEL
        RULES
            RULE EscalateHighRiskCustomer
                Priority = 10
                Category = 'Risk'

                WHEN
                    SentimentScore < -8
                    AND IssueSeverityScore >= 3

                THEN
                    Action = Escalate

             DEFAULTACTION
                    StandardResponse

	
        RULE PriceMomentum
        IF
            MATH.ABS(Price - VWAP) > 1.25
            AND
            LOG(Volume + 1) > 2.0
        THEN
            ACTION = 'IncreaseExposure'

	
RULE CustomerIntent
    IF
        String.CONTAINS(UserMessage, 'refund')  < 3
    THEN
        ACTION = 'EscalateSupport'

	
RULE TradeLatency
    IF
        TIME_DIFF_SECONDS(OrderTime, FillTime) > 2.5
        AND
        TIME_HOUR(FillTime) >= 9
    THEN
        ACTION = 'ReduceOrderRate'