Assembly: OptimaJet.Workflow.Core

Class WorkflowRuntime

OptimaJet.Workflow.Core.Runtime.WorkflowRuntime

Provides the main API for configuring Workflow Engine and working with ProcessInstance objects.

public sealed class WorkflowRuntime

Constructors

public WorkflowRuntime(Guid runtimeId) #
Initializes a workflow runtime with the specified identifier.

Parameters

Name
Type
Description
runtimeId
Guid
The value assigned to WorkflowRuntime.Id.
public WorkflowRuntime(string runtimeId) #
Initializes a workflow runtime with the specified identifier.

Parameters

Name
Type
Description
runtimeId
String
The value assigned to WorkflowRuntime.Id.
public WorkflowRuntime(IRuntimeIdProvider runtimeIdProvider) #
Initializes a workflow runtime using an IRuntimeIdProvider.

Parameters

Name
Type
Description
runtimeIdProvider
IRuntimeIdProvider
The provider whose IRuntimeIdProvider.GetId() result becomes WorkflowRuntime.Id.
public WorkflowRuntime() #
Initializes a workflow runtime with Guid.Empty as its identifier.

Properties

public OfflineApi OfflineApi { get; } #
Gets the OfflineApi instance for building approval maps and executing ordered batches of workflow commands.
public ActorsApi ActorsApi { get; } #
Gets the ActorsApi instance for resolving workflow participant identities and their associated commands from actor restrictions.
public GetUsersWithIdentitiesAsyncDelegate GetUsersWithIdentitiesAsync { get; set; } #
Gets or sets the GetUsersWithIdentitiesAsyncDelegate used to load user names and their associated workflow participant identities.
public GetUserByIdentityAsyncDelegate GetUserByIdentityAsync { get; set; } #
Gets or sets the GetUserByIdentityAsyncDelegate used to resolve the user name associated with a workflow participant identity.
public GetCustomTimerValueAsyncDelegate GetCustomTimerValueAsync { get; set; } #
Gets or sets the GetCustomTimerValueAsyncDelegate used to resolve custom timer values.
public string Id { get; } #
Gets the runtime identifier.
public WorkflowRuntimeSettings Settings { get; } #
Gets the WorkflowRuntimeSettings that control runtime behavior.
public IDesignerAutocompleteProvider DesignerAutocompleteProvider { get; set; } #
Gets or sets the IDesignerAutocompleteProvider used to supply autocomplete data to the Designer.
public ICodeAutocompleteProvider CodeAutocompleteProvider { get; set; } #
Gets or sets the ICodeAutocompleteProvider used for code autocomplete.

Remarks

If no provider has been assigned, the first access creates a CodeAutocompleteProvider.
public IDesignerParameterFormatProvider DesignerParameterFormatProvider { get; set; } #
Gets or sets the IDesignerParameterFormatProvider that describes how the Designer edits action, condition, and rule parameters.
public IWorkflowRuleProvider RuleProvider { get; } #
Gets the IWorkflowRuleProvider used to evaluate workflow participant identities against named authorization rules.
public IWorkflowBuilder Builder { get; } #
Gets the IWorkflowBuilder used to load, build, and update process schemes and instances.
public ITimerManager TimerManager { get; } #
Gets the ITimerManager that schedules and executes process timers.
public ConcurrentDictionary<string, ICalendar> Calendars { get; set; } #
Gets or sets the work calendars keyed by ICalendar.Name.
public string DefaultCalendarName { get; } #
Gets the key in WorkflowRuntime.Calendars of the default work calendar.
public IPersistenceProvider PersistenceProvider { get; } #
Gets the IPersistenceProvider used to store and load schemes, processes, parameters, and runtime data.
public IWorkflowActionProvider ActionProvider { get; } #
Gets the IWorkflowActionProvider whose actions and conditions can be invoked by process schemes.
public IWorkflowExternalParametersProvider ExternalParametersProvider { get; } #
Gets the IWorkflowExternalParametersProvider used to load and save external process parameters.
public ILocalizationProvider? LocalizationProvider { get; } #
Gets the localization-provider value stored on this runtime instance.

Remarks

public DateTime RuntimeDateTimeNow { get; } #
public bool IsCold { get; } #
Gets a value indicating whether the runtime was started through WorkflowRuntimeConfigurationExtension.ColdStartAsync(WorkflowRuntime).
public CancellationTokenHandling CancellationTokenHandling { get; set; } #
Gets or sets a cancellation-token handling value on the runtime instance.

Remarks

Workflow execution reads WorkflowRuntimeSettings.CancellationTokenHandling from WorkflowRuntime.Settings. Configure that setting to change execution behavior.
public IWorkflowServiceRunner WorkflowServiceRunner { get; } #
Gets the IWorkflowServiceRunner that coordinates runtime services and timer processing.
public bool IsRunning { get; } #
Gets a value indicating whether the runtime is currently running.
public static bool CodeActionsCompillationEnable { get; set; } #
Gets or sets CodeActionsCompiller.CompillationEnable. The default value is true.
public static bool ExpressionsCompilationEnable { get; set; } #
Gets or sets ExpressionsCompiler.CompilationEnable. The default value is true.
public static ExpressionsCompilerOptions ExpressionsCompilerOptions { get; set; } #
Gets or sets ExpressionsCompiler.Options used for expression compilation.

Remarks

public static bool CodeActionsDebugMode { get; set; } #
Gets or sets CodeActionsCompiller.DebugMode. The default value is false.

Remarks

In debug mode, a code action can break into an attached debugger by calling Debugger.Break() or by containing the /*break*/ marker.
public CodeActionsInvoker GlobalActionsInvoker { get; } #
Gets the CodeActionsInvoker produced by the latest global code-action compilation.
public DateTime LastGlobalActionsCompilationTime { get; } #
Gets the WorkflowRuntime.RuntimeDateTimeNow timestamp recorded after the latest global code-action compilation.
public IBulkApi Bulk { get; } #
Gets the IBulkApi bound to this WorkflowRuntime.
public Localizer Localizer { get; } #
Gets the WorkflowRuntime.Localizer used to resolve names from the configured ILocalizationProvider and process-scheme localization entries.
public ILogger Logger { get; set; } #
Gets or sets the ILogger used by workflow runtime logging methods.

Remarks

Replaced logger instances are disposed through IDisposable.Dispose() when this property is set.
public IProcessLogProvider ProcessLogger { get; set; } #
Gets or sets the IProcessLogProvider that stores process-specific log entries.

Remarks

Defaults to a MemoryProcessLogger that retains up to 100 log entries for each of up to 100 processes.

Methods

public static void CodeActionsRegisterAssembly(Assembly assembly) #
Registers an Assembly as a referenced assembly for code action compilation.

Parameters

Name
Type
Description
assembly
Assembly
The Assembly to reference when compiling code actions.
public Task<(bool success, Dictionary<string, string> compilerErrors)> CompileGlobalCodeActionsAsync(bool ignoreNotCompiled) #

Parameters

Name
Type
Description
ignoreNotCompiled
Boolean
true to ignore all global code action compilation errors.

Returns

Type
Description
Task<Boolean, String, String>
A tuple containing compilation success flag and compiler errors by action name.
public static void RegisterLicense(string licenseText) #
Registers a Workflow Engine license used by subsequent WorkflowRuntime.GetLicenseRestrictions() calls.

Parameters

Name
Type
Description
licenseText
String
The license text.
public static IWorkflowEngineNetRestriction GetLicenseRestrictions() #
Gets the restrictions of the current license.

Returns

Type
Description
IWorkflowEngineNetRestriction
The current IWorkflowEngineNetRestriction instance.
public Task<bool> CheckAllSubprocessesCompletedAsync(ProcessInstance processInstance) #
Checks whether the specified ProcessInstance has no active direct subprocesses.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance to check.

Returns

Type
Description
Task<Boolean>
true if there are no active subprocesses.
public Task<bool> CheckAllSubprocessesAndParentProcessCompletedAsync(ProcessInstance processInstance) #
Checks whether a process and all of its direct subprocess branches have converged at the same subprocess merge activity.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance on which the outgoing transition from the merge activity is being evaluated.

Returns

Type
Description
Task<Boolean>
true when ProcessInstance.CurrentActivity is the TransitionDefinition.From activity of ProcessInstance.ExecutedTransition and no direct subprocesses remain active; otherwise, false.

Remarks

Use this method as a condition on an outgoing transition from a subprocess merge activity. It permits that transition only after the process itself is waiting at the merge activity and every direct subprocess branch has finalized and merged into it.
public Task<int> DeleteAllSubprocessesAsync(ProcessInstance processInstance) #
Deletes every direct child subprocess of a ProcessInstance, including each child's descendant subprocesses.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The parent ProcessInstance.

Returns

Type
Description
Task<Int32>
The number of direct child subprocess trees deleted.
public Task SetPersistentProcessParameterAsync(Guid processId, string parameterName, object parameterValue) #
Sets a process parameter with ParameterPurpose.Persistence and saves the process's persistent parameters.

Parameters

Name
Type
Description
processId
Guid
parameterName
String
The process parameter name.
parameterValue
Object
The value to assign to the process parameter.

Returns

Type
Description
Task
public Task<IEnumerable<ProcessTimer>> GetProcessTimersAsync(Guid processId) #
Gets the scheduled ProcessTimer objects for a process.

Parameters

Name
Type
Description
processId
Guid

Returns

Type
Description
Task<ProcessTimer>
The scheduled ProcessTimer objects.
public Task<ProcessStatus> GetProcessStatusAsync(Guid processId) #
Gets the ProcessStatus of the specified process.

Parameters

Name
Type
Description
processId
Guid

Returns

Type
Description
Task<ProcessStatus>
The current ProcessStatus.
public Task ShutdownAsync(int timeout = -1) #
Shuts down the runtime, switches off the API, waits for API calls and background processes to complete, stops timers, and raises WorkflowRuntime.OnRuntimeShutdown and WorkflowRuntime.OnRuntimeShutdownAsync.

Parameters

Name
Type
Description
timeout
Int32
Maximum time in milliseconds to wait separately for active API calls and background processes. The default value, Timeout.Infinite, waits indefinitely.

Returns

Type
Description
Task
public void RegisterDesignerAction(string operation, IDesignerAction designerAction) #
Registers an IDesignerAction that handles a named Designer extension operation.

Parameters

Name
Type
Description
operation
String
Operation name.
designerAction
IDesignerAction
The IDesignerAction to invoke for the operation.

Exceptions

Type
Description
ArgumentException
An action is already registered for the operation.
ArgumentNullException
operation is null.
public IDesignerAction GetDesignerAction(string operation) #
Gets the IDesignerAction registered for a named Designer extension operation.

Parameters

Name
Type
Description
operation
String
Operation name.

Returns

Type
Description
IDesignerAction
The matching IDesignerAction, or null when no action is registered.
public T GetPlugin<T>() where T : IWorkflowPlugin #
Gets a plugin of the specified type from WorkflowRuntime.Plugins.

Returns

Type
Description
{T}
The matching plugin, or null if none is registered.

Exceptions

Type
Description
InvalidOperationException
The plugin is registered more than once.
public Task ExecuteTimerAsync(Guid processId, string timerName) #
Executes timer transitions matching timerName from ProcessInstance.CurrentActivity.

Parameters

Name
Type
Description
processId
Guid
timerName
String
The name of the TimerDefinition associated with the timer transition to execute.

Returns

Type
Description
Task

Remarks

If no matching transition exists, the method completes without changing the process.
public Task SetProcessNewStatusAsync(ProcessInstance processInstance, ProcessStatus newStatus, bool suppressEvent = false) #

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose status is changed.
newStatus
ProcessStatus
The new ProcessStatus.

Returns

Type
Description
Task
public Task SetIdledOrFinalizedStatusAsync(ProcessInstance processInstance, ActivityDefinition newCurrentActivity) #
Sets the process status to ProcessStatus.Finalized when ActivityDefinition.IsFinal is true; otherwise, sets it to ProcessStatus.Idled.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose status is changed.
newCurrentActivity
ActivityDefinition
The new current ActivityDefinition.

Returns

Type
Description
Task
public Task<bool> CheckIdentityAsync(ProcessInstance processInstance, string identityId, string ruleName, string parameter, CancellationToken token) #
Checks whether a workflow participant identity satisfies a named rule exposed by WorkflowRuntime.RuleProvider.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance that provides the rule context.
identityId
String
The workflow participant identity to evaluate.
ruleName
String
parameter
String
The provider- or code-action-defined value passed to the rule after workflow substitutions are applied, typically originating from ActorDefinition.Value.
token
CancellationToken
The CancellationToken used to observe cancellation.

Returns

Type
Description
Task<Boolean>
true if the workflow participant identity passes the rule.
public Task<bool> CheckIdentityByActorAsync(ProcessInstance processInstance, string identityId, string actorName, CancellationToken token) #
Checks whether a workflow participant identity satisfies the rule configured by a named ActorDefinition in the process scheme.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose scheme defines the actor.
identityId
String
The workflow participant identity to evaluate.
actorName
String
The name of the ActorDefinition whose rule is evaluated.
token
CancellationToken
The CancellationToken used to observe cancellation.

Returns

Type
Description
Task<Boolean>
true if the workflow participant identity passes the actor rule.
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsAsync(ProcessInstance processInstance, IEnumerable<string> identityIds, string commandNameFilter = null, string mainIdentityId = null, CultureInfo culture = null, bool conditionCheck = false, CancellationToken token = default) #
Gets the WorkflowCommand objects available to the specified workflow participant identities from ProcessInstance.CurrentActivity and the current activities of active subprocesses.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose commands are evaluated.
identityIds
IEnumerable<String>
The workflow participant identities whose command permissions are evaluated.
commandNameFilter
String
Optional WorkflowCommand.CommandName filter. If specified, only matching command transitions are returned.
mainIdentityId
String
Optional workflow participant identity checked before identityIds. When it satisfies a transition's actor restrictions, the remaining identities are not checked for that transition.
culture
CultureInfo
conditionCheck
Boolean
When true, transitions are excluded when the combined evaluation of their configured TransitionDefinition.Conditions does not permit execution.
token
CancellationToken
The CancellationToken used to observe cancellation.

Returns

Type
Description
Task<WorkflowCommand>
The WorkflowCommand objects available to the provided workflow participant identities.

Remarks

When multiple transitions produce the same WorkflowCommand.CommandName, WorkflowCommand.ProcessId, and WorkflowCommand.Classifier, they are represented by one command whose WorkflowCommand.Identities contains all matching workflow participant identities.
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsAsync(ProcessInstance processInstance, string identityId) #
Gets the WorkflowCommand objects available to one workflow participant identity from ProcessInstance.CurrentActivity and the current activities of active subprocesses.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose commands are evaluated.
identityId
String
The workflow participant identity whose command permissions are evaluated.

Returns

Type
Description
Task<WorkflowCommand>
The WorkflowCommand objects available to the workflow participant identity.
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsAsync(Guid processId, IEnumerable<string> identityIds, string commandNameFilter = null, string mainIdentityId = null, CultureInfo culture = null, bool conditionCheck = false, CancellationToken token = default) #
Gets the WorkflowCommand objects available to the specified workflow participant identities from the process's current activity and the current activities of active subprocesses.

Parameters

Name
Type
Description
processId
Guid
identityIds
IEnumerable<String>
The workflow participant identities whose command permissions are evaluated.
commandNameFilter
String
Optional WorkflowCommand.CommandName filter. If specified, only matching command transitions are returned.
mainIdentityId
String
Optional workflow participant identity checked before identityIds. When it satisfies a transition's actor restrictions, the remaining identities are not checked for that transition.
culture
CultureInfo
conditionCheck
Boolean
Whether to exclude transitions when the combined evaluation of their configured TransitionDefinition.Conditions does not permit execution.
token
CancellationToken
The CancellationToken used to observe cancellation.

Returns

Type
Description
Task<WorkflowCommand>
The WorkflowCommand objects available to the provided workflow participant identities.
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsAsync(Guid processId, string identityId) #
Gets the WorkflowCommand objects available to one workflow participant identity from the process's current activity and the current activities of active subprocesses.

Parameters

Name
Type
Description
processId
Guid
identityId
String
The workflow participant identity whose command permissions are evaluated.

Returns

Type
Description
Task<WorkflowCommand>
The WorkflowCommand objects available to the workflow participant identity.
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsAsync(Guid processId, string identityId, CultureInfo culture) #
Gets the WorkflowCommand objects available to one workflow participant identity from the process's current activity and the current activities of active subprocesses, using the specified culture.

Parameters

Name
Type
Description
processId
Guid
identityId
String
The workflow participant identity whose command permissions are evaluated.
culture
CultureInfo

Returns

Type
Description
Task<WorkflowCommand>
The WorkflowCommand objects available to the workflow participant identity.
public Task<CommandExecutionResult> ExecuteCommandAsync(WorkflowCommand command, string identityId, string impersonatedIdentityId, CancellationToken token = default, bool checkRestrictions = false) #
Executes a WorkflowCommand for the process and activity identified by the command.

Parameters

Name
Type
Description
command
WorkflowCommand
The WorkflowCommand to execute.
identityId
String
The workflow participant identity that initiates command execution.
impersonatedIdentityId
String
The workflow participant identity on whose behalf the command is executed.
token
CancellationToken
The CancellationToken used to observe cancellation.
checkRestrictions
Boolean
When true, impersonatedIdentityId is validated against the actor restrictions in TransitionDefinition.Restrictions for each candidate transition.

Returns

Type
Description
Task<CommandExecutionResult>
The CommandExecutionResult produced by command execution.

Exceptions

Type
Description
InvalidCommandException
Thrown when the command is invalid or is not valid for ProcessInstance.CurrentActivity.
public Task<CommandExecutionResult> ExecuteCommandWithRestrictionCheckAsync(WorkflowCommand command, string identityId, string impersonatedIdentityId, CancellationToken token = default) #
Executes a WorkflowCommand after validating the impersonated workflow participant identity against TransitionDefinition.Restrictions for each candidate transition.

Parameters

Name
Type
Description
command
WorkflowCommand
The WorkflowCommand to execute.
identityId
String
The workflow participant identity that initiates command execution.
impersonatedIdentityId
String
The workflow participant identity on whose behalf the command is executed.
token
CancellationToken
The CancellationToken used to observe cancellation.

Returns

Type
Description
Task<CommandExecutionResult>
The CommandExecutionResult produced by command execution.
[Obsolete("Use GetInitialCommandsAsync(GetInitialCommandsParams parameters) instead.")] public Task<IEnumerable<WorkflowCommand>> GetInitialCommandsAsync(string schemeCode, string identityId) Obsolete #

Parameters

Name
Type
Description
schemeCode
String
The ProcessDefinition name used as the scheme code.
identityId
String
Workflow participant identity argument retained for backward compatibility.

Returns

Type
Description
Task<WorkflowCommand>
The WorkflowCommand objects available on the initial activity.

Remarks

This overload delegates to WorkflowRuntime.GetInitialCommandsAsync(GetInitialCommandsParams) and does not use identityId in command filtering.
[Obsolete("Use GetInitialCommandsAsync(GetInitialCommandsParams parameters) instead.")] public Task<IEnumerable<WorkflowCommand>> GetInitialCommandsAsync(string schemeCode, string identityId, CultureInfo culture) Obsolete #

Parameters

Name
Type
Description
schemeCode
String
The ProcessDefinition name used as the scheme code.
identityId
String
Workflow participant identity argument retained for backward compatibility.
culture
CultureInfo

Returns

Type
Description
Task<WorkflowCommand>
The WorkflowCommand objects available on the initial activity.

Remarks

This overload delegates to WorkflowRuntime.GetInitialCommandsAsync(GetInitialCommandsParams) and does not use identityId in command filtering.
[Obsolete("Use GetInitialCommandsAsync(GetInitialCommandsParams parameters) instead.")] public Task<IEnumerable<WorkflowCommand>> GetInitialCommandsAsync(string schemeCode, IEnumerable<string> identityIds, string commandNameFilter = null, CultureInfo culture = null) Obsolete #

Parameters

Name
Type
Description
schemeCode
String
The ProcessDefinition name used as the scheme code.
identityIds
IEnumerable<String>
Workflow participant identity list retained for backward compatibility.
commandNameFilter
String
Optional WorkflowCommand.CommandName filter. If specified, only matching command transitions are returned.
culture
CultureInfo

Returns

Type
Description
Task<WorkflowCommand>
The WorkflowCommand objects available on the initial activity.

Remarks

This overload delegates to WorkflowRuntime.GetInitialCommandsAsync(GetInitialCommandsParams) and does not use identityIds in command filtering.
public Task<IEnumerable<WorkflowCommand>> GetInitialCommandsAsync(GetInitialCommandsParams parameters) #
Gets the WorkflowCommand objects defined for ProcessDefinition.InitialActivity in the selected scheme.

Parameters

Returns

Type
Description
Task<WorkflowCommand>
The WorkflowCommand objects available on the initial activity.

Remarks

Only transitions for which TransitionDefinition.IsAlwaysTransition is true are returned.
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsWithConditionCheckAsync(Guid processId, string identityId) #
Gets the WorkflowCommand objects from the current activities of a process and its active subprocesses, excluding transitions when the combined evaluation of their configured TransitionDefinition.Conditions does not permit execution.

Parameters

Name
Type
Description
processId
Guid
identityId
String
The workflow participant identity whose command permissions are evaluated.

Returns

Type
Description
Task<WorkflowCommand>
The WorkflowCommand objects available to the workflow participant identity.
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsWithConditionCheckAsync(Guid processId, string identityId, CultureInfo culture) #
Gets the WorkflowCommand objects from the current activities of a process and its active subprocesses, excluding transitions when the combined evaluation of their configured TransitionDefinition.Conditions does not permit execution.

Parameters

Name
Type
Description
processId
Guid
identityId
String
The workflow participant identity whose command permissions are evaluated.
culture
CultureInfo

Returns

Type
Description
Task<WorkflowCommand>
The WorkflowCommand objects available to the workflow participant identity.
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsWithConditionCheckAsync(Guid processId, IEnumerable<string> identityIds, string commandNameFilter = null, string mainIdentityId = null, CultureInfo culture = null) #
Gets the WorkflowCommand objects from the current activities of a process and its active subprocesses, excluding transitions when the combined evaluation of their configured TransitionDefinition.Conditions does not permit execution.

Parameters

Name
Type
Description
processId
Guid
identityIds
IEnumerable<String>
The workflow participant identities whose command permissions are evaluated.
commandNameFilter
String
Optional WorkflowCommand.CommandName filter. If specified, only matching command transitions are returned.
mainIdentityId
String
Optional workflow participant identity checked before identityIds. When it satisfies a transition's actor restrictions, the remaining identities are not checked for that transition.
culture
CultureInfo

Returns

Type
Description
Task<WorkflowCommand>
The WorkflowCommand objects available to the provided workflow participant identities.
public Task CreateInstanceAsync(string schemeCode, Guid processId, CancellationToken token = default) #
Creates a ProcessInstance from the specified scheme and starts execution from ProcessDefinition.InitialActivity.

Parameters

Name
Type
Description
schemeCode
String
The ProcessDefinition name used as the scheme code.
processId
Guid
The value to assign to ProcessInstance.ProcessId.
token
CancellationToken
The CancellationToken to observe while creating the process instance.

Returns

Type
Description
Task
A task that completes after initial process execution finishes.
public Task CreateInstanceAsync(CreateInstanceParams createInstanceParams, CancellationToken token = default) #
Creates a ProcessInstance with the supplied configuration and starts execution from ProcessDefinition.InitialActivity.

Parameters

Returns

Type
Description
Task
A task that completes after initial process execution finishes.
public Task DeleteInstanceAsync(Guid processId) #
Deletes a ProcessInstance and all of its descendant subprocesses asynchronously.

Parameters

Name
Type
Description
processId
Guid
The ProcessInstance.ProcessId of the process to delete.

Returns

Type
Description
Task
A task that completes when the process instance and subprocesses are deleted.
public Task<bool> IsProcessExistsAsync(Guid processId) #
Checks whether a ProcessInstance with the specified identifier exists.

Parameters

Name
Type
Description
processId
Guid
The value of ProcessInstance.ProcessId to check.

Returns

Type
Description
Task<Boolean>
true if the process exists; otherwise, false.
public Task DeleteInstanceAsync(ProcessInstance processInstance) #
Deletes a ProcessInstance and all of its descendant subprocesses asynchronously.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance to delete.

Returns

Type
Description
Task
A task that completes when the process instance and subprocesses are deleted.
public Task<ProcessInstancesTree> GetProcessInstancesTreeAsync(Guid rootProcessId, CancellationToken cancellationToken = default) #
Gets the ProcessInstancesTree for a root process asynchronously.

Parameters

Name
Type
Description
rootProcessId
Guid
The root value of ProcessInstance.ProcessId.
cancellationToken
CancellationToken
The CancellationToken to observe while building the tree.

Returns

Type
Description
Task<ProcessInstancesTree>
The process instance tree rooted at rootProcessId.
public Task<ProcessInstancesTree> GetProcessInstancesTreeAsync(ProcessInstance processInstance, CancellationToken cancellationToken = default) #
Gets the complete ProcessInstancesTree that contains the specified process.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose tree should be loaded.
cancellationToken
CancellationToken
The CancellationToken to observe while building the tree.

Returns

Type
Description
Task<ProcessInstancesTree>
The tree rooted at ProcessInstance.RootProcessId. When processInstance is a subprocess, the result also contains its parent and sibling subprocesses.
public Task<ProcessInstance> GetProcessInstanceAndFillProcessParametersAsync(Guid processId) #
Gets a ProcessInstance and loads its process parameters asynchronously.

Parameters

Name
Type
Description
processId
Guid

Returns

Type
Description
Task<ProcessInstance>
The ProcessInstance with its process parameters loaded.
public Task<List<ProcessHistoryItem>> GetProcessHistoryAsync(Guid processId, Paging paging = null) #
Gets the ProcessHistoryItem entries for a process asynchronously.

Parameters

Name
Type
Description
processId
Guid
paging
Paging
Optional Paging.PageIndex and Paging.PageSize values for history retrieval.

Returns

Type
Description
Task<ProcessHistoryItem>
A list of ProcessHistoryItem objects.
public Task<int> GetProcessHistoryCountAsync(Guid processId) #
Gets the number of ProcessHistoryItem entries for a process asynchronously.

Parameters

Name
Type
Description
processId
Guid

Returns

Type
Description
Task<Int32>
The total number of history records.
public Task<bool> ChangeProcessLogEnabledAsync(Guid processId) #
Toggles ProcessInstance.LogEnabled for a process and all of its subprocesses.

Parameters

Name
Type
Description
processId
Guid

Returns

Type
Description
Task<Boolean>
public string GetLocalizedStateName(Guid processId, string stateName) #
Gets the localized ActivityDefinition.State name for a process, using CultureInfo.CurrentCulture.

Parameters

Name
Type
Description
processId
Guid
stateName
String
The ActivityDefinition.State name to localize.

Returns

Type
Description
String
The localized state name, or the original value when no translation is available.
public Task<string> GetLocalizedStateNameAsync(Guid processId, string stateName) #
Gets the localized ActivityDefinition.State name for a process asynchronously, using CultureInfo.CurrentCulture.

Parameters

Name
Type
Description
processId
Guid
stateName
String
The ActivityDefinition.State name to localize.

Returns

Type
Description
Task<String>
A task that resolves to the localized state name, or the original value when no translation is available.
public string GetLocalizedStateNameBySchemeId(Guid schemeId, string stateName) #
Gets the localized ActivityDefinition.State name for a scheme, using CultureInfo.CurrentCulture.

Parameters

Name
Type
Description
schemeId
Guid
The value of ProcessDefinition.Id.
stateName
String
The ActivityDefinition.State name to localize.

Returns

Type
Description
String
The localized state name, or the original value when no translation is available.
public Task<string> GetLocalizedStateNameBySchemeIdAsync(Guid schemeId, string stateName) #
Gets the localized ActivityDefinition.State name for a scheme asynchronously, using CultureInfo.CurrentCulture.

Parameters

Name
Type
Description
schemeId
Guid
The value of ProcessDefinition.Id.
stateName
String
The ActivityDefinition.State name to localize.

Returns

Type
Description
Task<String>
A task that resolves to the localized state name, or the original value when no translation is available.
public string GetLocalizedStateNameBySchemeCode(string schemeCode, string stateName) #
Gets the localized ActivityDefinition.State name for a scheme code, using CultureInfo.CurrentCulture.

Parameters

Name
Type
Description
schemeCode
String
The ProcessDefinition name used as the scheme code.
stateName
String
The ActivityDefinition.State name to localize.

Returns

Type
Description
String
The localized state name, or the original value when no translation is available.
public Task<string> GetLocalizedStateNameBySchemeCodeAsync(string schemeCode, string stateName) #
Gets the localized ActivityDefinition.State name for a scheme code asynchronously, using CultureInfo.CurrentCulture.

Parameters

Name
Type
Description
schemeCode
String
The ProcessDefinition name used as the scheme code.
stateName
String
The ActivityDefinition.State name to localize.

Returns

Type
Description
Task<String>
A task that resolves to the localized state name, or the original value when no translation is available.
public string GetLocalizedStateNameBySchemeCode(string schemeCode, string? tenantId, string stateName) #
Gets the localized ActivityDefinition.State name for a tenant-specific scheme code, using CultureInfo.CurrentCulture.

Parameters

Name
Type
Description
schemeCode
String
The ProcessDefinition name used as the scheme code.
tenantId
String
stateName
String
The ActivityDefinition.State name to localize.

Returns

Type
Description
String
The localized state name, or the original value when no translation is available.
public Task<string> GetLocalizedStateNameBySchemeCodeAsync(string schemeCode, string? tenantId, string stateName) #
Gets the localized ActivityDefinition.State name for a tenant-specific scheme code asynchronously, using CultureInfo.CurrentCulture.

Parameters

Name
Type
Description
schemeCode
String
The ProcessDefinition name used as the scheme code.
tenantId
String
stateName
String
The ActivityDefinition.State name to localize.

Returns

Type
Description
Task<String>
A task that resolves to the localized state name, or the original value when no translation is available.
public string GetLocalizedCommandName(Guid processId, string commandName) #
Gets the localized name of a CommandDefinition for a process, using CultureInfo.CurrentCulture.

Parameters

Name
Type
Description
processId
Guid
commandName
String
The name of the CommandDefinition to localize.

Returns

Type
Description
String
The localized command name, or the original value when no translation is available.
public Task<string> GetLocalizedCommandNameAsync(Guid processId, string commandName) #
Gets the localized name of a CommandDefinition for a process asynchronously, using CultureInfo.CurrentCulture.

Parameters

Name
Type
Description
processId
Guid
commandName
String
The name of the CommandDefinition to localize.

Returns

Type
Description
Task<String>
A task that resolves to the localized command name, or the original value when no translation is available.
public string GetLocalizedCommandNameBySchemeId(Guid schemeId, string commandName) #
Gets the localized name of a CommandDefinition for a scheme, using CultureInfo.CurrentCulture.

Parameters

Name
Type
Description
schemeId
Guid
The value of ProcessDefinition.Id.
commandName
String
The name of the CommandDefinition to localize.

Returns

Type
Description
String
The localized command name, or the original value when no translation is available.
public Task<string> GetLocalizedCommandNameBySchemeIdAsync(Guid schemeId, string commandName) #
Gets the localized name of a CommandDefinition for a scheme asynchronously, using CultureInfo.CurrentCulture.

Parameters

Name
Type
Description
schemeId
Guid
The value of ProcessDefinition.Id.
commandName
String
The name of the CommandDefinition to localize.

Returns

Type
Description
Task<String>
A task that resolves to the localized command name, or the original value when no translation is available.
public void LogInfo(string message, Dictionary<string, string> parameters) #
Writes a message through WorkflowRuntime.Logger at the Info level.

Parameters

Name
Type
Description
message
String
Message to write.
parameters
Dictionary<String, String>
Dictionary of properties to serialize in the log entry.

Exceptions

Type
Description
Exception
Thrown when the logger is not configured.
public void LogInfoIfLoggerExists(string message, Dictionary<string, string> parameters) #
Writes a message to the log with Info level if WorkflowRuntime.Logger is set.

Parameters

Name
Type
Description
message
String
Message to write.
parameters
Dictionary<String, String>
Dictionary of properties to serialize in the log entry.
public void LogDebug(string message, Dictionary<string, string> parameters) #
Writes a message through WorkflowRuntime.Logger at the Debug level.

Parameters

Name
Type
Description
message
String
Message to write.
parameters
Dictionary<String, String>
Dictionary of properties to serialize in the log entry.

Exceptions

Type
Description
Exception
Thrown when the logger is not configured.
public void LogDebugIfLoggerExists(string message, Dictionary<string, string> parameters) #
Writes a message to the log with Debug level if WorkflowRuntime.Logger is set.

Parameters

Name
Type
Description
message
String
Message to write.
parameters
Dictionary<String, String>
Dictionary of properties to serialize in the log entry.
public void LogError(string message, Dictionary<string, string> parameters) #
Writes a message through WorkflowRuntime.Logger at the Error level.

Parameters

Name
Type
Description
message
String
Message to write.
parameters
Dictionary<String, String>
Dictionary of properties to serialize in the log entry.

Exceptions

Type
Description
Exception
Thrown when the logger is not configured.
public void LogErrorIfLoggerExists(string message, Dictionary<string, string> parameters) #
Writes a message to the log with Error level if WorkflowRuntime.Logger is set.

Parameters

Name
Type
Description
message
String
Message to write.
parameters
Dictionary<String, String>
Dictionary of properties to serialize in the log entry.
public void LogExceptionIfLoggerExists(Exception exception, string message, Dictionary<string, string> parameters) #
Writes an Exception and optional properties through WorkflowRuntime.Logger at the Error level when a logger is configured.

Parameters

Name
Type
Description
exception
Exception
The Exception to write.
message
String
Message to write.
parameters
Dictionary<String, String>
Dictionary of properties to serialize in the log entry.
public Task<List<ActivityDto>> PreExecuteFromInitialActivityAsync(Guid processId, bool ignoreCurrentStateCheck = false, CancellationToken token = default) #
Runs a pre-execution simulation from ProcessDefinition.InitialActivity without persisting the simulated process state.

Parameters

Name
Type
Description
processId
Guid
ignoreCurrentStateCheck
Boolean
When false and ProcessInstance.CurrentState differs from ActivityDefinition.State of ProcessDefinition.InitialActivity (for example, after a scheme upgrade), the simulation stops after the initial activity.
token
CancellationToken
The CancellationToken used to cancel the simulation.

Returns

Type
Description
Task<ActivityDto>
The predicted activity path produced by the pre-execution simulation.

Remarks

The simulation evaluates transitions and executes actions from ActivityDefinition.PreExecutionImplementation instead of the regular ActivityDefinition.Implementation. Although Workflow Engine does not persist simulated process changes, these actions can still affect external systems.
public Task<List<ActivityDto>> PreExecuteFromCurrentActivityAsync(Guid processId, bool ignoreCurrentStateCheck = false, CancellationToken token = default) #
Runs a pre-execution simulation from ProcessInstance.CurrentActivity without persisting the simulated process state.

Parameters

Name
Type
Description
processId
Guid
ignoreCurrentStateCheck
Boolean
When false and ProcessInstance.CurrentState differs from ActivityDefinition.State of ProcessInstance.CurrentActivity (for example, after a scheme upgrade), the simulation stops after the current activity.
token
CancellationToken
The CancellationToken used to cancel the simulation.

Returns

Type
Description
Task<ActivityDto>
The predicted activity path produced by the pre-execution simulation.

Remarks

The simulation evaluates transitions and executes actions from ActivityDefinition.PreExecutionImplementation instead of the regular ActivityDefinition.Implementation. Although Workflow Engine does not persist simulated process changes, these actions can still affect external systems.
public Task<List<ActivityDto>> PreExecuteAsync(Guid processId, string fromActivityName, bool ignoreCurrentStateCheck = false, CancellationToken token = default) #
Runs a pre-execution simulation from the ActivityDefinition named by fromActivityName without persisting the simulated process state.

Parameters

Name
Type
Description
processId
Guid
fromActivityName
String
The name of the ActivityDefinition where the simulation starts.
ignoreCurrentStateCheck
Boolean
When false and ProcessInstance.CurrentState differs from ActivityDefinition.State of the starting activity (for example, after a scheme upgrade), the simulation stops after that activity.
token
CancellationToken
The CancellationToken used to cancel the simulation.

Returns

Type
Description
Task<ActivityDto>
The predicted activity path produced by the pre-execution simulation.

Remarks

The simulation evaluates transitions and executes actions from ActivityDefinition.PreExecutionImplementation instead of the regular ActivityDefinition.Implementation. Although Workflow Engine does not persist simulated process changes, these actions can still affect external systems.
public Task<List<string>> GetSchemeCodesAsync(List<string>? tags = null) #
Gets the codes of shared process schemes, optionally restricting the result to schemes matching tags.

Parameters

Name
Type
Description
tags
List<String>
Optional collection of tags to filter by. If null, all shared scheme codes are returned.

Returns

Type
Description
Task<String>
The matching shared scheme codes.
public Task<List<string>> GetSchemeCodesAsync(string tenantId) #
Gets the codes of process schemes defined in the exact tenant scope identified by tenantId.

Parameters

Name
Type
Description
tenantId
String
The ProcessDefinition.TenantId for which schemes are searched.

Returns

Type
Description
Task<String>
The matching scheme codes.
public Task<List<string>> GetSchemeCodesAsync(string tenantId, List<string> tags) #
Gets the codes of process schemes defined in the exact tenant scope identified by tenantId and matching tags.

Parameters

Name
Type
Description
tenantId
String
The ProcessDefinition.TenantId for which schemes are searched.
tags
List<String>
Tags used to filter the search.

Returns

Type
Description
Task<String>
The matching scheme codes.
public Task SetSchemeIsObsoleteAsync(string schemeCode, string? tenantId = null) #
Marks generated versions of a process scheme as obsolete so eligible process instances can be moved to a newly built version.

Parameters

Name
Type
Description
schemeCode
String
The code of the process scheme whose generated versions are marked obsolete.
tenantId
String
The ProcessDefinition.TenantId to target. null marks matching schemes obsolete in all tenants.

Returns

Type
Description
Task

Exceptions

Type
Description
ShutdownException
Thrown when the runtime is shutting down and cannot start a new operation.
public Task UpdateSchemeIfObsoleteAsync(Guid processId) #
Moves a process and eligible descendant subprocesses from obsolete schemes to newly built scheme versions when ActivityDefinition.IsAutoSchemeUpdate permits the update at their current activities.

Parameters

Name
Type
Description
processId
Guid

Returns

Type
Description
Task

Exceptions

Type
Description
ShutdownException
Thrown when the runtime is shutting down and cannot start a new operation.
public Task UpdateSchemeIfObsoleteAsync(Guid processId, bool ignoreAutoSchemeUpdate) #
Moves a process and eligible descendant subprocesses from obsolete schemes to newly built scheme versions, optionally bypassing the activity-level ActivityDefinition.IsAutoSchemeUpdate requirement.

Parameters

Name
Type
Description
processId
Guid
ignoreAutoSchemeUpdate
Boolean
true to update even when ActivityDefinition.IsAutoSchemeUpdate is disabled at a process's current activity; false to require that permission.

Returns

Type
Description
Task

Exceptions

Type
Description
ShutdownException
Thrown when the runtime is shutting down and cannot start a new operation.
public Task<ProcessInstance> UpdateSchemeIfObsoleteAsync(ProcessInstance processInstance) #
Moves processInstance and eligible descendant subprocesses from obsolete schemes to newly built scheme versions when ActivityDefinition.IsAutoSchemeUpdate permits the update at their current activities.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance to update.

Returns

Type
Description
Task<ProcessInstance>
The supplied process instance, with an updated scheme when an update was required and permitted; or null if the process was dropped during the update.

Exceptions

Type
Description
ShutdownException
Thrown when the runtime is shutting down and cannot start a new operation.
public Task<ProcessDefinition> GetProcessSchemeAsync(Guid processId) #
Gets the built process scheme currently assigned to the process identified by processId.

Parameters

Name
Type
Description
processId
Guid

Returns

Type
Description
Task<ProcessDefinition>
The process's ProcessDefinition.
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(Guid processId) #
Gets the states that WorkflowRuntime.SetStateAsync(SetStateParams) can assign to the process identified by processId, using CultureInfo.CurrentCulture for WorkflowState.VisibleName.

Parameters

Name
Type
Description
processId
Guid
The process identifier.

Returns

Type
Description
Task<WorkflowState>
A list of available WorkflowState objects.
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(Guid processId, CultureInfo culture) #
Gets the states that WorkflowRuntime.SetStateAsync(SetStateParams) can assign to the process identified by processId.

Parameters

Name
Type
Description
processId
Guid
The process identifier.
culture
CultureInfo
The culture used for WorkflowState.VisibleName.

Returns

Type
Description
Task<WorkflowState>
A list of available WorkflowState objects.
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(ProcessInstance processInstance) #
Gets the states that WorkflowRuntime.SetStateAsync(SetStateParams) can assign to processInstance, using CultureInfo.CurrentCulture for WorkflowState.VisibleName.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose available states are requested.

Returns

Type
Description
Task<WorkflowState>
A list of available WorkflowState objects.
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(ProcessInstance processInstance, CultureInfo culture) #
Gets the states that WorkflowRuntime.SetStateAsync(SetStateParams) can assign to processInstance.

Parameters

Name
Type
Description
processInstance
ProcessInstance
The ProcessInstance whose available states are requested.
culture
CultureInfo
The culture used for WorkflowState.VisibleName.

Returns

Type
Description
Task<WorkflowState>
A list of available WorkflowState objects.
[Obsolete("Use GetAvailableStateToSetAsync(GetStateBySchemeParams parameters) instead.")] public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(string schemeCode) Obsolete #
Gets the states that WorkflowRuntime.SetStateAsync(SetStateParams) can assign in the scheme identified by schemeCode, using CultureInfo.CurrentCulture for WorkflowState.VisibleName.

Parameters

Name
Type
Description
schemeCode
String
The process scheme code.

Returns

Type
Description
Task<WorkflowState>
A list of available WorkflowState objects.
[Obsolete("Use GetAvailableStateToSetAsync(GetStateBySchemeParams parameters) instead.")] public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(string schemeCode, CultureInfo culture) Obsolete #
Gets the states that WorkflowRuntime.SetStateAsync(SetStateParams) can assign in the scheme identified by schemeCode.

Parameters

Name
Type
Description
schemeCode
String
The process scheme code.
culture
CultureInfo
The culture used for WorkflowState.VisibleName.

Returns

Type
Description
Task<WorkflowState>
A list of available WorkflowState objects.
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(GetStateBySchemeParams parameters) #

Parameters

Name
Type
Description
parameters
GetStateBySchemeParams

Returns

Type
Description
Task<WorkflowState>
A list of available WorkflowState objects.
public Task SetStateAsync(SetStateParams setStateParams) #
Sets a process to a state represented by an ActivityDefinition marked with ActivityDefinition.IsForSetState, optionally executing ActivityDefinition.Implementation and applying SetStateParams.ProcessParameters.

Parameters

Returns

Type
Description
Task

Exceptions

Type
Description
ActivityNotFoundException
No ActivityDefinition with the requested state is marked with ActivityDefinition.IsForSetState.
public Task SetActivityWithoutExecutionAsync(ActivityDefinition activityToSet, ProcessInstance processInstance, bool doNotSetRunningStatus = false) #

Parameters

Name
Type
Description
activityToSet
ActivityDefinition
The ActivityDefinition to set as current.
processInstance
ProcessInstance
The ProcessInstance to update.
doNotSetRunningStatus
Boolean
When true, skips setting the process status to ProcessStatus.Running.

Returns

Type
Description
Task
public Task SetActivityWithExecutionAsync(string identityId, string impersonatedIdentityId, IDictionary<string, object> parameters, ActivityDefinition activityToSet, ProcessInstance processInstance, bool doNotSetRunningStatus = false, CancellationToken token = default) #

Parameters

Name
Type
Description
identityId
String
The workflow participant identity stored in ProcessInstance.IdentityId for this execution.
impersonatedIdentityId
String
The workflow participant identity stored in ProcessInstance.ImpersonatedIdentityId.
parameters
IDictionary<String, Object>
Process parameters made available to actions in ActivityDefinition.Implementation.
activityToSet
ActivityDefinition
The ActivityDefinition to set as current and execute.
processInstance
ProcessInstance
The ProcessInstance to update.
doNotSetRunningStatus
Boolean
When true, skips setting the process status to ProcessStatus.Running.
token
CancellationToken
The CancellationToken observed while setting the activity.

Returns

Type
Description
Task
public Task SetActivityWithExecutionAsync(string identityId, string impersonatedIdentityId, IDictionary<string, object> parameters, ActivityDefinition activityToSet, ProcessInstance processInstance, bool doNotSetRunningStatus, List<string> persist, CancellationToken token = default) #

Parameters

Name
Type
Description
identityId
String
The workflow participant identity stored in ProcessInstance.IdentityId for this execution.
impersonatedIdentityId
String
The workflow participant identity stored in ProcessInstance.ImpersonatedIdentityId.
parameters
IDictionary<String, Object>
Process parameters made available to actions in ActivityDefinition.Implementation.
activityToSet
ActivityDefinition
The ActivityDefinition to set as current and execute.
processInstance
ProcessInstance
The ProcessInstance to update.
doNotSetRunningStatus
Boolean
When true, skips setting the process status to ProcessStatus.Running.
persist
List<String>
Names from parameters to store with ParameterPurpose.Persistence.
token
CancellationToken
The CancellationToken observed while setting the activity.

Returns

Type
Description
Task
public Task<ResumeResult> ResumeAsync(Guid processId, CancellationToken token = default) #
Resumes process execution by evaluating outgoing TriggerType.Auto transitions from ProcessInstance.CurrentActivity without executing ActivityDefinition.Implementation for that activity.

Parameters

Name
Type
Description
processId
Guid
The process identifier.
token
CancellationToken
The CancellationToken observed while resuming.

Returns

Type
Description
Task<ResumeResult>
A ResumeResult whose ResumeResult.WasResumed indicates whether execution advanced and whose ResumeResult.ProcessInstance contains the resulting process instance.
public Task<ResumeResult> ResumeAsync(ResumeParams resumeParams, CancellationToken token = default) #
Resumes process execution by evaluating outgoing TriggerType.Auto transitions from ResumeParams.ActivityName or ProcessInstance.CurrentActivity without executing ActivityDefinition.Implementation for that activity.

Parameters

Name
Type
Description
token
CancellationToken
The CancellationToken observed while resuming.

Returns

Type
Description
Task<ResumeResult>
A ResumeResult whose ResumeResult.WasResumed indicates whether execution advanced and whose ResumeResult.ProcessInstance contains the resulting process instance.

Exceptions

Type
Description
ActivityNotFoundException
The activity named by ResumeParams.ActivityName was not found.
public Task<string> GetCurrentStateNameAsync(Guid processId) #
Returns ProcessInstance.CurrentState for the process identified by processId.

Parameters

Name
Type
Description
processId
Guid
The process identifier.

Returns

Type
Description
Task<String>
The current state name, or null if not set.
public Task<string> GetCurrentActivityNameAsync(Guid processId) #
Returns ProcessInstance.CurrentActivityName for the process identified by processId.

Parameters

Name
Type
Description
processId
Guid
The process identifier.

Returns

Type
Description
Task<String>
The current activity name.
public Task<WorkflowState> GetCurrentStateAsync(Guid processId, CultureInfo culture = null) #
Returns a WorkflowState for ProcessInstance.CurrentState of the process identified by processId.

Parameters

Name
Type
Description
processId
Guid
The process identifier.
culture
CultureInfo

Returns

Type
Description
Task<WorkflowState>
A WorkflowState describing the current state, or null if the state is not set.
[Obsolete("Use GetInitialStateAsync(GetStateBySchemeParams parameters) instead.")] public Task<WorkflowState> GetInitialStateAsync(string schemeCode, CultureInfo culture = null) Obsolete #
Returns the WorkflowState defined by ActivityDefinition.State of ProcessDefinition.InitialActivity in the scheme identified by schemeCode.

Parameters

Name
Type
Description
schemeCode
String
The process scheme code.
culture
CultureInfo

Returns

Type
Description
Task<WorkflowState>
WorkflowState that represents the scheme initial state.
public Task<WorkflowState> GetInitialStateAsync(GetStateBySchemeParams parameters) #

Parameters

Name
Type
Description
parameters
GetStateBySchemeParams

Returns

Type
Description
Task<WorkflowState>
WorkflowState that represents the scheme initial state.

Fields

public List<IWorkflowPlugin> Plugins #
Contains all registered IWorkflowPlugin instances.
public List<ActivityBase> CustomActivities #
Contains all registered custom ActivityBase implementations.
public List<FormBase> CustomConditions #
Contains all registered custom condition FormBase implementations.

Events

public event EventHandler<CodeActionsCompiledEventArgs> GlobalCodeActionsCompiled #
Raised with CodeActionsCompiledEventArgs after global code-action compilation.
public event EventHandler<SchemaWasChangedEventArgs> OnSchemaWasChanged #
Raised with SchemaWasChangedEventArgs when the process scheme has changed.
public event EventHandler<WorkflowErrorEventArgs> OnWorkflowError #
Raised with WorkflowErrorEventArgs when a workflow error occurs.
public event EventHandler<StartingTransitionNotFoundEventArgs> OnStartingTransitionNotFound #
Raised with StartingTransitionNotFoundEventArgs when the runtime cannot find the starting transition of a subprocess in a new root scheme.
public event EventHandler<ProcessActivityChangedEventArgs> OnProcessActivityChanged #
Raised with ProcessActivityChangedEventArgs when the current activity of a process changes.
public event EventHandler<BeforeActivityExecutionEventArgs> OnBeforeActivityExecution #
Raised with BeforeActivityExecutionEventArgs before execution of the selected activity.
public event EventHandler<ProcessStatusChangedEventArgs> OnProcessStatusChanged #
Raised with ProcessStatusChangedEventArgs when the ProcessStatus of a process has changed.
public event EventHandler<RuntimeStartEventArgs> OnRuntimeStart #
Raised with RuntimeStartEventArgs after the runtime has started.
public event EventHandler<EventArgs> OnRuntimeShutdown #
Raised with EventArgs after the runtime has shut down.
public event AsyncEventHandler<SchemaWasChangedEventArgs> OnSchemaWasChangedAsync #
Raised asynchronously with SchemaWasChangedEventArgs when the process scheme has changed.
public event AsyncEventHandler<WorkflowErrorEventArgs> OnWorkflowErrorAsync #
Raised asynchronously with WorkflowErrorEventArgs when a workflow error occurs.
public event AsyncEventHandler<StartingTransitionNotFoundEventArgs> OnStartingTransitionNotFoundAsync #
Raised asynchronously with StartingTransitionNotFoundEventArgs when the runtime cannot find the starting transition of a subprocess in a new root scheme.
public event AsyncEventHandler<ProcessActivityChangedEventArgs> OnProcessActivityChangedAsync #
Raised asynchronously with ProcessActivityChangedEventArgs when the current activity of a process changes.
public event AsyncEventHandler<BeforeActivityExecutionEventArgs> OnBeforeActivityExecutionAsync #
Raised asynchronously with BeforeActivityExecutionEventArgs before execution of the selected activity.
public event AsyncEventHandler<ProcessStatusChangedEventArgs> OnProcessStatusChangedAsync #
Raised asynchronously with ProcessStatusChangedEventArgs when the ProcessStatus of a process has changed.
public event AsyncEventHandler<RuntimeStartEventArgs> OnRuntimeStartAsync #
Raised asynchronously with RuntimeStartEventArgs after the runtime has started.
public event AsyncEventHandler<EventArgs> OnRuntimeShutdownAsync #
Raised asynchronously with EventArgs after the runtime has shut down.