Invoke a plugin method. This method cannot work with legacy plugins.
Namespace: Casewhere.Runtime.DSL.ApiAssembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.8.5.0
SyntaxPluginMethodResult 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
var parameters = new Dictionary<string, object>();
parameters.Add("$skip", 10);
parameters.Add("$take", 10);
parameters.Add("$sortBy", "Gender");
parameters.Add("$asc", true);
var pluginApi = ctx.Use<IPluginApi>>();
var pluginResult = pluginApi.Invoke("ExamplePlugin", "SearchCandidates", parameters);
var total = pluginResult.Get<int>("Total");
var candidates = pluginResult.GetArray("ActualData");
See Also