Example: Creating and Mapping a String Property for Smart Electrical - Intergraph Smart Electrical - 10 - Customization & Programming - Intergraph

Intergraph SmartPlant Enterprise Adapter for Smart Electrical

Language
English
Product
Intergraph Smart Electrical
Search by Category
Customization & Programming
Smart Electrical Version
10

The following example demonstrates how to perform the following tasks:

  • create a new system code property for multiple plant items in Smart Electrical.

  • extend the SmartPlant schema to create the custom system code property and create publish mapping relationships so that Smart Electrical can publish the property so that it can be retrieved by other tools.

The Smart Electrical database already contains a property named SystemCode, so you cannot create another property with the same name. Therefore, in this example, you will create a property in Smart Electrical called SystemCode1 that will map to the SystemCode property in the SmartPlant schema.

Before You Extend the Smart Electrical Database

  1. Make a backup of the SmartPlant Foundation site database and any vaults for the site.

  2. Make a backup of the Smart Electrical database and the SPELMap.xml file located in the SmartPlant resources directory.

Create the New SystemCode1 Property in Data Dictionary Manager

  1. Click Start > All Programs > Smart Engineering Manager > Data Dictionary Manager.

  2. Connect to the appropriate plant server for Smart Electrical.

  3. In the Database Tables list, select Plant Item.

  4. On the toolbar, click Add Property .

    11SPELAddPropertyCmdMOD

  5. In the Add Property dialog box, define information for the System Code property, being sure to select String in the Data Type list. Click OK.

  6. Click File > Save to save your changes in Data Dictionary Manager.

  7. Click File > Exit.

Launch Schema Editor and Load the Smart Electrical Tool Map Schema

The ICustomInterface must be realized by the class definitions that represent objects in this authoring tool that will be publishing or retrieving the custom property. If you have not configured ICustomInterface, see Creating a New Interface for Mapping Examples for more information.

  1. In the Desktop Client, set your scope for the applicable plant, and then find the CMF file.

  2. Right-click the CMF file, and then click Edit > Check Out.

  3. Click OK in the Check Out dialog box.

  4. In the New Items window, right-click the new version of the CMF file, and select Launch Schema Editor.

  5. On the Set Active Configurations dialog box, select the schema version that you want to view.

  6. Click OK to set the configuration.

    The CMF file must be checked in to SmartPlant Foundation before users can publish from an authoring tool.

    • For more options, click Advanced on the Set Active Configuration dialog box.

    • By default, changes to the SmartPlant Schema are written to all versions managed by the CMF file. You can choose to write changes to only selected versions; however, that is not recommended.

      If you choose to view one version of the schema (Specify configurations to display window) but write changes to all versions (Set Configurations for new objects window), an information window appears when you click OK, indicating that you will be prompted with every change to the schema to confirm that you want to write the changes to all versions. Click OK to continue. In the Schema Editor, click File > SmartPlant > Edit Engineering Tool Options, and select Smart Electrical in the list of authoring tools to load the Smart Electrical tool map schema.

  7. Under Startup options, select the Load map schema and Connect to application schema check boxes, and click OK.

  8. In each row in the Synchronize dialog box, the values in the tool database and tool map schema columns indicate actions to correct inconsistencies between the tool metadata and tool map schema. Select the appropriate action in each row, and then click OK.

    • Each row represents a discrepancy between the tool database and the tool map schema.

    • Default actions are blue when the Synchronize dialog box appears. However, if you select a different option, it will become blue instead.

    • In many cases, only one operation is supported to synchronize the tool database and tool map schema. For example, if a new property was found in the database, the metadata adapter can add the property to the tool map schema, but it cannot remove the property from the tool database.

      11SPELSysCodeSynch

  9. In the Map Environment, expand Smart Electrical > Loaded Map Schemas > Smart Electrical Tool Schema.

  10. Expand Map Classes, and right-click Motor.

  11. On the shortcut menu, select Edit Motor.

  12. In the Edit Map Class Definition dialog box, select the Publish tab.

  13. Click New Property Definition on the toolbar above the Unmapped SmartPlant properties section on the right side of the dialog box.

  14. In the New Property Definition dialog box, define the new SmartPlant schema SystemCode property.

    CreateSystemCodePropertyDBPic

    • In the Exposed by interface definitions dialog box, click Browse, and select ICustomInterface as the interface definition that exposes this property.

    • In the Scoped by property type box, select string.

  15. Click OK.

  16. Under Unmapped application properties, select SystemCode1.

  17. Under Unmapped SmartPlant properties, select SystemCode.

  18. On the toolbar, click Map .

    SPELSysCodeReadyToMao

  19. Click OK.

Save the Tool Map Schema and SmartPlant Schema Changes

  • Click File > Save All Modified Files to save the SmartPlant schema changes (CMF file) and the tool map schema.

  • When you close the Schema Editor, the software prompts you to save your connection information, user interface options, and loaded tool map schemas to a session file. Click Yes in the message box to save the session file so that you can use it to return to this working environment. However, you should not open a session file after launching the CMF file from the Desktop Client.

  • If you save changes to the CMF file or a tool map schema but did not validate the changes before exiting, the software displays an information message to remind you that the file contains changes that have not been validated. Click OK to dismiss the message.

  • If you make changes to the SmartPlant schema, you must load the changes into the SmartPlant Foundation database.

  • Additionally, if you made changes to the SmartPlant schema, you should regenerate the component schemas for the site before testing any publish or retrieve mapping relationships.