Overrides using modeling - SmartPlant Foundation - IM Update 44 - Customization & Programming - Hexagon

SmartPlant Foundation Customization

Language
English
Product
SmartPlant Foundation
Search by Category
Customization & Programming
SmartPlant Foundation / SDx Version
10

When we model our schema, each Class Definition has a number of realized Interface Definitions, each with a unique specialization value. When we create a new object, such as SPFFolder, the create is done from the Class Definition. Therefore, the new folder object will have each of the required realized interfaces added to it. Each interface will have a unique specialization value; the higher the specialization value the more specialized the interface.

There is an implies relationship between interfaces, which effectively defines the inheritance. So we can extend the model by doing the following:

  • Add a new InterfaceDef

  • Add an implies relationship to an existing InterfaceDef that you want to override

  • Ensure the new InterfaceDef has a higher specialization value than the implied one

  • Add a realizes relationship from the ClassDef to the new InterfaceDef

To write any overrides on our new interface we need to ensure that we generate code for our interface. The code generator uses the xml model files containing the schema defined above and will generate a 'generated file' and a 'default file'. You then need to add the new interface files into your solution and add code into the 'default file'.

The code generator mentioned here is available through customer support. Please file a SmartPlant Foundation service request for access to the code generator and the code samples mentioned in this guide.