SetTransactionManager Method - Integration - Update 44 - Customization & Programming - Hexagon

SmartPlant Integration Customization

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

After the map schema file has been parsed, the SetTransactionManager method will be called. This method will be passed the transaction manager used by the Schema Editor.

Any metaschema extensions for semantics (covered in a previous section) should be added from within this method.

The transaction manager supports the ISemanticEvents interface. Normally, whenever an object is added, deleted or updated, the appropriate method(s) on the ISemanticEvents interface should be called. An exception to this rule applies to metaschema objects, which, because they are not persisted, can be added without requiring the appropriate method to be invoked. Therefore, the metadata adapter, when extending the metaschema for its semantics, should not call the InsertObject or InsertRel methods on the ISemanticEvents interface for the transaction manager.

However, outside of this special case (of extending the metaschema), any modifications made to objects from within the metadata adapter must be passed on to the transaction manager. If a change or addition is made without notifying the transaction manager, then the appropriate instructions will not be generated and behavior may become unpredictable.

From within SetTransactionManager, the metadata adapter should register with the transaction manager (passed as an argument) as an instructions listener (by calling AddInstructionsListener) and, if transactional, as a transaction listener (by calling AddTransactionListener).

If a metadata adapter identifies itself to the transaction manager as an instructions listener, then it must implement IInstructionsListener. If the adapter is also a transaction listener, then it must implement ITransaction. These interfaces are discussed later in this document.