# Class BasicPlugin OptimaJet.Workflow.Plugins.BasicPlugin Namespace: [OptimaJet.Workflow.Plugins](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins/) ```csharp public class BasicPlugin : WorkflowPluginWithRuleProvider, ICustomMixProvider, ICustomWorkflowActionProvider, IWorkflowActionProvider, IDisableProvider, ICustomDesignerParameterFormatProvider, IDesignerParameterFormatProvider, ICustomActivityProvider, ICustomConditionProvider, IWorkflowPlugin, ICustomWorkflowRuleProvider, IWorkflowRuleProvider ``` ## Type Hierarchy - [WorkflowActionProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.CustomWorkflowProviders/WorkflowActionProvider-TEnumActions-TEnumActionsAsync-TEnumConditions-TEnumConditionsAsync/) - [WorkflowActionAndDesignerParameterFormatProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.CustomWorkflowProviders/WorkflowActionAndDesignerParameterFormatProvider-TEnumActions-TEnumActionsAsync-TEnumConditions-TEnumConditionsAsync/) - [CustomMixProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.CustomWorkflowProviders/CustomMixProvider-EnumActions-EnumActionsAsync-EnumConditions-EnumConditionsAsync/) - [WorkflowPlugin](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.CustomWorkflowProviders/WorkflowPlugin-TEnumActions-TEnumActionsAsync-TEnumConditions-TEnumConditionsAsync/) - [WorkflowPluginWithRuleProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.CustomWorkflowProviders/WorkflowPluginWithRuleProvider-EnumActions-EnumActionsAsync-EnumConditions-EnumConditionsAsync-EnumRules-EnumRulesAsync/) - BasicPlugin Current type - Implemented interfaces - [ICustomMixProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.CustomWorkflowProviders/ICustomMixProvider/) - [ICustomActivityProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/ICustomActivityProvider/) - [ICustomConditionProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.CustomWorkflowProviders/ICustomConditionProvider/) - [ICustomDesignerParameterFormatProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.CustomWorkflowProviders/ICustomDesignerParameterFormatProvider/) - [IDesignerParameterFormatProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/IDesignerParameterFormatProvider/) - [ICustomWorkflowActionProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.CustomWorkflowProviders/ICustomWorkflowActionProvider/) - [IDisableProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.CustomWorkflowProviders/IDisableProvider/) - [IWorkflowActionProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/IWorkflowActionProvider/) - [ICustomWorkflowRuleProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins.CustomWorkflowProviders/ICustomWorkflowRuleProvider/) - [IWorkflowRuleProvider](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Runtime/IWorkflowRuleProvider/) - [IWorkflowPlugin](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins/IWorkflowPlugin/) ## Constructors `public BasicPlugin()` `public BasicPlugin(Dictionary pluginSettings)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `pluginSettings` | `Dictionary` | | ## Properties `public override string Name { get; protected set; }` The plugin name. `public UsersInRoleAsyncDelegate UsersInRoleAsync { get; set; }` `public string Setting_Mailserver { get; set; }` `public int Setting_MailserverPort { get; set; }` `public string Setting_MailserverFrom { get; set; }` `public string Setting_MailserverLogin { get; set; }` `public string Setting_MailserverPassword { get; set; }` `public bool Setting_MailserverSsl { get; set; }` `[Obsolete] public bool Setting_DontCompileExpressions { get; set; }` Obsolete Use this setting for compatibility only `public GetApproverIdentityId GetApproverIdentityId { get; set; }` Gets or sets the delegate used to resolve the workflow participant identity of an approver from a rule parameter. ## Methods `protected virtual void InitialActions()` `protected virtual void InitialActionsAsync()` `protected virtual void ActionAsyncSetActivity(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | `protected virtual Task ActionAsyncExecuteCommand(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `protected virtual Task ActionAsyncSetState(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ActionSetParameterAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ActionSendEmailAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ActionCreateProcessAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ActionHttpRequestAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ActionFillApproversUsersAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ActionFillApproversRolesAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ActionRemoveParameterAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ActionDeleteSubprocessesAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ActionClearApproversAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `protected virtual Task StoreResponse(HttpResponseMessage res, ProcessInstance processInstance, Dictionary parameters)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `res` | `HttpResponseMessage` | | | `processInstance` | `ProcessInstance` | | | `parameters` | `Dictionary` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `protected virtual Task StoreResponse(string data, ProcessInstance processInstance, Dictionary parameters)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `data` | `String` | | | `processInstance` | `ProcessInstance` | | | `parameters` | `Dictionary` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public override void OnPluginAdd(WorkflowRuntime runtime, List schemes = null)` Called when a plugin is added to a runtime. ### Parameters | Name | Type | Description | | --- | --- | --- | | `runtime` | `WorkflowRuntime` | The instance of the runtime. | | `schemes` | `List` | The list of schemes for which the plugin is being added. | `public Task OnPluginRemoveAsync(WorkflowRuntime runtime)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `runtime` | `WorkflowRuntime` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `protected virtual void InitialExclude()` `protected virtual void InitialSettings()` `public void WithActor(string actor, List schemes = null)` Adds an actor to the collection of predefined actors in all schemes specified in the collection. It is supposed to be used before plugin initialization. ### Parameters | Name | Type | Description | | --- | --- | --- | | `actor` | `String` | Actor name. | | `schemes` | `List` | Collection of scheme codes for adding an actor. | `public void WithActors(List actors, List schemes = null)` Adds an actors collection to the collection of predefined actors in all schemes specified in the collection. It is supposed to be used before plugin initialization. ### Parameters | Name | Type | Description | | --- | --- | --- | | `actors` | `List` | Collection of actors names. | | `schemes` | `List` | Collection of scheme codes for adding an actor. | `public static Approvers GetApprovers(ProcessInstance processInstance, string name)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `name` | `String` | | ### Returns | Type | Description | | --- | --- | | `Approvers` | | `protected virtual Task OnProcessStatusChangedAsync(object handler, ProcessStatusChangedEventArgs e, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `handler` | `Object` | | | `e` | `ProcessStatusChangedEventArgs` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `protected virtual Task> RuleGetApprovers(ProcessInstance processInstance)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual List GetAutocompleteSuggestions(SuggestionCategory category, string value, string schemeCode)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `category` | `SuggestionCategory` | | | `value` | `String` | | | `schemeCode` | `String` | | ### Returns | Type | Description | | --- | --- | | `List` | | `public override List GetCustomActivities()` Gets the custom activities exposed by the provider. ### Returns | Type | Description | | --- | --- | | `List` | A list of custom [ActivityBase](https://api.workflowengine.io/core/OptimaJet.Workflow.Core/ActivityBase/) instances available from this provider. | `protected virtual void InitialConditions()` `protected virtual void InitialConditionsAsync()` `public virtual Task ConditionCheckParameterAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ConditionCheckApproversExistAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ConditionCheckAllSubprocessesCompletedAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ConditionIsProcessFinishAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ConditionIsApprovedByRolesAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ConditionIsApprovedByUsersAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ConditionCheckHttpRequestAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task ConditionIsApproveCompleteAsync(ProcessInstance processInstance, WorkflowRuntime runtime, Dictionary parameters, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `parameters` | `Dictionary` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `protected virtual void InitialActionsDescriptions()` `protected virtual void InitialActionsAsyncDescriptions()` `protected virtual void InitialActionsAsyncTemplates()` `protected virtual void InitialConditionsDescriptions()` `protected virtual void InitialConditionsAsyncDescriptions()` `protected virtual void InitialFormatsActions()` `protected virtual void InitialFormatsActionsAsync()` `protected virtual void InitialFormatsConditions()` `protected virtual void InitialFormatsConditionsAsync()` `public virtual List FormatSetActivity()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatsExecuteCommand()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatsSetState()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatRemoveParameter()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatSetParameter()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatSendEmail()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatCreateProcess()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatHTTPRequest()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatFillApproversUsers()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatFillApproversRoles()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatCheckParameter()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatCheckApproversExist()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatCheckHTTPRequest()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatIsApprovedByUsers()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatIsApprovedByRoles()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatIsApproveComplete()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatIsProcessFinish()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatCheckAllSubprocessesCompleted()` ### Returns | Type | Description | | --- | --- | | `List` | | `public virtual List FormatDeleteSubprocesses()` ### Returns | Type | Description | | --- | --- | | `List` | | `protected virtual void InitialRulesCheck()` `protected virtual void InitialRulesCheckAsync()` `protected virtual void InitialRulesGetIdentities()` `protected virtual void InitialRulesGetIdentitiesAsync()` `public virtual Task ApproverCheckAsync(ProcessInstance processInstance, WorkflowRuntime runtime, string identityId, string ruleName, string parameter, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `identityId` | `String` | | | `ruleName` | `String` | | | `parameter` | `String` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task PredefinedCheckAsync(ProcessInstance processInstance, WorkflowRuntime runtime, string identityId, string ruleName, string parameter, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `identityId` | `String` | | | `ruleName` | `String` | | | `parameter` | `String` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task CheckRoleCheckAsync(ProcessInstance processInstance, WorkflowRuntime runtime, string identityId, string ruleName, string parameter, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `identityId` | `String` | | | `ruleName` | `String` | | | `parameter` | `String` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task> ApproverCheckAsync(ProcessInstance processInstance, WorkflowRuntime runtime, string ruleName, string parameter, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `ruleName` | `String` | | | `parameter` | `String` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task> PredefinedCheckAsync(ProcessInstance processInstance, WorkflowRuntime runtime, string ruleName, string parameter, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `ruleName` | `String` | | | `parameter` | `String` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | `public virtual Task> CheckRoleCheckAsync(ProcessInstance processInstance, WorkflowRuntime runtime, string ruleName, string parameter, CancellationToken token)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `processInstance` | `ProcessInstance` | | | `runtime` | `WorkflowRuntime` | | | `ruleName` | `String` | | | `parameter` | `String` | | | `token` | `CancellationToken` | | ### Returns | Type | Description | | --- | --- | | `Task` | | ## Fields `public readonly IActorProvider PredefinedActorProvider` Allows to thread-safely control collections of predefined actors. `public Dictionary RequestHeaders` `public ApproversInStageAsyncDelegate ApproversInStageAsync` `public CheckPredefinedActorAsyncDelegate CheckPredefinedActorAsync` `public GetPredefinedIdentitiesAsyncDelegate GetPredefinedIdentitiesAsync` `public UpdateDocumentStateDelegate UpdateDocumentStateAsync` ## Nested Types `public sealed class BasicPlugin.ParameterInObject` [View BasicPlugin.ParameterInObject](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins/BasicPlugin.ParameterInObject/) [Previous ApproversInStageAsyncDelegate](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins/ApproversInStageAsyncDelegate/) [Next BasicPlugin.ParameterInObject](https://api.workflowengine.io/core/OptimaJet.Workflow.Plugins/BasicPlugin.ParameterInObject/)