Customizing edge expansions - 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

We have had a number of requirements for customizing edge expansions. The type of things we have done is to run a relationship expansion from the starting object then run the edge expansion on the results of the relationship expansion.

Example:

The tag object should be related to the document version object, but a design decision was made to relate it to the document revision object. Then when documents are checked out the relationships to the tags didn't have to be copied. But we wanted the relationships to appear as though they started at the version. So we run a pre-edge relationship expansion to get from the version to the revision then run the edge expansion from the revision. We then wanted to filter the result set of tags based on effective date. This meant we had to write some code so we needed a way of specifying a block of code to run before and after the edge expansion.

The following properties have been added to an edge:

  • SPFPreRelDefExpansion

  • SPFPostRelDefExpansion

  • SPFPreHandlerUIDAndOrMethodDefUID

  • SPFPostHandlerUIDAndOrMethodDefUID

<EdgeDef>

<IObject UID="EDG_SPFDocVersionTags" Name="SPFDocVersionTags"/>

<IEdgeDef StartInterfaceName="ISPFDocumentVersion" PathDefn="+ExDocumentTag"/>

<IEdgeDef2/>

<ISimpleCriteria PropComparisons=""/>

<ISPFEdgeDefExt SPFPreRelDefExpansion="-SPFRevisionVersions" SPFPreHandlerUIDAndOrMethodDefUID="SetVersionEffectivity" SPFPostHandlerUIDAndOrMethodDefUID="SPFDocumentComponent:ISPFDocVersion_EnsureLatestRetrieved" />

<IPositionCriteria/>

<ISchemaObj DisplayName="Tags"/>

</EdgeDef>

The pre/post Handler:MethodDefUID properties can contain either just the UID of a MethodDef on the starting object. Or the UID of an object in the application cache followed by the UID of a MethodDef on that object, separated by a colon.

SPFPreHandlerUIDAndOrMethodDefUID="SetVersionEffectivity"

The code above will call the MethodDef called SetVersionEffectivity on the starting object.

SPFPostHandlerUIDAndOrMethodDefUID="SPFDocumentComponent:ISPFDocVersion_EnsureLatestRetrieved"

The above code will look in the Application cache for an object in the SCHEMA domain with a UID of SPFDocumentComponent. If it finds the object, it will call a MethodDef that has a UID of ISPFDocVersion_EnsureLatestRetrieved.

We have introduced am EdgeDefMethodDefEventArgs class that will be passed into each MethodDef. The signature will be the same for all MethodDefs defined for this purpose:

Overrides Sub ISPFDocVersion_EnsureLatestRetrieved(ByVal sender as Object, ByVal e as Model.EdgeDefMethodDefEventArgs)