Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

Message Rules can be used to filter incoming data by using various type of conditions. There are two types of rules:

  • Message content rules
  • Device filters

Message Content Rules

Message content rules allow the users to filter the data based on the content of the message.

Adding a Message Content Rule

To add a new rule, users have to click on New content rule. In the pop-up window, they have to fill in the name of the field and then choose which message content rule option they want to use (see below). It is possible to use more than one option in one rule (e.g. combine Requirement and Type of data). Once they have the condition ready, users have to click on Add to save the rule and close the pop-up window.

As the last step, users have to click on Apply to save the changes to the receiver.

Loading rules from a file

It is also possible to load the fields from a sample JSON or XML file. The rules will be created according to the structure of the file. Each field from the file will be marked as Required and the Data type will be selected according to the provided sample value.

Example:

Create a file with this content:

Code Block
languagejava
{"sensorId":"F4-B8-5E-3D-92-91","humidity":45}

Alternatively, download the JSON example or XML example.

Following rules will be created:

Removing a Content Rule

To remove a content rule, users have to click on the icon  .

To finish the operation, users have to click on Apply to save the changes to the receiver.

Message Content Rule Options

Users can use three different types of conditions:

  • Requirement
  • Type of data
  • Validation Expression

Requirement

By enabling this condition, users can check whether the chosen field name is present in the input data. If not, the data won't be processed. Please note that this rule will be triggered only in cases when the whole field is missing. In a situation where the field is present but the value is empty, the rule won't be triggered.

Type of Data

Users can select which type of data is allowed for the chosen field. For example, they can select that only numerical (Integer) values are valid.

  • STRING
  • BOOLEAN
  • INTEGER
  • DOUBLE
  • ARRAY
  • OBJECT

Validation Expression

Validation expression allows the users to use a standard regular expression (Regexp) to validate the format of the field. If the value does not match the expression, the data won't be processed. You can find examples of valid regular expressions below:

Regular expressionValid values
^[0-9]{1,5}$Numbers between 0 and 99999
^-[0-9]*$Negative counting numbers

Device Filters

When used, data only from devices on this list will be processed by the receiver. The device has to be specified by its Device ID. It possible to add more than one device ID. Users can also remove already added device IDs.

Adding a Device to the Filter

First, the users have to click on New device filter. Next, they have to fill in the Device ID and click on Add.

To finish the operation, users have to click on Apply to save the changes to the receiver.

Removing a Device from the Filter

To remove the device, users have to click on the icon  .

To finish the operation, users have to click on Apply to save the changes to the receiver.


Sv translation
languageja

メッセージルールは、さまざまな種類の条件を使用して受信データをフィルタリングするために使用することができます。ルールには2つのタイプがあります:

  • Message content rules
  • Device filters

Message Content Rules

メッセージ内容のルールは、ユーザーがメッセージの内容に基づいてデータをフィルタリングすることを可能にします。

Message Content Ruleの追加

新しいルールを追加するには、[New content rule]をクリックします。ポップアップウィンドウで、フィールド名を入力し、どのメッセージコンテンツルールオプションを使用するかを選択します(下記参照)。1つのルールに複数のオプションを使用することもできます(例:要件とデータの種類を組み合わせる)。条件を準備したら、ユーザーは[追加]をクリックしてルールを保存し、ポップアップウィンドウを閉じます。

最後に、[Apply]をクリックして、Receiverに変更を保存します。

ファイルからのルール読み込み

また、サンプルのJSONファイルやXMLファイルからフィールドを読み込むことも可能です。ルールは、ファイルの構造に従って作成されます。ファイルの各フィールドは必須としてマークされ、データタイプは提供されたサンプル値に従って選択されます。

例:

この内容でファイルを作成します:

Code Block
language java
{"sensorId":"F4-B8-5E-3D-92-91","humidity":45}

または、JSON exampleXML exampleをダウンロードしてください。

次のルールが作成されます:

コンテンツルールの削除

コンテンツルールを削除するには アイコンをクリックします。

[Apply]をクリックして操作を終了し、Receiverに変更内容を保存します。

Message Content Rule オプション

3種類の条件を使い分けることができます:

  • Requirement
  • Type of data
  • Validation Expression

Requirement

この条件を有効にすることで、ユーザーは選択したフィールド名が入力データに存在するかどうかを確認することができます。存在しない場合、そのデータは処理されません。このルールは、フィールド全体が存在しない場合のみ発生することに注意してください。フィールドは存在するが値が空の場合、ルールはトリガーされません。

Type of Data

ユーザーは、選択したフィールドにどのような種類のデータを許可するかを選択することができます。例えば、数値(Integer)のみが有効であることを選択することができます。

  • STRING
  • BOOLEAN
  • INTEGER
  • DOUBLE
  • ARRAY
  • OBJECT

Validation Expression

Validation expressionにより、ユーザーは標準的な正規表現(Regexp)を使用してフィールドのフォーマットを検証することができます。値が式に一致しない場合、そのデータは処理されません。以下は、有効な正規表現の例です:

Regular expressionValid values
^[0-9]{1,5}$0から99999までの数字
^-[0-9]*$負のカウント数

デバイスフィルター

デバイスフィルターを使用した場合、このリストにあるデバイスからのデータのみがReceiverで処理されます。デバイスはデバイスID で指定します。複数のデバイスID を追加することが可能です。また、既に追加されているデバイスIDを削除することも可能です。

フィルタにデバイスを追加

まず、ユーザーは「New device filter」をクリックします。次に、デバイスIDを入力し、「Add」をクリックします。

操作を終了するには、ユーザーは「Apply」をクリックし、Receiverに変更内容を保存します。

フィルターからデバイスを削除

削除するには、アイコンをクリックします。

操作を終了するには、ユーザーは「Apply」をクリックし、Receiverに変更内容を保存します。