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.1.0
Syntax
C#
PluginMethodResult Invoke(
	string pluginName,
	string methodName,
	IDictionary<string, Object> parameters
)

Parameters

pluginName
Type: SystemString
Name of the plugin.
methodName
Type: SystemString
Invoked method name.
parameters
Type: System.Collections.GenericIDictionaryString, Object
Parameters passed to plugin.

Return Value

Type: 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.
Examples
// 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