Plugins
General information
A plugin is a class that extends the Workflow Server functionality, and specifically:
- Adds predefined Actions, Conditions and Authorization rules to the schemes designer.
- Performs additional processing of the Workflow Runtime standard events.
- Connects a provider of external parameters to your processes.
The procedure to add a plugin to Workflow Server is described further in this section.
How to connect a plugin to Workflow Server
On the Dashboard page go to the Plugins section to connect a plugin to Workflow Server. The plugin with the toggle can be simply enabled and then established its settings, if any. After that, the functionality added by the plugin will become available for all the schemes.
How to write a plugin of your own
A plugin is a class that must implement the IWorkflowPlugin
interface. This interface is very simple:
public interface IWorkflowPlugin
{
string Name { get; }
Dictionary<string, string> PluginSettings { get; }
void OnPluginAdd(WorkflowRuntime runtime, List<string> schemes = null);
}
The interface members are assigned as follows:
Name
- the plugin name.PluginSettings
- the dictionary of the plugin settings.OnPluginAdd
- called when the plugin is added to the runtime. This method is convenient for subscribing to theWorkflowRuntime
events.
Also, the plugin class can optionally implement the following interfaces in any combination.
- IWorkflowActionProvider - adds Actions and Conditions.
- IWorkflowRuleProvider - adds Authorization rules for arranging access to the commands.
- IDesignerAutocompleteProvider - arranges a simple autocomplete for the parameters of Actions, Conditions or Authorization Rules.
- IDesignerParameterFormatProvider - creates complex forms for editing the parameters of Actions, Conditions or Authorization Rules.
- IWorkflowExternalParametersProvider - adds external parameters to the process.
ICustomActivityProvider
. This interface contains only one methodList<ActivityBase> GetCustomActivities()
. You can return the list of Custom Activities that will be added to the Designer.
Thus, you get a class that connects to WorkflowRuntime
by calling the WithPlugin()
method only, and adds a certain class of functions to
your system.