Abstract server API class - 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

All Server APIs inherit from an abstract class called Server API. When the Server API is invoked the ExcuteAPI method is called. The abstract class will then call the must override methods OnDeSerialize, OnHandlerBody, and OnSerialize.

The power of inheritance allows us to ensure that each of the methods have timing information around them, which means that any new Server APIs will get this automatically. There is also a Try/Catch statement around all of the API calls ensuring that any exceptions are trapped. Also, the specific method in the Server API can have its own exception handling.

The abstract class maintains separate collections of items created, updated, deleted/terminated. This information is automatically sent back to the client after every Server API call. The Desktop Client will then ensure that the client cache is refreshed and views updated accordingly. To prevent this functionality you can set the property

DisableSerializationOfModifiedItems = True.

So if your Server API just creates/updates objects, then you don't have to write any code in the OnSerialize method. The abstract class will take care of it.