Schema Editor Naming Rules - Integration - Update 44 - Help - Hexagon

Integration Help

Language
English
Product
Integration
Search by Category
Help
Smart 3D Version
12.1 (2019)
Smart Construction Version
2019(7.0)
SmartPlant Foundation / SDx Version
10
Smart Electrical Version
2019 (9.0)
Smart Materials/Smart Reference Data Version
2020 (10.0)
Smart P&ID Version
9 (2019)
Smart Review Version
2020 (15.0)
Smart Engineering Manager Version
10 (2019)
Smart Interop Publisher Version
13.1 (2019 R1)
Smart Isometrics Version
7.0(2019)
Spoolgen Version
9.0(2019)

You can create name display rules from the MetaSchema Extension environment in the Schema Editor. Name display rules define how names of objects are displayed in the Schema Editor user interface. You can also create name display rules by double-clicking the NameDisplayRule node in any meta schema view in the Schema Editor.

Objects As Schema Versus Objects As Data

The Schema Editor can be used to view objects as data and to view objects (meta-schema and schema objects) as schema. When objects are viewed using the Schema Editor, those objects are viewed as data. However, under certain circumstances schema and meta-schema objects are presented as schema.

In the following example, a meta-schema object (ISchemaObj) displays as both data and schema. In the tree view, ISchemaObj displays as data. When displayed as data, properties of that object (as well as relationships (edges)) from that object are depicted. In the tree control, the relationships (edges) for ISchemaObj display.

In the Properties window, ISchemaObj is shown as a data object with both properties and relationships (edges) for ISchemaObj.

SchemaEd Editable Meta Schema

In the Properties windows, the text ā€œSchema Objectā€ displays with a dark background. Below it are a set of property names (ā€œDisplay Nameā€ through ā€œAnalysis Commentā€). ā€œSchema Objectā€ is the DisplayName for ISchemaObj, ā€œDisplay Nameā€ is the DisplayName for DisplayName, ā€œAnalysis Commentā€ is the DisplayName for AnalysisComment and so on.

For this display (ā€œSchema Objectā€ through ā€œAnalysis Commentā€), ISchemaObj display as schema. Note that the display of ISchemaObj as schema is different than the display of ISchemaObj as data (contrast the property names in the tree control (AnalysisComment through SchemaVer) with the corresponding names in the Properties control (for example, Analyis Comment).

When defining rules on how to display object names, you have the flexibility of defining whether the rule applies to display of objects as data objects or display as schema objects.

Applicable Name Display Rule

The meta-schema is seeded with two default name display rules. One rule applies when an object is viewed as data and one rule applies when an object is viewed as schema. If no other name display rules are defined, these two rules will be used to determine how to display object ā€œnamesā€ throughout the Schema Editor.

You can define a default name display rule that overrides one of these meta-schema defined rules. In this case, the user-defined rule will supersede the meta-schema rule and will be applied to all objects. Note that two default rules, one for display as data and one for display as schema, would need to be defined to completely override the meta-schema defined rules.

You can define a name display rule that applies to a specific class definition. In this case, whenever an object of that particular class definition is displayed, it will be displayed using that specific rule.

Extending the MetaSchema with Name Display Rules

When determining the name display rule that is to be used, the following logic is used:

  • Locate the class definition for the object being displayed.

  • Get the applicable display rule for that class definition and whether the object is being displayed as data or as schema.

    • Locate an explicit rule for that class definition and display mode (ā€œas dataā€ versus ā€œas schemaā€).

    • If no explicit rule is found, locate a user-defined default rule for that display mode.

    • If no user-defined rule is found, use the meta-schema defined rule for that display mode.

This process of locating the rule that applies is done by searching the container composition for the class definition for a match on either the explicit class definition or the user-supplied default rule. Since the container composition for the class definition is searched, name display rules that are defined as part of the schema will not be applied to the display of schema objects since the class definitions for the schema objects are part of the meta-schema and not part of the schema. Therefore, if name display rules are to be applied to the display of schema objects using the Schema Editor, these name display rules must be defined as meta-schema extensions and not as schema.

To define name display rules as meta schema, do the following:

  1. Open the Schema Editor.

  2. Click File > New > Schema File to create a new schema file (.xml extension).

  3. Create the desired name display rules.

  4. Exit and save the schema file.

  5. Manually edit the .xml file and change the Scope property from Schema to MetaSchema.

After these steps are performed, start the Schema Editor, by selecting the MetaSchema tab and loading the XML file as the meta-schema extensions file.

The Schema Editor is normally used to view and edit schema and map (tool) schema. For both the schema and the map schema, the class definitions for the displayed objects are part of the meta-schema and any name display rules that are defined must be done as meta-schema extensions to apply. Occasionally, the Schema Editor is used to view data files. For this case of viewing data files, the name display rules need to be defined as part of the schema rather than the meta-schema because the class definitions for the data objects are part of the schema not the metaschema.

The schema class definition PIDPipingComponent is an instance of ClassDef, which is a meta-schema class definition. Likewise, IPipingComponent is an instance of InterfaceDef (a meta-schema class definition) and NominalDiameter is an instance of PropertyDef (a meta-schema class definition). Therefore, to define a name display rule that impacts how the Schema Editor presents PIDPipingComponent, that rule must be added as a meta-schema extension to apply.

Valve V-100 is an instance of PIDPipingComponent (a schema class definition). Therefore, to define a name display rule that impacts how V-100 displays using the Schema Editor, that rule must be part of the schema (not a meta-schema extension).

New MetaSchema Objects for Name Display Rules

A new class definition NameDisplayRule has been added to the meta-schema to support the definition of name display rules.

SchemaEd Editable Meta Schema2

In the example, NameDisplayRule includes IObject, INameDisplayRule and ISchemaObj. INameDisplayRule exposes the following property definitions.

  • ClassDefForName (string128) ā€“ this is the explicit class definition for which the rule is being defined or ā€œDefaultā€ (if the rule is to be applied for all cases where there is no explicit definition for the class definition).

  • IsSchemaRule (boolean) ā€“ indicates whether the rule applies to displaying the object as schema (True) or as data (False).

  • CombineNames (boolean) ā€“ indicates whether the displayed ā€œnameā€ for the object is made by combining the individual property values (delimited by ā€œ/ā€) or whether the first applicable property value is to be used (False).

  • DisplayNameRule (string) ā€“ delimited string that identifies the property values to be used in the ā€œnameā€.

DisplayNameRule Property Value

The DisplayNameRule property value is formed by delimiting the property values to be used for the name by commas. Therefore, if the name display rule involves three properties, the information for each of those properties will be separated by commas.

For each individual property, the following information is stored in the DisplayNameRule property value. Each piece of information is separated from the others using a tilde (~) delimited.

  • Edge definition to traverse from the displayed object to get to the object with the property to be displayed. Normally this value is a null string.

  • Interface definition containing the property definition.

  • Property definition whose value is to be used for the ā€œnameā€.

  • Boolean flag (persisted as either ā€œTā€ or ā€œFā€) indicating whether the property value is to be included in the name display even if that property value is a null string. This flag only applies if the rule indicates that the property values are to be combined to form the ā€œnameā€ (such as, CombineNames is True).

GUI for Viewing and Defining Name Display Rules

Since a name display rule is an instance of the NameDisplayRule class definition, one way to view name display rules is to select the NameDisplayRule class definition from the Select Classes to Display dialog box.

SchemaEd Select Classes to Display

Alternatively, the Rules and Constraints entry from the class list selection dialog box can be used to view the name display rules.

SchemaEd Select Class List

The edit for NameDisplayRule objects is shown below.

In the New Name Display Rule dialog box, the Scope for Rule window determines the scope of applicability from the rule. In this particular example, the scope has been defined to be for class definition ClassDef when displayed as data.

The name display rule for the specified scope is defined in the Rule area. The options at the top of this area indicate whether the first defined property value is to be used or whether the property values are to be combined to form the ā€œnameā€.

The list of properties to be included in the ā€œnameā€ displays in the grid control. If only one property value is to be included in the ā€œnameā€, then the first of these that apply for a particular object will be displayed as the ā€œnameā€. For example, if there exists a MapClassToClass relationship for the ClassDef object (at least one tool schema has been opened and loaded) and Name is defined for that map class, then that value will be used as the ā€œnameā€. If no MapClassToClass relationship exists or the map class does not have a Name value, then the rule identifies that the Name for the class definition object. Finally, if Name is not be defined for the class definition, then the UID is used.

  • Select Move Up and Move Down to reorder the properties in the rule.

  • Click Remove to remove a property from the rule.

  • Click Always Include to toggle between always including the property in the ā€œnameā€ versus only including the property if it has a non-null value. This Boolean value only applies if the rule says that the property values are to be combined to form the displayed ā€œnameā€. Note that the Always Include text will change to Include If Defined if the selected property has a True value for this flag.

    SchemaEd NewNameDisplayRule

  • Click Add to add a property to the rule. The Select Property to Add to Rule dialog box displays. Expanding the tree for this interface definition shows the properties for that role (as well as the edges for that role).

    SchemaEd Select Property to Add to Rule