How to Assign Temporary Tag to Equipment and Map it With Database Field


Applies To 
Product(s):OpenPlant PID
Version(s):08.11.10.XXX (SS5) | 08.11.11.XXX (SS6)
Environment: Windows 7/8.1/10 (64 bit)
Area: Customization
Subarea: 
Original Author:Kestutis Mitkus, Bentley Product Advantage Group

Background

This article will explain the procedure of including special property in component Tag Information. User has the Pump tag defined as DEVICE_TYPE_CODE-NUMBER, but there is request to add "TMP" - temporary group characters only to required component Tags. By default if property is included in TAG it will be always added, but in this case user request is to have choosing possibility: place a temporary component tag or final one. This might be required for some design situations, when temporary tags are updated in later time directly from database or Data Manager.

Steps to Accomplish

Add required changes in schemas

  1. Launch Class Editor and load OpenPlant_PID schema.

  2. Supplement OpenPlant_PID_Supplemental_Imperial schema.

  3. In Equipment class create new property COMPONENT_STATUS.

  4. Add required Custom Attributes with values as in picture below.


  5. Now open OpenPlant_Supplemental_Tagging.01.07.ecschema.xml, go to Equipment class NAME property and change the ECExpression to this:

    IIF(this.COMPONENT_STATUS="PROJECT",this.DEVICE_TYPE_CODE & "-" & this.NUMBER,this.DEVICE_TYPE_CODE & "-" & this.COMPONENT_STATUS & this.NUMBER)

    Parser regular expression to this:

    ^(?<DEVICE_TYPE_CODE>.*)-(?<COMPONENT_STATUS>.{3})(?<NUMBER>.{4})|(?<DEVICE_TYPE_CODE>.*)-(?<NUMBER>.*)



  6. Save the changes in both schemas and close them.

Add required field in Database Table:

  1. In this Example SQL Database was used and required ETEMPTAG field was added directly in EQUIP table using SQL Server Management Studio.


    detailed steps of how to do the same using Access database provider is presented in this wiki article

Create new Tag Type in Project:

  1. Launch Project Administrator, expand the <Project Name> node, expand Database node and select Tag Type
  2. Select Equip tag type and click Edit.





  3. Create new Alternate as in picture below


  4. Create new Tag Code as in  picture below


  5. Finish editing AT_EQUIP tag as in picture below

Add mapping in schema:

In this wiki article you can find instruction how to map a custom/existing EC property with Database field.
communities.bentley.com/.../how-to-map-custom-properties-with-database

Check "B. Add mapping in schema" section and fallow the steps to map required property with new database field.



Verify the results

  1. Select to place anew Pump and you will see new Component Status sections in which you can choose component type - temporary or project.


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!