Monthly Archives: December 2014

SmartPlant Foundation – Database Queries – 3/3

This is part 3 of a 3-part series on how to query the SPF database.

In part 1, I gave an overview of the SPF database model, and showed how to write a simple query to return all objects of a specific type, starting from a given interface. This showed the DATAOBJ (object) and DATAOBJIF (interface) tables.

In part 2 I showed how to get two properties for those objects, using the DATAOBJPR (property) table.

In this post, part 3, I will show how to get a related object via the DATAREL (relationship) table.

Continue reading

SmartPlant Foundation – Database Queries – 2/3

This is part 2 of a 3-part series on how to query the SPF database.

In part 1, I gave an overview of the SPF database model, and showed how to write a simple query to return all objects of a specific type, starting from a given interface. This showed the DATAOBJ (object) and DATAOBJIF (interface) tables.

In this post, I show how to get two properties for those objects, using the DATAOBJPR (property) table.

In part 3, I show how to get a related object via the DATAREL (relationship) table.

Continue reading

SmartPlant Foundation – Database Queries – 1/3

This is part 1 of a 3-part series on how to query the SPF database.

In this post, I give an overview of the SPF database model, and show how to write a simple query to return all objects of a specific type, starting from a given interface. This shows the DATAOBJ (object) and DATAOBJIF (interface) tables.

In part 2, I show how to get two properties for those objects, using the DATAOBJPR (property) table.

In part 3, I show how to get a related object via the DATAREL (relationship) table.

Continue reading

SPF Load Files – UpdateInstruction Reference

Here is a quick reference for the SPF UpdateInstruction loader command. The documentation is scattered across various places in the SPF printable guides, this gathers it all into one place.

<!-- 
IPropValues properties: 
    AddedInterfaces = Tilde-delimited list of interfaces to add to the object.
    PropValues = List of values to assign. Each value to assign is a triplet of
        Interface, Property Name, and Property Value; delimited with the \% pair.
        Multiple triplets are also delimited with the \% character pair, so ensure
        there are 3, 6, 9, etc. values if you split the string on the \% delimiter.
        E.g. <interface>\%<property>\%<value>~<interface>\%<property>\%<value>
IUpdateInstruction properties:
    RemovedInterfaces = Tilde-delimited list of interfaces to remove from the object.
    RemovedProperties = Tilde-delimited list of property names to remove from the object.
-->
    <UpdateInstruction>
        <IObject UID="Update_001" Name="Update_001" />
        <IRefObject RefClass="SPXEngineeringDocMaster" 
            RefUID="5ce5103d-51c0-46c6-a9de-d1065034af57" />
        <IUpdateInstruction 
            RemovedInterfaces="ISPFInterfaceOne~ISPFInterfaceTwo" 
            RemovedProperties="SPFPropNameOne~SPFPropNameTwo" />
        <IPropValues 
            AddedInterfaces="ISPFInterfaceThree~ISPFInterfaceFour" 
            PropValues="IObject\%Description\%New Description\%ISPFInterfaceFive\%ISPFPropNameThree\%New Value for Property Three" />
        <IInstruction/>
    </UpdateInstruction>