Class DeactivatedWorkflowActionProvider
OptimaJet.Workflow.Core.Runtime.DeactivatedWorkflowActionProvider
Wraps an IWorkflowActionProvider and allows it to be enabled or disabled dynamically.
Namespace: OptimaJet.Workflow.Core.Runtime
public sealed class DeactivatedWorkflowActionProvider : IWorkflowActionProviderType Hierarchy
- DeactivatedWorkflowActionProvider Current type
- Implemented interfaces
Constructors
public DeactivatedWorkflowActionProvider(IWorkflowActionProvider activatedActionProvider, Func<bool> getDisabled) #Parameters
activatedActionProviderIWorkflowActionProvidergetDisabled returns false.getDisabledFunc<Boolean>activatedActionProvider.Methods
public void ExecuteAction(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter) #Parameters
nameStringprocessInstanceProcessInstancepublic Task ExecuteActionAsync(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter, CancellationToken token) #Parameters
nameStringprocessInstanceProcessInstancetokenCancellationTokenReturns
Taskpublic bool ExecuteCondition(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter) #Parameters
nameStringprocessInstanceProcessInstanceactionParameterStringReturns
public Task<bool> ExecuteConditionAsync(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter, CancellationToken token) #Parameters
nameStringprocessInstanceProcessInstanceactionParameterStringtokenCancellationTokenReturns
public bool IsActionAsync(string name, string schemeCode) #public bool IsConditionAsync(string name, string schemeCode) #public List<string> GetActions(string schemeCode, NamesSearchType namesSearchType) #Parameters
schemeCodeStringnamesSearchTypeNamesSearchTypeReturns
List<String>public List<string> GetConditions(string schemeCode, NamesSearchType namesSearchType) #Parameters
schemeCodeStringnamesSearchTypeNamesSearchTypeReturns
List<String>Remarks
The wrapper evaluates the predicate supplied to the constructor on every method call. When the predicate returns false, the call is forwarded unchanged to the configured provider. When it returns true, the configured provider is bypassed and the call is delegated to EmptyWorkflowActionProvider.Value. Disabling the wrapper does not modify the configured provider.
While disabled, the wrapper exposes no action or condition names, synchronous actions perform no work, synchronous conditions return false, and asynchronous capability checks return false. Direct calls to the asynchronous execution methods are delegated to EmptyWorkflowActionProvider and throw NotImplementedException.