Generally, transformation of published data is translated to a set of Smart P&ID classes and properties being traversed to a set of Tool schema ClassDefs which are traversed to a set of InterfaceDefs to be published.
To put it into pseudo code:
-
Create class publishers – a collection of all ToolMap schema MapClassDefs.
-
Load – gather all the relevant SPItems related to the document being published. This is done for each class Publisher.
-
If SPItems.count > 0 then publish.
-
Publish – create an empty container by traversing the relevant ClassDef to a relevant SmartPlant Schema object, and filling in all the realized interfaces.
-
Fill the container with properties and their data.