t6 Features > Decision Rules

Decision Rules

Decision-Rule is the event-based engine that trigger Actions following matching Conditions. Engine is watching for fact matching conditions on payloads coming from Datapoints POST, and handle Action(s) according to rules.

Fact

The fact is actually the payload POSTed to Datapoints endpoint. This contains some attributes that can be used in the matching Conditions

Conditions matching operators

Conditions supports combination by using all and any boolean operators. This give the ability for Rules to match multiple complex Conditions.

The following Condition will match when a datapoint is POSTed to flow_id cb518da8-xxxx-xxxx-xxxx-95b3b2bbfd8f and only when the environment is “development”.

{
    "all": [
        {
            "fact": "environment",
            "operator": "equal",
            "value": "development"
        },
        {
            "fact": "flow",
            "operator": "equal",
            "value": "cb518da8-xxxx-xxxx-xxxx-95b3b2bbfd8f"
        }
    ]
}

Operators

Operators allows to compare the value of Facts and so determine when the Rule is matching Conditions.

{"all":[{"fact":"dtepoch","operator":"isDayTime","value":true}]}
{"all":[{"fact":"value","operator":"lastEventGreaterThanInclusive","value":3600}]}
{"all":[{"fact":"value","operator":"lastEventLessThanInclusive","value":3600}]}
{"all":[{"fact":"value","operator":"anomalyGreaterThanInclusive","value":1234}]}
{"all":[{"fact":"value","operator":"anomalyLessThanInclusive","value":1234}]}
{"all":[{"fact":"value","operator":"changeGreaterThanInclusive","value":1234}]}
{"all":[{"fact":"value","operator":"changeLessThanInclusive","value":1234}]}
{"all":[{"fact":"value","operator":"sentimentScoreGreaterThanInclusive","value":2}]}
{"all":[{"fact":"value","operator":"sentimentScoreLessThanInclusive","value":-1}]}
{"all":[{"fact":"value","operator":"distanceGreaterThan","value":100}]}
{"all":[{"fact":"value","operator":"distanceLessThan","value":100}]}

Actions

Tagged on #resource,