IActionContext
Interface in Oadm.Sdk.Actions · Oadm.Sdk.dll
Server services for one action run.
public interface IActionContextGuide: Event rules
Properties
Section titled “Properties”License
Section titled “License”IPluginLicense? License { get; }Default implementation
The license of the action’s plugin package (plugin.json license); null on hosts without licenses.
Logger
Section titled “Logger”ILogger Logger { get; }The server log. For the event log, use IActionContext.Log.
ICorePlugin? Owner { get; }The core plugin that contributed the action (VAPIX Commander for “Run VAPIX command”), else null.
Settings
Section titled “Settings”IPluginSettings Settings { get; }The settings of the plugin package (e.g. an SMTP server), namespaced like a core plugin’s.
IVapixClient? Vapix { get; }Pre-authenticated for ActionInvocation.Device with the stored credentials; null without a device.
Methods
Section titled “Methods”void Log(string message)Extra line for the event log entry of this run. Never log secrets.
SessionAsync
Section titled “SessionAsync”Task<T> SessionAsync<T>(string fieldKey, CancellationToken ct) where T : classDefault implementation
The open session of the persistent recipient chosen in fieldKey (SDK 0.12.0), as the plugin’s own interface. The first action of a recipient waits for its connection; later ones fail at once while it is not connected (RecipientSessionTexts.NotConnected), nothing is queued.
string Text(string? text)Fills the placeholders of ActionPlaceholders.Fixed ({rule}, {event}, {state}, {time}, {device}, {serial}, {mac}, …) in a text of the settings, then every value of the event by its name ({port}, {total}; ActionTrigger.Data). The fixed names win over event values of the same name; unknown names stay. Device values come from the action’s device, else from the device of the event.
string Text(string? text, PlaceholderEscape escape)Default implementation
IActionContext.Text for a text with a format: each value is escaped (PlaceholderEscape), so “objectId”: “{objectId}” stays valid JSON whatever the value holds. The text around the placeholders is unchanged.