Lookup System - Editing Rules

Lookup System - Editing Rules

Lookup System - Editing Rules

Lookup System - Editing

Introduction

Editing rule sets is an advanced topic that requires a solid understanding of PypeServer importing concepts. Training is available by contacting PypeServer support and requesting a session.

Note: Editing rule sets requires a password which is provided during training. Please contact our support team if you do not have the password.

Rule Set Editor

A rule set can be created and managed using the Lookup Manager's Rule Set Editor toolbar, while rules are edited using the Lookup Rule Editor accessed from the Summary tab view of each rule.

Rule Set Editor Toolbar

To display the extended editing toolbar, click on the Rule Set Editor button within the Lookup Manager toolbar. After entering the password, the Lookup Manager toolbar is extended with additional buttons for managing Rule Sets and Rules. Clicking the Rule Set Editor button again will collapse the toolbar and switch back to the Results Editor view.

Graphical user interface, application Description automatically generated

Lookup Manager Toolbar - Rule Set Editor view

Buttons

  • Calculate - Calculate all lookups using the current lookup rule set.

  • Editor - Switches the view between the Results Editor and the Rule Set Editor.

  • Add Lookup Rule - Adds a new lookup rule to the rule set.

  • Delete Lookup Rule - Deletes the current lookup rule from the rule set.

  • Copy Lookup Rule - Creates a new rule from the current lookup rule.

  • New Rule Set - Creates a new rule set.

  • Delete Rule Set - Deletes the current rule set.

  • Copy Rule Set - Clones the current rule set to a new name.

  • Rename Rule Set - Renames the current rule set.

  • Import Rule Set - Imports a previously exported rule set from a file.

  • Export Rule Set - Exports the current rule set to a file.

  • Help - Lookup System documentation.

Start Tab

The rule set Start tab is where to edit comments, add new rules and set the search and replace mode for this rule set.

Graphical user interface, text, application, email Description automatically generated

Rule Set Editor - Start Tab

Search and Replace mode

The Lookup Processor can process rules using a "Stop Processing" mode or a "Continue Processing" mode by tracking whether a part or cut has been previously updated during a lookup.

The default "Stop Processing" mode will not update a part or cut if it had previously been updated by another lookup rule that was processed earlier in the pipeline. This helps prevent the scenario where multiple olet lookup rules are used, and the values found in the lookup from the first rule are overwritten by the second rule.

The "Continue Processing" mode will allow later rules to update parts and cuts that were already updated by previous rules. Using this mode requires careful consideration to ensure that the rules do not replace the same part and cut values. This mode allows one to overlay replacement values using lookup tables for values such as root gaps, number of tabs, or material type.

Rule Tab

A rule tab represents each rule in the rule set. Rule processing order is controlled by dragging the tab to the correct index in the rule set. Rules can be disabled by clicking on the checkbox icon in the tab header.

The rule summary allows editing of the rule name and comments. The Summary section shows the filter queries and replacement mappings for this rule. The Edit Rule button will open the Rule Editor for editing.

Graphical user interface, text, application, email Description automatically generated

Rule Set Editor - Rule Tab

Lookup Rule Editor

The Rule Editor manages all aspects of rule editing and testing using tools hosted in a multi-tabbed form. Click on the "Edit Rule" button from the rule's tab to open the Rule Editor and edit that rule. A Summary tab provides an overview of the rule and tools for editing of the prefilter, lookup filter and replacement mappings. Additional tabs host these tools separately with more detail.

A screenshot of a computer Description automatically generated with medium confidence

Lookup Rule Editor

The Lookup Rule Editor opens to the Summary tab giving an overview of the rule settings and results. A Sample Data drop-down in the upper right corner selects the data used Lookup Processor to evaluate the current rule results. Sample data sets default to the current Import Manager pipeline, with options to use either a static sample set or the last 20 most recently added parts stored in the database. A Calculate button at the bottom of the editor causes the Lookup Processor to reevaluate the lookup rule using the current rule settings.

Prefilters

This editor is available in both the Summary and Prefiltered Part tabs.

Prefilters are used to filter parts and cuts down to just those that should be processed. This allows the Lookup Processor to ignore items that should not be processed. While this filter is optional, creating one reduces the lookup load and improves overall lookup rule performance. For example, prefilters may exclude parts without hole cuts or only include parts made of steel.

A filter may be created for both parts and cuts. Parts are shown at the 'top level" of the grid and the filter panel at the bottom of the grid manages the part filter. Cuts will appear in a detail view when a part row is expanded. This detail view has another filter panel appears that manages the second level "Cuts" filter. Together these filters determine which parts will be filtered out before processing. Any remaining parts and cuts will continue to be processed by the Lookup Processor.

A screenshot of a computer Description automatically generated

Prefilter View

The toolbar contains a set of view buttons. An "Expand/Collapse" button expands and collapses all detail rows. An "All filters" button enables and disables filters for both parts and cuts. A "Restore default layout" button restores the PypeServer default layouts for parts and cuts.

Lookup Table

This editor is available in both the Summary and Lookup Editors tabs.

The Lookup Processor requires a lookup filter to locate replacement values from a lookup table. This filter contains one or more of conditions that are applied to the lookup table for each part and cut in the processing pipeline. Custom Lookup Field functions are used for comparing the values of parts/cuts in the pipeline to those from the lookup table.

During processing the Lookup Processor steps through each part in the pipeline. It retrieves the part/cut values specified in the filter and then applies the filter to the entire lookup table. Any remaining lookup rows are then sorted using the filter's defined sort order and the first sorted row is used for replacement values.

Table Description automatically generated

Lookup Table Editor

Matching lookup rows found during processing are highlighted in green. The toolbar has buttons to add and remove lookup rows and import and export the lookup table using .csv or .xlsx file formats. A drop-down control lists the default table named 'OLETLookup and any other SQL tables assigned to the 'Lookup' database schema. Contact PypeServer support for more information.

Lookup Filters

To be effective a lookup filter must be able to compare values from the lookup table with those from another source such as a part or a cut. This is supported within the Filter Editor using custom Lookup Field functions. When using the Filter Editor, these Lookup Field functions will be found at the end of the functions pick list. When one of these Lookup Field functions are selected the Filter Editor provides a drop-down list of available part and cut fields to use for query values.

Filter Editor - Lookup Field functions

During processing the Lookup Processor will fetch the selected field value from the current part/cut and insert it into the filter condition before applying the filter to the lookup table and retrieve the lookup results.

Results Editor

This editor is available in Lookup Editors tab and is the same one used by the Lookup Manager.

A picture containing table Description automatically generated

Lookup Tab - Results Editor

This editor displays the lookup results found by the Lookup Processor. Source and replacement fields used by the lookup filter are color coded. Any failed lookups are shown as new rows that can be edited. Any changes are automatically saved back to the lookup table for later use. The Lookup System training document provides more information on how to use this editor.

Replacement Mappings

This view is available in both the Summary and Replacements tabs.

A Replacements mapping set is used to update parts and cuts. When one or more lookup table rows meeting the lookup filter conditions are found during lookup processing, the replacement process will use the first lookup row found to replace any part/cut properties with values from the lookup table that have mapped. The mapping set is configured to match the current lookup table and should be reset when another lookup table is selected.

Table Description automatically generated

Lookup Rule Editor - Replacement Mappings View

Part and Cut tabs configure replacement mappings between a lookup column and a part or cut property. The left column lists all available columns in the selected lookup table while the right column lists all available properties for the part or cut. The middle column lists all active mappings for the part or cut. To map a lookup field to a part or cut property, drag a field name from the left column to the middle column. Drag the field name out of the middle column to remove the mapping.

During processing the Lookup Processor will copy the values of the lookup result from the fields in the middle column to the properties in the right column.

Results Views

There are two result views. A part/cut specific Result View on the Summary tab, and multi-part results view on the Results tab.

Result View - Summary Tab

The Result view shows what was replaced by the lookup rule for the part that is currently selected in the Prefilter view. Changed values are highlighted in blue and sorted to appear at the top.

Graphical user interface, table Description automatically generated with medium confidence

Results View

Results View - Results Tab

The Result view shows what was replaced by the lookup rule for all prefiltered parts. This is the list of changed parts/cuts that will be passed back to the Import Manager.

Editing a Rule

This section provides a simple walkthrough of rule design, configuration, and testing.

Starting the Lookup Rule Editor

From the Lookup Manager click the Editor button and enter the password to activate the Rule Set Editor, and either create a new rule set or select an existing rule set to edit. Select the tab for the rule you want to edit and click on the Edit Rule button to open the Lookup Rule Editor.

The editor opens to the Summary tab showing an overview of the rule components with arrows between indicating the data flow through the rule during processing. Each rule component may also be edited from dedicated tabs for a more comprehensive view.

There are three components that define the Lookup Rule: Prefilters, the Lookup filter, and the Replacement mappings. All three components will need to be configured before the Lookup Processor can process the rule and generate reliable lookup results.

Configure Prefilters

Using prefilters is optional but recommended. These can be set in the Prefilter grid view by using the standard filter controls. Parts are 'top-level' items in the grid view and the Part filter is displayed in the at the bottom of the top-level grid view. Cuts are considered 'second-level' items that are displayed as a detail view for each part. The Cuts filter is displayed at the bottom of each of the detail views.

A screenshot of a computer Description automatically generated

Prefilter View

Both the Parts and Cuts filters are evaluated so a part will be filtered out if the Cuts filter results in no cuts being available for that part. For example, a part with no hole cuts will be filtered out when a Cuts filter of "Cut.Type = Hole" is evaluated for that part.

Configure Lookup Filter

A lookup filter is required to locate replacement values for a part or cut and is configured using the Lookup Table Editor. Using the editor select the desired lookup table from the drop-down list and set the filter conditions using the filter editor at the bottom of the grid view. Use the custom Lookup Field functions to select what part or cut values to evaluate during processing to produce the lookup results for that part. The lookup filter is cleared when a new lookup table is selected.

Graphical user interface, text, application Description automatically generated Lookup Table Editor - Filter enabled

Lookup Table Editor - Filter disabled

While the lookup filter is enabled, the table will only display results for the currently selected part in the Prefilters view. Selecting a different part from the Prefilters view will update the lookup results using the values from the selected part and its cuts. Disabling the lookup filter shows all the rows in the lookup table for review and editing.

Configure Replacement Mappings

Replacement mappings are required to replace part and cut values with the results from the Lookup Filter. The Replacement Mappings Editor has a Part and Cut tab to configure replacement mappings for both parts and cuts.

Table Description automatically generated

Lookup Rule Editor - Replacement Mappings View

Use the Part and Cut tabs to configure replacement mappings between a lookup column and a part or cut property. Dragging an item from the left column to the middle column will map a lookup field to a part or cut property while dragging the field name out of the middle column will remove the mapping.

During processing the Lookup Processor uses the active mappings defined by the right-side grid view.

Testing

Once the filters and mappings have been configured rule processing should be validated using sample data sets that can be selected from the drop-down in the upper right corner of the Rules Editor.

The Prefilter views on the Summary and Prefiltered tabs should be reviewed to validate that the expected parts and cuts are visible. Only parts or cuts that appear when the filters are applied will be processed.

Use the Lookup Table and Results editors in the Summary and Lookup Editors tabs to validate the lookup table results for the sample data. Carefully review any empty rows that could be an indication the lookup filter might be incorrectly configured, or the lookup table might have incomplete data.

Review the Results views on the Summary and Results tabs to validate what replacements will be done by using the Replacement Mappings.

After rule has been validated using the Rule Editor, use the Import Manager with no rule set selected to import some parts, and review the results in the staged parts view. Then enable the lookup rule and import the same data again. Compare the results between the two imports to confirm the rule is functioning correctly.

    • Related Articles

    • Lookup System

      Lookup System Lookup System Introduction The importing lookup system can be used to selectively update parts and cuts with values queried from lookup tables. One or more Lookup Rules are configured as Rule Sets to filter a list of parts, query a ...
    • System Requirements

      The article lists the recommended configurations for PypeServer Enterprise in a production environment. Hardware Kiosk The PypeServer computer is stored in a industrial kiosk stationed next to the cutting machine. I has the following minimum ...
    • Enterprise Training - Importing

      Introduction to Importing Importing files into PypeServer Using the importing system to import part designs into PypeServer v3.03 Importing Into PypeServer Document on the importing data into PypeServer Describes the activities and rules in importing ...
    • About SQL Server

      About SQL Server Microsoft SQL Server is a relational database management system (RDBMS). PypeServer Enterprise and tools connect to a SQL Server instance or database, where all part, pipe, and other shared data is stored. The PypeServer Kiosk ...
    • Importing PCF files

      Importing PCF files Using PCF Files from CAD to PypeServer This document explains the meaning of data in a PCF file and how to structure it to get the best flow of data from your CAD system/workflow into PypeServer. Contents 1 Configuring your CAD ...