Custom SBPI Services
Custom SBPI Services are user-defined integration Plug-ins that can be invoked by Enterprise Architect's scripting or Add-ins, which can then use the responses to manipulate the repository data. The Custom Plug-In can be called from Enterprise Architect using the Repository.CallSBPI automation interface method.
The scope of what can be requested of the service and what it can return to Enterprise Architect is not limited. For example, the Custom Service could respond to a request to gather information from a third-party service, and return it to the Enterprise Architect script. Other possible uses include performing actions on the model data itself via OSLC calls, or running custom-built processes on model data.
- Allow arbitrary requests and responses
- Once configured for a model, can be called from scripting or Add-Ins
- Lifetime and request forwarding automatically handled by Pro Cloud Server
- Can be written in multiple programming languages, including C++ or C#
To write your own Custom Service Plug-in you can either start from scratch or copy and modify one of the examples that are installed with Pro Cloud Server. The Plug-ins can be written in either C++ or C#.
The examples are written using Visual Studio 2017, but this is not a pre-requisite.
The Custom Service Plug-in must implement the interface defined in the ISBPIServicePlugin, which is included in ISBPIServicePlugin.h (for C++) or ISBPIServicePlugin.cs (for C#).
The general flow of the program is:
- The user performs an action within Enterprise Architect that needs information from the Service Plug-in via the CallSBPI automation interface
- The Plug-in receives the request
- The Plug-in parses the request and performs any action required (for example, call third-party service, run program, make OSLC calls to Pro Cloud Server)
- The Plug-in sends a response to Enterprise Architect via the provided callback functions; this can either be the actual data requested or an error value
- Enterprise Architect receives the callback data and uses it in the script or Add-in
Create Plug-in (not required in C#)
The Plug-in must implement this export function:
extern "C" SBPI_SERVICE_API SBPI_SERVICE_PLUGIN CreatePlugin();
It must return a pointer to a Class that implements the ISBPIServicePlugin interface. The recommended implementation is:
return new ExampleServicePlugin;
The newly created ISBPIServicePlugin can be deleted when it receives the ISBPIServicePlugin::Release method.
The dll Plug-in must implement all methods in the ISBPIServicePlugin interface.
- Repository Class (see CallSBPI method)