How do I Manually add a New Column to the Database Property Mapping?


Applies To 
Product(s):Class Editor
Version(s):V8i
Environment: Windows 7 64-bit
Area: Plant Project Tools
Subarea: 
Original Author:Brandon Moberg, Bentley Product Advantage Group

Problem Description

In an instance when users want to add new custom columns to their database structure there is a need to add these into the Property Mapping Schema.  This will discuss how to manually add these via Class Editor.

Steps to Resolve

Turn on the ability to modify the database mapping directly via Class Editor. In order to accomplish this browse to and edit the ECClassEditor.exe.Config file located in the folder as shown below:

Once open in NotePad or another editing software add the following line to the <appSettings>
<add key="IsDBStructureEditable" value="True" />

Make any customizations needed to the SQL Server database.  In this example we will be adding the following custom field in the EQUIP table as shown below:

This new column will need to be added to the Project's Database Property Mapping Schema.  This will make it available to be mapped to a property which will then enable it to have data written back and forth between OpenPLANT applications.  Notice below that options are available once the database mapping is loaded in Class Editor  Please follow the steps below to accomplish this:

  1. Load Class Editor.
  2. Load the project's Openplant_PID version's schema.
  3. Select Databse Mapping and open the mapping schema as shown below:

  4. Browse to and make sure that the mapping schema is loaded from the project being modified.  In this example we are working the the OPPID_Imperial project as shown below:

  5. Edit the Database Structure as shown below:


  6. Select the table needing modification and add the new column with it's correct matching properties.  In this instance we are working with the EQUIP table and adding the column New_Field.  Notice its properties are String and length of 50 to match the database type and field length.

  7. Select OK and Exit.  
  8. In Class Editor at this point go ahead and map the new field to the property necessary and test a sync to the database in OpenPLANT PID.

Comments or Corrections?

Bentley's Product Advantage Group requests that you please confine any comments you have on this Wiki entry to this "Comments or Corrections?" section. THANK YOU!