XMConnect uses Plugin Framework to provide a standard way to connect XMPro with third party systems for example CRM, Database and Microsoft Word etc.
Creating an XMConnect Plugin
XMConnect plugin requires implementation of following interface
A default constructor with no parameters must always exist in order to allow XMConnect to interact with the plugin.
Method Invocation Sequence
void SetHiddenParams(Dictionary<string, string> constructorParams);
This is the first method to be invoked by XMConnect after instantiating. XMConnect passes in a list of <Name, Value> pairs containing Plugin Settings defined in XMConnector Management.
Implement this function to provide a list of Parameters required to initiate the Plugin. Possible values along with the Type of Parameter can also be specified.
void SetInitializingArguments(List<InitializingParameter> initializingParameters)
Implement this function to get the values for the initializing parameters.
Implement this function to list the Objects on which Integration is to be performed. Type of object can also be specified which includes list of allowed operations.
This function specifies if preview of Source Objects is available. If yes then DataTable ObjectPreview(SourceObject sourceObject) must return a valid DataTable.
DataSet GetSourceObjectInputProperties(SourceObject sourceObject, Operation operation)
Implement this function to return the properties required as Input to the selected operation. The return type is DataTable, the columns of table constitute object properties. User will be able to map the properties to XMControls.
DataSet GetSourceObjectOutputProperties(SourceObject sourceObject, Operation operation);
If the operation is DataReturning, implement this function to return the output properties of the selected operation. User will be able to map the properties to XMControls.
int PerformNonReturningOperation(String sourceObject, String operation, DataSet dsIn, DataSet dsCon);
This function will be called from Managed code if the operation is NonDataReturning. In arguments: the object, to perform operation, will be specified along with the operation itself. DataSet provided by GetSourceObjectInputProperties(SourceObject sourceObject, Operation operation) with DataTables containing mapped data. Finally if the operation is conditional then a DataSet containing DataTables coresponding to dsIn Tables, each table contains data for Controls used in Conditional Clause. Conditional clause can be accessed by retrieving Extended Property "filter" of every Table in DataSet.
DataSet PerformReturningOperation(String sourceObject, String operation, DataSet dsIn, DataSet dsOut, DataSet dsCon);
This function works exactly as PerformNonReturningOperation except that it returns dsOut filled with Data, Every table contains controls mappings and mapped values must be filled. If a DataColumn has an Extended Property named "mapping" OR "browsemapping" then it is mapped and must be filled.
Registering a Plugin
To register a plugin, follow steps illustrated below:
Any number of plugins can be registered as long as they have a unique name. Assembly-qualified name should be used.