Brick custom rules

The JSON file generated as part of the import process contains a list of rules to be included in the Brick tag dictionary. If desired, you can add to or override the default rules with a custom rule set.
To add or override the default rules with a custom rule set, you create their own JSON rules file and select it in the Select a JSON file for custom rules (optional) field in the Generate Brick Dictionary dialog window.

The brick module contains the default JSON file brick.json. You can view it in Workbench by opening it in the Nav tree.

Image

The existing Brick tag rules are defined in the rules object. The custom rules are defined as a JSON object with that same format. There is one JSON element for each Niagara property in a tag rule. Each tag rule has an entry for “name”, “condition”, and then at least one entry for “tags”, “tagGroups”, or “relations”. These in turn have JSON elements for each of their respective Niagara properties.

 NOTE: It is possible to declare a tag rule to be assigned to a specific Niagara type, which allows you to develop any custom rules necessary as JAVA classes. 

An example of a custom rules file for three custom rules:
{
  "rules": [
    {
      "name": "id",
      "condition": {
        "type": "tagdictionary:IsTypeCondition",
        "objectType": "control:ControlPoint"
      },
      "tags": [
        {
          "name": "id",
          "type": "brickTest:BrickCustomIdTag",
          "validity": {
            "type": "tagdictionary:IsTypeCondition",
            "objectType": "control:ControlPoint"
          }
        }
      ]
    },
    {
      "name": "enableStatus",
      "condition": {
        "type": "tagdictionary:IsTypeCondition",
        "objectType": "control:BooleanPoint"
      },
      "tagGroups": [
        {
          "name": "enableStatus",
          "tags": [
            {
              "name": "enable"
            },
            {
              "name": "point"
            },
            {
              "name": "status"
            }
          ]
        }
      ]
    },
    {
      "name": "hasQUDTReference",
      "condition": {
        "type": "tagdictionary:Always"
      },
      "relations": [
        {
          "name": "hasQUDTReference",
          "type": "brickTest:BrickCustomQUDTRelation"
        }
      ]
    }
  ]
}
  • The first id rule declares the condition as any ControlPoint, and the tag id will be applied. This tag has a custom JAVA implementation declared as a BrickCustomId type in a brickTest module. The JAVA class for this would be named BBrickCustomId.
  • The second enableStatus rule has a Boolean Point condition and adds a tag group that contains the enable, point, and status tags.
  • The third hasQUDTReference rule has an Always condition and adds a relation with a custom BrickCustomQUDTRelation type in a brickTest module.