Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Diagrams

Mapping an Owner Database Attribute

  • Last UpdatedMar 27, 2024
  • 3 minute read

A mapping can be set up using an XPath expression so that when an element is imported its Owner attribute is automatically set.

In this example a mapping will be set up which will result in the owner attributes of equipment elements (SCEQUIPMENT) being set automatically on import. This will result in equipment elements being assigned to the correct group (SCGROUP) within the database hierarchy, rather than to the default group for equipment. If this group does not exist, it will be created automatically.

Groups in this example are identified by single letters, which will be derived from the first character of the name of the equipment (their Tag attributes).

  1. Using the Attribute Mappings dialog, create a new mapping and name it appropriately.

    In the Element Types field, select the SCEQUIPMENT element.

    From the Database Attribute field, select the Owner attribute.

    Leave the Condition field blank.

    For further information, refer to Create Attribute Mappings.

  2. Click on the ... option in the Source Attribute field.

    The XPath Expression Builder dialog is then displayed, with the SCEQUIPMENT element listed in the Source Dictionary pane.

  3. Double-click on the Tag attribute of the SCEQUIPMENT element.

    The attribute is then displayed in the Expression pane.

  4. Place the cursor in the Expression pane in front of the Tag attribute:

    Double-click on the substring function in the XPath Functions tab.

    The substring function is then added to the expression, with the Tag attribute as its subject.

  5. After the first comma, enter the start position of the substring within the string (that means, within the Tag attribute), in this case 1. After the second comma, enter the length of the substring, in this case also 1. This will result in the first character only of the Tag attribute of equipment being selected.

  6. The expression is now complete. Select the OK option then save it and close the dialog. The expression is displayed in the Source Attribute field of the main Attribute Mappings dialog.

  7. From the Attribute Type field select dbelement, which indicates that the mapping will generate new elements.

  8. When an equipment element is imported, the mapping will refer to the name (Tag attribute) of the equipment. It will take the first character of the equipment and create a new group (if necessary), using that character as the group’s name, and will set the Owner attribute of the equipment as that group.

TitleResults for “How to create a CRG?”Also Available in