Understanding External Functions - Intergraph Smart Instrumentation - Reference - Intergraph

SmartPlant Instrumentation Programmer's Guide

Language
English
Product
Intergraph Smart Instrumentation
Search by Category
Reference
Smart Instrumentation Version
2016 SP1 (11.0.1)

External functions are controlled by SmartPlant Instrumentation Rule Manager. External functions are the implementation of the spiExtendedService Interface, which is part of SPIExternalService.dll file supplied with SmartPlant Instrumentation.

Rule Manager allows you to define two external function types:

  • Validation

  • Update

SmartPlant Instrumentation Rule engine interfaces with SmartPlant Instrumentation core objects. These objects are called business objects. At runtime, these objects use the rule engine. By creating rules which are defined as external functions, the rule engine can invoke your customization code at runtime, every time you create, modify, or associate an item in SmartPlant Instrumentation.

The rule engine invokes your assembly component based on its signature which is the C# or VB .NET Assembly name and class name.

spiExtendedService Interface Definition

The spiExtendedService.dll file is an interface developed for .NET Framework. It includes the following objects:

Object

Type

Description

CalcReturnInfo

struct

Used as a container of data that the external functions return to the Rule Manager.

ParmInfo

struct

Used as a container of data that external functions receive from the SmartPlant Instrumentation rule engine.

spiTransaction

class

External functions use this object to access the SmartPlant Instrumentation database connection collection based on the current login. Also, you can use this object to query the database.

spiExtendedService Interface

Method

Return Type

Description

ErrDesc

Property

Used by the Rule engine to display errors to SmartPlant Instrumentation users.

ErrCode

Property

Used by the Rule engine to display an error number to SmartPlant Instrumentation users.

CustomCalculation

CalcReturnInfo

Enables a programmer to control the values of selected attributes in a particular rule definition.

CustomValidation

bool

Enables a programmer to extend a core validation in SmartPlant Instrumentation.