Click or drag to resize

IPluginApiInvoke Method

Invoke a plugin method. This method cannot work with legacy plugins.

Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.8.5.0
Syntax
C#
PluginMethodResult Invoke(
	string pluginName,
	string methodName,
	IDictionary<string, Object> parameters
)

Parameters

pluginName  String
Name of the plugin.
methodName  String
Invoked method name.
parameters  IDictionaryString, Object
Parameters passed to plugin.

Return Value

PluginMethodResult
A key-value data collection returned from plugin. Values must be simple type such as string, int, bool, DateTime, etc. User-defined objects are not supported and must be serialized to string before returned to Casewhere.
Example
C#
// Construct plugin parameters
var parameters = new Dictionary<string, object>();
parameters.Add("$skip", 10);
parameters.Add("$take", 10);
parameters.Add("$sortBy", "Gender");
parameters.Add("$asc", true);

// Invoke plugin method
var pluginApi = ctx.Use<IPluginApi>>();
var pluginResult = pluginApi.Invoke("ExamplePlugin", "SearchCandidates", parameters);

// Retrieve data from plugin results
var total = pluginResult.Get<int>("Total");
var candidates = pluginResult.GetArray("ActualData");
See Also