What the state machine decided, and therefore which events the caller should fire. The machine does not fire anything itself. It returns this, the caller fires, and listeners decide what to deliver - so email, Slack and journeys are all just listeners and none of them has to reimplement the re-notification window.
Properties
| Property | Returns | Description |
|---|---|---|
| bucketWasNew | boolean | False when the bucket had already been accounted for, which is the common case: an hourly scheduler sees the same closed daily bucket around two dozen times. Nothing changed and nothing needs saving. |
| fireAlarm | boolean | Whether the caller should fire the OnAnomalyAlarm event for this evaluation. |
| fireDetected | boolean | Whether the caller should fire the OnAnomalyDetected event for this evaluation. |
| fireRecovered | boolean | Whether the caller should fire the OnAnomalyRecovered event for this evaluation. |
| fromState | AlarmState | The detector's alarm state immediately before this evaluation. |
| fromStateName | String | The alarm state before this evaluation, as a string, for script and templates. |
| stateChanged | boolean | Whether the detector's alarm state changed as a result of this evaluation. |
| toState | AlarmState | The detector's alarm state immediately after this evaluation. |
| toStateName | String | The alarm state after this evaluation, as a string, for script and templates. |
Methods
getFromState() · getToState() · getFromStateName() · getToStateName() · isFireDetected() · isFireAlarm() · isFireRecovered() · isBucketWasNew() · hasEvents() · isStateChanged()
getFromState()
Returns: AlarmState
The detector's alarm state immediately before this evaluation.
getToState()
Returns: AlarmState
The detector's alarm state immediately after this evaluation.
getFromStateName()
Returns: String
The alarm state before this evaluation, as a string, for script and templates.
getToStateName()
Returns: String
The alarm state after this evaluation, as a string, for script and templates.
isFireDetected()
Returns: boolean
Whether the caller should fire the OnAnomalyDetected event for this evaluation.
isFireAlarm()
Returns: boolean
Whether the caller should fire the OnAnomalyAlarm event for this evaluation.
isFireRecovered()
Returns: boolean
Whether the caller should fire the OnAnomalyRecovered event for this evaluation.
isBucketWasNew()
Returns: boolean
False when the bucket had already been accounted for, which is the common case: an hourly scheduler sees the same closed daily bucket around two dozen times. Nothing changed and nothing needs saving.
hasEvents()
Returns: boolean
Whether this transition should result in any event being fired at all.
isStateChanged()
Returns: boolean
Whether the detector's alarm state changed as a result of this evaluation.