Rule Sets

Overview #

In edgeSuite versions 3.3 and higher, Rule Sets have been enhanced to support expressions. This allows for more complex rules that check values in multiple attributes using AND/OR operators.

Rule Sets are a collection of rules that are used to map values in the data to a visual presentation. Rule Sets are set up to be reusable across all Visualizations, specifically by renderers used inside of those Visualizations. It is the renderer’s job to apply these rules to the individual records that are being used by a Visualization. A sample Color Rule Set is shown below.

Manage Rule Sets #

The Manage Rule Set page can be accessed through System Menu > Rule Sets, or by using the ruler icon located in the Admin toolbar on the left hand side of the screen.

The user interface shows all the Rule Sets in the system, and supplies some additional information about each one.

Refresh Reload the Rule Sets from the server.
Add Add a new Rule Set to the system.
Edit

Modify an existing Rule Set.

Editing a Rule Set that is already used by renderers could adversely affect existing Visualizations.

Clone Copy an existing Rule Set. Provides a way to copy the rule logic, and use it for a different renderer type. For example, A complex set of rules written for an Icon Renderer can be cloned and then re-used for a Text Renderer.
Delete

Remove a Rule Set from the system.

If a rule is marked as in use, it cannot be deleted. Click on the in use note to see where it is being used.

Configuring a Rule Set #

When Adding or Editing a Rule Set, an administrator will use the same wizard. See the sections below for more information on each step.

 

Step 1: Name #

This step provides important meta information about the Rule Set. All of these values are exposed in the Rule Set Manager.

Name #

Rule Set names are not required to be unique within the system. This means that naming convention can be important on larger deployments. For example, it’s possible to end up with multiple Rule Sets all named “Status”. That can make maintaining larger deployments challenging.

Description #

This property was added as of version 3.3 to help administrators provide additional information for a Rule Set. The description field can be used to help differentiate Rule Sets with the same name, or just provide some information on how the Rule Set is intended to be used.

Rule Mode #

There are two methods for writing rules in edgeStuite. There is a graphical approach, which lets administrators create rules using a graphical user interface. There is also a more advanced JavaScript option, for administrators who prefer working in JavaScript.

Graphical mode provides better Rule Set validation. JavaScript mode provides only basic syntax validation, and should only be used by advanced administrators.

Graphical Mode #

Graphical mode uses a Graphical Expression Builder to enter rules. This is a safer option, and provides more validation.

JavaScript (Advanced) Mode #

JavaScript mode requires JavaScript code. This option provides a lot of flexibility, but offers limited validation. This option is intended for advanced administrators. Additional information for JavaScript rules can be found here.

You can convert graphical Rule Sets into JavaScript Rule Sets. Doing so will automatically convert all the graphical rules into JavaScript. This is a one-time change. Once graphical rules are converted into JavaScript, you will NOT be able to convert them back.

Step 2: Variables

Each variable represents a unique data attribute used to drive the various rules within a Rule Set. Rule Sets can be reused across different datasets, so actual attribute names that contain values for the Rule Set are unimportant at this stage. The attribute names will be mapped into the Rule Set later on, when configuring a Renderer inside of a Visualization (see “Renderers” for more information).

While real attribute names are not required yet, it is important to have an understanding of the data that will be available in those attributes so variables can be typed correctly. Take a set of status icons for example – will the status values be represented by numbers or strings? Declaring variables on this step is very similar to declaring variables in most programming languages.

Name

This is how the variable is referenced. It is what will be used within the individual rules on the next step.

Type

This identifies the data type expected by the variable; String, Number, Boolean, or Date. This ensures that only attributes with valid data types are used to drive this rule.

Step 3: Rules #

Rules define the logic that map values in the data to a specific presentation. In edgeSuite versions 3.3 or higher, Rules support expressions that allow comparison of multiple attributes. New conditions can be added by clicking the ” + ” button.

Renderer Types #

Rule Sets are set up to work with specific Render Types, such as Color, Font, and Icon Renderers. The Renderer Type will affect the preview displayed at the top right of each rule (as shown below).

Cloning a Rule Set provides a way to copy the rule logic, and use it for a different renderer type. A complex set of rules written for an Icon Renderer, for example, can be cloned and then reused for a Text or Color Renderer.

Color
Font
Icon 

Link Style

Link Weight

 

Color Rules #

Color rules will have a color swatch at the far right.

The following is an example of a Color Rule used to determine the background color of individual cells in a Table Visualization, representing “heat”.

Font Rules #

Font rules will show a sample text string at the far right. This preview shows what the currently configured style looks like.

To conserve space for rules, font size is not depicted in the preview.

The following is an example of a Font Rule that alters text color based on an overall ranking.

Below is an illustration of the Font Rule Set (above) and the Color Rule Set (above) being used together inside of a Table Visualization’s cell renderer:

  • The Color Rule Set is used to determine the Background Color.
  • The Font Rule Set is used to determine the Text Style.

Icon Rules #

Icon rules will have an icon preview at the far right.

Note:  Prior to edgeSuite version 3.3, Color Rules were included as part of an Icon Rule. When upgrading from earlier versions of edgeSuite, color will get split out of icon rules into turned into a Color Rule Set. The new Color Rule Set will be mapped to the new renderers automatically. This enhancement allows the color of an icon to be driven independently. This means that the attribute that determines color can be different from the one that determines what the icon should be.

Note: Color Rules only affect the stock SVG icons that ship with edgeSuite. Custom raster icons added to the system do not work with Color Rules at this time.

The following is an example of an Icon Rule Set that maps a president’s name (STRING) to a set of custom icons depicting presidents. See Custom Icons for more information on adding custom icons to edgeSuite.

Expressions #

The following is an example of an Icon Rule Set that evaluates multiple attributes as part of an expression. Because it uses an AND operator, all conditions must be true for the rule to be satisfied.

In the example above, you will only see the ” X ” icon (top right) in a Visualization when all three of the are conditions are met.

  • Status = Critical
  • Environment = Production
  • Maintenance = 0
Note:  The rule above will need a dataset that contains three attributes with appropriate data types.