UploadTransfer Method - 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

Inputs

XFRDataTransfer class containing items to load

Boolean to indicate whether you want the source (datatransfer serialization) to be attached as a file to the request object that gets created.

Outputs

UploadResult object.

NLF Justification for TransferObject input

By converting into NLF format, only one code stream is needed to persist the data and also be able to hook into some of the "business specific" functions that the NLF format supports. This is also a commonly used format and should therefore be tried and tested. See Appendix 1 for details.

Relationship handling

Relationships can be created in two ways.

The first way is shown below and requires adding an attribute inside the source item being created.

<XFRItem>

 <XFRClass>TechnicalQuery</XFRClass>

 <XFRName>SFB-TQ-AK-SFLL-0021</XFRName>

<XFRAttributes>

<XFRAttribute>

<XFRAttributeName>XFRTasksheet</XFRAttributeName>

<XFRAttributeValue>A-GENERAL</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>TechnicalQueryTitle</XFRAttributeName>

  <XFRAttributeValue>EI210 PMI requirements for control valves</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>Discipline:+XFRTaskSheetDiscipline</XFRAttributeName>

  <XFRAttributeValue>I</XFRAttributeValue>

  </XFRAttribute>

  </XFRAttributes>

  </XFRItem>

Specify the ClassDef of the item to relate and the path definition to use when creating, separated by a colon (:). An attribute value contains the name of the item to relate to.

The second way to create relationships is using the following syntax for the same relationship.

<XFRItem>

 <XFRClass> XFRTaskSheetDiscipline </XFRClass>

 <XFRName>Rel</XFRName>

<XFRAttributes>

<XFRAttribute>

  <XFRAttributeName>Name1</XFRAttributeName>

  <XFRAttributeValue> SFB-TQ-AK-SFLL-0021</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>Name2</XFRAttributeName>

  <XFRAttributeValue> I</XFRAttributeValue>

  </XFRAttribute>

  </XFRAttributes>

  </XFRItem>

<XFRItem>

Another example for maintaining relationships is shown below. This terminates the defined relationship.

<XFRItem>

 <XFRClass> XFRTaskSheetDiscipline </XFRClass>

 <XFRName>Rel</XFRName>

<XFRAttributes>

<XFRAttribute>

  <XFRAttributeName>Name1</XFRAttributeName>

  <XFRAttributeValue> SFB-TQ-AK-SFLL-0021</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>Name2</XFRAttributeName>

  <XFRAttributeValue> I</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>Action</XFRAttributeName>

  <XFRAttributeValue>Terminate</XFRAttributeValue>

  </XFRAttribute>

  </XFRAttributes>

  </XFRItem>

Attribute UOM handling

The attribute value and the UOM for the value need to be indicated. To do this, separate the value and uom using a tilde (~) separator.

<XFRItem>

 <XFRClass>TechnicalQuery</XFRClass>

 <XFRName>SFB-TQ-AK-SFLL-0021</XFRName>

<XFRAttributes>

<XFRAttribute>

<XFRAttributeName>XFRTasksheet</XFRAttributeName>

<XFRAttributeValue>A-GENERAL</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>TechnicalQueryTitle</XFRAttributeName>

  <XFRAttributeValue>EI210 PMI requirements for control valves</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>Discipline:+XFRTaskSheetDiscipline</XFRAttributeName>

  <XFRAttributeValue>I</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>DesignPressure</XFRAttributeName>

  <XFRAttributeValue>15~PSI</XFRAttributeValue>

  </XFRAttribute>

  </XFRAttributes>

  </XFRItem>

Classification

Simply define a SPFPrimaryClassification relationship in the same way as other relationships (described above).

Optional interfaces

The XFTInterfaces property is provided for those objects that need to instantiate an optional interface. This can be used to add interfaces to objects being created and can also be used when returning data.

<XFRItem C="SPFTEFSharedObject" N="211-LCV-00102">

<XFRA N="UID" V="1C127D5E2B934B3A847014FA2A1057C5_S " />

<XFRA N="DomainUID" V="DWShared" />

<XFRA N="CreationDate" V="2010/05/21-13:48:12:171" />

<XFRA N="TerminationDate" V="9999/12/31-23:59:59:999" />

<XFRA N="LastUpdatedDate" V="2010/05/21-13:48:12:171" />

<XFRA N="UniqueKey" V="" />

<XFRA N="CreationUser" V="superuser" />

<XFRA N="TerminationUser" V="" />

<XFRA N="Description" V="new Test new desc" />

<XFRA N="Name" V="211-LCV-00102" />

<XFRI N="ISPFTEFSharedInstrument" />

</XFRItem>

Document handling

In 4.x, documents are modeled as complex objects in the underlying database with three objects: Master, Revision and Version. There are relationships between master and revision and the revision and version. There is special code in the NLF engine to handle this by defining one object rather than all three. Define an Item for the master object and specify attributes on the revision and version as if they are on the master.

<XFRItem>

 <XFRClass>SPFTemplateMaster</XFRClass>

 <XFRName>T056-001-001</XFRName>

<XFRAttributes>

<XFRAttribute>

<XFRAttributeName>Description</XFRAttributeName>

<XFRAttributeValue>Template Document</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>SPFDocCategory</XFRAttributeName>

  <XFRAttributeValue>e1TemplateDocuments</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>SPFDocType</XFRAttributeName>

  <XFRAttributeValue>XSLReportTemplate</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>SPFTitle</XFRAttributeName>

  <XFRAttributeValue>Test</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>SPFDocState</XFRAttributeName>

  <XFRAttributeValue>RESERVED</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>SPFMajorRevision</XFRAttributeName>

  <XFRAttributeValue>01</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>SPFMinorRevision</XFRAttributeName>

  <XFRAttributeValue>A</XFRAttributeValue>

  </XFRAttribute>

<XFRAttribute>

  <XFRAttributeName>SPFRevisionScheme: SPFDocumentRevScheme</XFRAttributeName>

  <XFRAttributeValue>REV_01A</XFRAttributeValue>

  </XFRAttribute>

  </XFRAttributes>

  </XFRItem>

SuppressENS

When loading data there is an option to use the properties specified in the upload item rather than letting the engineering numbering system generate a value. This is called SuppressENS. It is supported in the XML format by specifying it in the container header.

<Container SuppressENS="True" >

For upload XFRDataTransfer, a new item has been added called XFRUploadArguments with SuppressENS as one of the properties. If this has a value of True, then ENS is turned off for the load.

<XFRDataTransfer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<XFRConfiguration Plant="PlantA" xmlns="http://localhost/SPF40Server/" />

<XFRUploadArguments SuppressENS="True" />

<XFRItems xmlns="http://localhost/SPF40Server/">

<XFRItem C="SPFTEFSharedObject" N="211-LCV-00102">