Home Search

DriveWorks Pro 22
Rules Builder

Send Feedback

Rules Builder

The rules builder is divided into four sections:

  1. The command bar at the top.
  2. The rule editor in the middle.
  3. Help and diagnostics at the bottom.
  4. Browsers for variables etc on the right.

The Command Bar

The command bar has the following buttons:

Functions

Provides access to the various functions that can be used in rules in the form of simple wizards. Common functions can be quickly accessed by clicking the drop down at the bottom.

Revisions

Shows previous versions of the current rule and their comments.

A revision is stored when a rule or comment is first applied (on clicking the OK button after a rule or comment is entered).

Each subsequent change to the rule or comment will store a new revision.

Revision history stores the following information:

  • The Date and Time of the change
  • The Rule
  • Comments
  • The User (logged in to DriveWorks) who made the change

Double clicking a revision will replace the current Rule and Comments with the selected item.

Revisions can store a maximum of 2000 characters for the Rule.

If the Rule is over this the rule will be truncated to the first 2000 characters in the revision history.

A warning message will be displayed in the rule window when the rule will be truncated in the revision history.

Reverting back to a revision that has been truncated will replace the current rule with the truncated version/

Revision information is stored in the Group.

File

Shows a file browser dialog which can be used to easily insert the name of a file into your rule.

Quick Text

Provides a clipboard which can be used to save bits of rules that you commonly use.

Quick text is saved on your machine so that you can use it across projects to simplify writing similar rules.

Quick Text also provides access to Special Variables by clicking the drop down at the bottom.

Tables

Shows the tables that are in the project so that they can be used in rules.

Clear

Clears the contents of the Rule Editor.

Settings

Enables you to customize the fonts and colors used to display rules, and create multiple profiles.

See Rule Builder Settings for more information.

Help

Opens the Help file.

OK

Saves the current rule.

Cancel

Cancels the current changes.

The Rule Editor

The rule editor is where you work with a rule, you can either type your rule directly in the rule editor, or use the function wizards and browsers on the rule builder to insert into the rule.

Rules can be written on a single line or span multiple lines.

Line numbers can be displayed in the Rule Editor window, see Show Line Numbers for more information.

The rule is automatically colored and formatted by DriveWorks using settings which you can modify by clicking the Settings button on the command bar. By default, if the rule is invalid, the background color changes to a light red, and if it is okay, then the background changes to a light green.

All colors are fully customizable, please see Rule Builder Settings for more information.

Auto-Complete

Autocomplete provides all functions, constants, variables and table names in a pop up window that is filtered as you type in the rule editing window.

Selecting an item from the autocomplete pop up is done by clicking on the required item using the mouse or by using the up/down keyboard arrows to highlight the required item and hitting return, tab or space (places a space after the selected item) keys.

Bracket Matching

Bracket matching provides a clear indication of opening and closing parenthesis within rules.

Place the cursor in front or behind any bracket within a rule and bracket matching will highlight the chosen bracket and the bracket it is paired with.

The highlighting color can be fully customized in the settings dialog of the rule builder.

Rules Insight

Rules insight gives clear instructions on the arguments required for any function when manually entering the rule in the rule editor window.

As each argument is entered, rules insight highlights in Bold what the next argument should be, giving examples where appropriate.

When typing Functions in the Rule Builder rules insight can be closed by hitting the Escape key on the keyboard.

Rules insight will return when an argument is required, hitting Escape again will close rules insight.

Right Click Menu

Further functions are available from the right-click menu in the rule editor window.

Many functions, available in the Rules Builder, also have keyboard shortcuts, please see Rule Builder Shortcuts for more information.

The functions available depend on the selection made prior to the right-click.

Edit Variable

Available when a variable is selected. Allows the rule of the selected variable to be edited in a separate rule builder window. See Edit Variables for more information.

Extract Variable

Available when highlighting a portion of the data. Allows the selection to be extracted to a new variable. See Extract Variables for more information.

Replace In Rules

This is available when highlighting a portion of the data.

Replace In Rules will perform a search, in the Project, of all instances where the highlighted portion occurs.

Any or all found instances can then be replaced with a modified value.

For example:

The SelectedMaterial (User Form Control) has been modified to allow Full Gloss to be selected, previously the selection was Gloss.

The Project requires every reference of Gloss updating to Full Gloss.

  1. With a rule that contains the term to be modified open in the Rule Builder, select the portion of the rule to be changed.

    Right click on the highlighted portion, and select Replace In Rules.

  2. Make the modification to the rule, in the Replacement rule section of the Replace in rules dialog.

    Click the Find Rules button.

  3. Review the rule instances in which the highlighted portion was found.

    De-select any instance that is not required to be changed.

    When the review is complete, click OK to apply the changes.

    Replace in rules dialog

    The results are displayed with the following information:

    • Selection

      All found occurrences will be selected by default. To exclude an occurrence from the change uncheck this column.

    • Name

      This is the name of where the occurrence was found.

      For instance: the name of a Variable, a Control Property, a Document or Model Parameter, etc.

    • Old Rule

      This displays the existing full rule, with the portion that has been found highlighted.

    • New Rule

      This displays the modified full rule, with the portion that will be modified highlighted.

    • Type

      This is the parent type.

      For instance: Variable, Control, Document or Component Sets, etc.

    • Location

      This is the full path to where the occurrence was found.

    The filter box allows the results to be filtered.

    For example:

    To display just variables, enter:

    Type: Variables

  4. Click OK in the Rule Builder.

This feature is also available when Extract Variable is used.

Find All References

Available when a named reference is selected. Will return a list of every rule in the project that uses the selected item. The Usage results can then be modified.

Cut, Copy, Paste, Delete

Provides standard cut, copy, pasted and delete functions.

Find/Replace

Provides Find/Replace functionality for the current rule editor window.

Select All

Will select all data in the rule editor window.

Help and Diagnostics

There are up to six tabs on the help and diagnostics section depending on the kind of rule being built:

Help Tab

When building Model or Drawing rules the help tab displays useful information about the type of rule you are building.

This enables you to quickly see what the result of the rule needs to be to achieve the desired outcome. For example when building a rule for a model feature the rule needs to be "Delete" or "Suppress"

The help tab is not shown for control properties, variables or document rules.

Values Tab

The Values tab shows the key values used to arrive at the result of the rule.

Steps Tab

The Steps tab shows the steps taken along the route of the rule to arrive at the result.

Each step is numbered in the order it was evaluated (1 being the first).

Drill Down Tab

The Drill Down tab brings in the rules used in any Variables or Controls used in the current rule.

This allows complex rules to be thoroughly analyzed without leaving the current rule.

Table Visualization

Tables and arrays used in a rule, or resulting from the rule, can be visualized in the Rule Builder.

The visualization contains the entire table and is useful to:

  • Identify columns and rows that may be required for the rule.
  • See any values being extracted from the table.

From the Drill Down tab of the Rule Builder:

  1. Expand the rule step that contains the Table.
  2. Click on the Show Table icon.
  3. Click the icon again to hide the table.

Open the Table in a new window

The table can be opened in a new window by clicking the Open in new window icon.

Show Rule Evaluation Path

When a Drill Down node is selected (from the Drill Down area) the origin of the rule is highlighted in the Rule Editor window (see image above).

This allows any unusual results found in the Drill Down step to be identified in the actual rule.

Right Click

Right clicking on a Drill Down step will display a menu with the following items:

  • Edit Variable

    Available when a Variable reference (green background) is selected.

    Allows the selected Variable to be edited in an additional Rule Builder.

  • Copy

    Will copy the selected rule.

  • Copy Value

    Will copy the selected rule value (result).

Color Coding

DriveWorks color codes each broken down step of the Drill Down.

The colors used are the inverse of those applied in the Display Item Settings. The color applied to the Foreground Color setting becomes the background color in Rule drill Down.

The result (if applicable) of each item is also shown within the background color.

Display ItemDescriptionDefault Background ColorPreview
FunctionThe color of any DriveWorks function used in the rule editor.
ReferenceThe color of any Constant, Variable, Special Variable, Table, Control value or hierarchical reference used in the rule editor.
BooleanThe color of any TRUE or FALSE value used in the rule editor.
NumberThe color of any numeric value used in the rule editor.
StringThe color of all strings within quotes " " used in the rule editor.
OperatorThe color of any valid operator (+, -, *, /, <, >, =, etc.) used in the rule editor.

Comments Tab

The comments tab provides an area where notes about the rule can be entered.

The comments tab will be headed Comments (Empty) if a rule has no comments.

When a comment is changed a revision is created. See Revisions for more information.

Please Note

Comments are stored in the Project file, this is copied and loaded with each Specification.

When using Child or Hosted Specifications, each Specification will copy and load its own Project file simultaneously.

We recommend keeping each comment to an absolute minimum, so performance is not affected.

For example:

100 characters used in a comment adds between 0.1Kb and 0.4Kb to the size of a Project (and Specification) file.

If this occurs in 250 rules, the file size could increase by 100Kb.

If 10 Child or Hosted Specifications are running the excess caused by the comments is now 1Mb.

If this is run through DriveWorks Live where 10 users are running the 10 Child or Hosted Specifications, this is now 10Mb extra that the Server needs to process.

Function Wizard Tab

The Function Wizard tab appears when a function is selected from the Functions button.

The name of the tab changes to the name of the function selected.

The wizard for each function provides assistance in providing the necessary information for the function.

See Common Functions for more information on the functions that are available.

Browsers

There are up to six tabs on the browsers section depending on the kind of rule being built:

Each list can be filtered by using the filter at the top of the list.

Please see the topic How To Use Filters for more advanced filtering information.

  1. Controls - Shows all of the controls in the project. You can filter to a specific form to find a control, and double click it to use its return value in the rule. You can also single click the control and double click one of its other properties to use that property in the rule.
  2. Variables - Shows all of the variables in the project. You can use the search box to find the variable you are looking for, and double click it to use it in the rule.

    Variable categories in the rule builder remain persistent when opening and closing the Rule Builder.

    When building rules it is common to reference variables from the same category.

    The Rule Builder will retain the last used view for Variables when it is reopened.

  3. Constants - Shows all constants in the project. You can use the search box to find the constant you are looking for, and double click it to use it in the rule.

    Constant categories in the rule builder remain persistent when opening and closing the Rule Builder.

    When building rules it is common to reference constants from the same category.

    The Rule Builder will retain the last used view for Constants when it is reopened.

  4. Messages - Displays all messages created in the Form Messages stage, for use within a rule.
  5. Components - Only shown for model file name rules, for more information see How To: Replace a Component With a Static or Driven Replacement Model.
  6. Replacements - Only shown for model file name rules, shows any models that have been captured as Replacement Models.