Skip to content

Commit

Permalink
Merge d035f0c into df12e6b
Browse files Browse the repository at this point in the history
  • Loading branch information
fgalan committed Oct 21, 2019
2 parents df12e6b + d035f0c commit 5092d96
Showing 1 changed file with 50 additions and 6 deletions.
56 changes: 50 additions & 6 deletions documentation/plain_rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- [Introduction](#introduction)
- [EPL text](#epl-text)
- [No signal conditions](#nosignal-conditions)
- [Actions](#actions)
- [String substitution syntax](#string-substitution-syntax)
- [SMS action](#sms-action)
Expand All @@ -16,11 +17,9 @@

## Introduction

Plain rules allow a full customization of a rule with specific needs by means of setting the final EPL statement used by
the Esper engine inside perseo-core. In order to work with perseo (front-end) properly, the EPL statement must fulfill
several conventions for the rule to be able to operate on the incoming events and trigger adequate actions.
There are two kind of rules:

The “anatomy” of a rule is as follows
* Esper-based rules, which include the final EPL statement used by the Esper engine inside perseo-core. In order to work with perseo (front-end) properly, the EPL statement must fulfill several conventions for the rule to be able to operate on the incoming events and trigger adequate actions. Example:

```json
{
Expand All @@ -41,12 +40,46 @@ The “anatomy” of a rule is as follows
}
```

The fields (all must be present) are
* No signal rules. They are triggered when a given attribute is not updated in a given interval of time. They
don't use Esper at persero-core (they are checked and triggered by perseo frontend). Example:


```json
{
"name": "check_temp_no_signal",
"nosignal": {
"checkInterval": "1",
"attribute": "temperature",
"reportInterval": "5",
"id": null,
"idRegexp": "^value.*",
"type": null
},
"action": {
"type": "email",
"template": "No signal in temperature",
"parameters": {
"to": "brox@tid.es",
"from": "dca_support@tid.es",
"subject": "temperature no signal"
}
}
}
```

In both types of rules the following fields are mandatory:

- **name**: name of the rule, used as identifier
- **text**: EPL statement for the rule engine in perseo-core
- **action**: action to be performed by perseo if the rule is fired from the core

For EPL-based rules the following field is mandatory:

- **text**: EPL statement for the rule engine in perseo-core.

For no signal rules the following field is mandatory:

- **nosignal**: a description of the no signal condition.

The rule name must consist of the ASCII characters from A to Z, from a to z, digits (0-9), underscore (\_) and dash (-).
It can have a maximum length of 50 characters.

Expand Down Expand Up @@ -92,6 +125,17 @@ Please, be carefull with using non-ascii characters in the EPL syntax. It will p
information on how to scape characters at
[Esper site](http://esper.espertech.com/release-6.1.0/esper-reference/html/event_representation.html#eventrep-properties-escaping)

## No signal conditions

The no signal condition is specified in the `nosignal` configuration element, which is an object with the following fields:

- checkInterval: _optional_ or _mandatory_ ???,time in minutes for checking the attribute
- attribute: _optional_ or _mandatory_ ???, attribute for watch
- reportInterval: _optional_ or _mandatory_ ???, time in seconds to see an entity as silent
- id: _optional_ or _mandatory_ ???, of the entity to watch
- idRegexp: _optional_ or _mandatory_ ???, regular expression to match entities by ID
- type: _optional_ or _mandatory_ ???,: type of entities to watch

<a name="actions"></a>

## Actions
Expand Down

0 comments on commit 5092d96

Please sign in to comment.