Workflow Engine .NET

Assembly: OptimaJet.Workflow.Core

Class WorkflowRuntime

OptimaJet.Workflow.Core.Runtime.WorkflowRuntime

Provides main API to operations with workflow processes

public sealed class WorkflowRuntime

Inheritance

  • System.Object

Constructors

public WorkflowRuntime(Guid runtimeId) #
Creates the WFE runtime object

Parameters

Name
Type
Description
runtimeId
Guid
Id of the runtime (reserved for further extension)
public WorkflowRuntime(string runtimeId) #
Creates the WFE runtime object

Parameters

Name
Type
Description
runtimeId
String
Id of the runtime (reserved for further extension)
public WorkflowRuntime(IRuntimeIdProvider runtimeIdProvider) #

Parameters

Name
Type
Description
runtimeIdProvider
IRuntimeIdProvider
public WorkflowRuntime() #
Creates the WFE runtime object

Properties

Name
Type
OfflineApi #
OfflineApi
ActorsApi #
ActorsApi
GetUsersWithIdentitiesAsync #
GetUsersWithIdentitiesAsyncDelegate
GetUserByIdentityAsync #
GetUserByIdentityAsyncDelegate
GetCustomTimerValueAsync #
GetCustomTimerValueAsyncDelegate
Id #
String
Runtime identifier
Settings #
WorkflowRuntimeSettings
DesignerAutocompleteProvider #
IDesignerAutocompleteProvider
Instance of the autocomplete provider (only for the Designer) IDesignerAutocompleteProvider
CodeAutocompleteProvider #
ICodeAutocompleteProvider
Auto initialize by WorkflowRuntime.CodeAutocompleteProvider. Use setter to use custom implementation
DesignerParameterFormatProvider #
IDesignerParameterFormatProvider
Instance of the parameter format provider (only for the Designer) IDesignerParameterFormatProvider
RuleProvider #
IWorkflowRuleProvider
Instance of the Workflow rule provider IWorkflowRuleProvider
Builder #
IWorkflowBuilder
Instance of the Workflow builder IWorkflowBuilder
TimerManager #
ITimerManager
Instance of the Timer manager ITimerManager
Calendars #
ConcurrentDictionary<ICalendar>
List of work calendars ICalendar
DefaultCalendarName #
String
Default work calendar name />
PersistenceProvider #
IPersistenceProvider
Instance of the Persistence provider IPersistenceProvider
ActionProvider #
IWorkflowActionProvider
Instance of the Action provider IWorkflowActionProvider
ExternalParametersProvider #
IWorkflowExternalParametersProvider
Instance of the External parameters provider IWorkflowExternalParametersProvider
LocalizationProvider #
ILocalizationProvider
RuntimeDateTimeNow #
DateTime
Get date and time which used by runtime
IsCold #
Boolean
Runtime in cold start state if true
CancellationTokenHandling #
CancellationTokenHandling
The way of handling CancellationToken after activity execution
WorkflowServiceRunner #
IWorkflowServiceRunner
IsRunning #
Boolean
CodeActionsCompillationEnable #
Boolean
Default value is true. Enable compillation for Code Actions CodeActionDefinition
ExpressionsCompilationEnable #
Boolean
ExpressionsCompilerOptions #
ExpressionsCompilerOptions
Expressions Compiler Options
CodeActionsDebugMode #
Boolean
Default value is false. Enable debug in code action. You can put a breakpoint by Debugger.Break() or /*break*/ in a code action's code
GlobalActionsInvoker #
CodeActionsInvoker
Invoker which calls the global Code Actions
LastGlobalActionsCompilationTime #
DateTime
Time of the last global Code Actions compilation
Bulk #
IBulkApi
Gets the bulk API for the current runtime.
Localizer #
Localizer
Provides localized strings. For search used WorkflowRuntime.ExternalLocalization property by default.
Logger #
ILogger
Instance of the logger ILogger
ProcessLogger #
IProcessLogProvider

Methods

public static void CodeActionsRegisterAssembly(Assembly assembly) #
Register assembly in CodeActionsCompiller as referenced assembly

Parameters

Name
Type
Description
assembly
Assembly
public Task<(bool success, Dictionary<string, string> compilerErrors)> CompileGlobalCodeActionsAsync(bool ignoreNotCompiled) #
Compiles global Code Actions

Parameters

Name
Type
Description
ignoreNotCompiled
Boolean
if true all compillation errors in the global codeactions will be ignored

Returns

Type
Description
Task<String>
public static void RegisterLicense(string licenseText) #
Register the license to remove license restrictions

Parameters

Name
Type
Description
licenseText
String
License text
public static IWorkflowEngineNetRestriction GetLicenseRestrictions() #
Get the restrictions of the current license

Returns

Type
Description
IWorkflowEngineNetRestriction
IWorkflowEngineNetRestriction License Restrictions
public Task<bool> CheckAllSubprocessesCompletedAsync(ProcessInstance processInstance) #
Checks that all subprocesses was completed

Parameters

Name
Type
Description
processInstance
ProcessInstance
ProcessInstance for check

Returns

Type
Description
Task<Boolean>
true - if there are no active suprocesses
public Task<bool> CheckAllSubprocessesAndParentProcessCompletedAsync(ProcessInstance processInstance) #
Check that all subprocesses and the parent process reach the same point (completed)

Parameters

Name
Type
Description
processInstance
ProcessInstance

Returns

Type
Description
Task<Boolean>
public Task<int> DeleteAllSubprocessesAsync(ProcessInstance processInstance) #
Delete all subprocesses for process

Parameters

Name
Type
Description
processInstance
ProcessInstance

Returns

Type
Description
Task<Int32>
Count of deleted subprocesses
public Task SetPersistentProcessParameterAsync(Guid processId, string parameterName, object parameterValue) #
Set single persistent parameter in the process(async)

Parameters

Name
Type
Description
processId
Guid
>Process id
parameterName
String
Parameter name
parameterValue
Object
Parameter value

Returns

Type
Description
Task
public Task<IEnumerable<ProcessTimer>> GetProcessTimersAsync(Guid processId) #
Returns list of timers for a process

Parameters

Name
Type
Description
processId
Guid
Id of the process

Returns

Type
Description
Task<ProcessTimer>
public Task<ProcessStatus> GetProcessStatusAsync(Guid processId) #
Get status of specified process (async version)

Parameters

Name
Type
Description
processId
Guid
Process id

Returns

Type
Description
Task<ProcessStatus>
public Task ShutdownAsync(int timeout = -1) #
Switches off the runtime. Switches off API, waits for API calls to be completed. Switches off all timers. IMPORTANT! Call this method from the ASYNCHRONOUS method only.

Parameters

Name
Type
Description
timeout
Int32
Shutdown timeout

Returns

Type
Description
Task
public void RegisterDesignerAction(string operation, IDesignerAction designerAction) #
Register designer extension action.

Parameters

Name
Type
Description
operation
String
Operation name.
designerAction
IDesignerAction
Action.
public IDesignerAction GetDesignerAction(string operation) #
Get designer extension actions by operation.

Parameters

Name
Type
Description
operation
String
Operation name.

Returns

Type
Description
IDesignerAction
Action.
public T GetPlugin<T>() where T : IWorkflowPlugin #
Retrieves a plugin of the specified type from the list of workflow plugins.

Returns

Type
Description
{T}
The plugin that matches the specified type or null value if no matching plugin is found.
public Task ExecuteTimerAsync(Guid processId, string timerName) #

Parameters

Name
Type
Description
processId
Guid
timerName
String

Returns

Type
Description
Task
public Task SetProcessNewStatusAsync(ProcessInstance processInstance, ProcessStatus newStatus, bool suppressEvent = false) #

Parameters

Name
Type
Description
processInstance
ProcessInstance
newStatus
ProcessStatus
suppressEvent
Boolean

Returns

Type
Description
Task
public Task SetIdledOrFinalizedStatusAsync(ProcessInstance processInstance, ActivityDefinition newCurrentActivity) #

Parameters

Name
Type
Description
processInstance
ProcessInstance
newCurrentActivity
ActivityDefinition

Returns

Type
Description
Task
public Task<bool> CheckIdentityAsync(ProcessInstance processInstance, string identityId, string ruleName, string parameter, CancellationToken token) #

Parameters

Name
Type
Description
processInstance
ProcessInstance
identityId
String
ruleName
String
parameter
String
token
CancellationToken

Returns

Type
Description
Task<Boolean>
public Task<bool> CheckIdentityByActorAsync(ProcessInstance processInstance, string identityId, string actorName, CancellationToken token) #

Parameters

Name
Type
Description
processInstance
ProcessInstance
identityId
String
actorName
String
token
CancellationToken

Returns

Type
Description
Task<Boolean>
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) #
Return the list of commands which is available from current activity for specified user (async version)

Parameters

Name
Type
Description
processInstance
ProcessInstance
Process instance
identityIds
IEnumerable<String>
List of User ids for which formed initial commands list
commandNameFilter
String
Selects only the specified command if not null
mainIdentityId
String
User id for priority check of rules
culture
CultureInfo
Culture to localize command and command parameter names
conditionCheck
Boolean
If true then commands with failed condition checks will be excluded
token
CancellationToken
Cancellation token

Returns

Type
Description
Task<WorkflowCommand>
List of WorkflowCommand commands
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsAsync(ProcessInstance processInstance, string identityId) #
Return the list of commands which is available from current activity for specified user (async version)

Parameters

Name
Type
Description
processInstance
ProcessInstance
Process instance
identityId
String
User id for whom formed initial commands list

Returns

Type
Description
Task<WorkflowCommand>
List of WorkflowCommand commands
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) #
Return the list of commands which is available from current activity for specified user (async version)

Parameters

Name
Type
Description
processId
Guid
Process id
identityIds
IEnumerable<String>
List of User ids for which formed initial commands list
commandNameFilter
String
Selects only the specified command if not null
mainIdentityId
String
User id for priority check of rules
culture
CultureInfo
Culture to localize command and command parameter names
conditionCheck
Boolean
If true then commands with failed condition checks will be excluded
token
CancellationToken
Cancellation token

Returns

Type
Description
Task<WorkflowCommand>
List of WorkflowCommand commands
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsAsync(Guid processId, string identityId) #
Return the list of commands which is available from current activity for specified user (async version)

Parameters

Name
Type
Description
processId
Guid
Process id
identityId
String
User id for whom formed initial commands list

Returns

Type
Description
Task<WorkflowCommand>
List of WorkflowCommand commands
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsAsync(Guid processId, string identityId, CultureInfo culture) #
Return the list of commands which is available from current activity for specified user (async version)

Parameters

Name
Type
Description
processId
Guid
Process id
identityId
String
User id for whom formed initial commands list
culture
CultureInfo
Culture to localize command and command parameter names

Returns

Type
Description
Task<WorkflowCommand>
List of WorkflowCommand commands
public Task<CommandExecutionResult> ExecuteCommandAsync(WorkflowCommand command, string identityId, string impersonatedIdentityId, CancellationToken token = default, bool checkRestrictions = false) #
Execute specified command for specified users (async version)

Parameters

Name
Type
Description
command
WorkflowCommand
Command to execute
identityId
String
The user id which execute command
impersonatedIdentityId
String
The user id for whom executes command (impersonation)
token
CancellationToken
Cancellation token
checkRestrictions
Boolean
If true then actor restriction check will be performed for every transition

Returns

Type
Description
Task<CommandExecutionResult>
Result of the execution
public Task<CommandExecutionResult> ExecuteCommandWithRestrictionCheckAsync(WorkflowCommand command, string identityId, string impersonatedIdentityId, CancellationToken token = default) #
Execute specified command for specified users (async version) with actor restrictions check

Parameters

Name
Type
Description
command
WorkflowCommand
Command to execute
identityId
String
The user id which execute command
impersonatedIdentityId
String
The user id for whom executes command (impersonation)
token
CancellationToken
Cancellation token

Returns

Type
Description
Task<CommandExecutionResult>
Result of the execution
[Obsolete("Use GetInitialCommandsAsync(GetInitialCommandsParams parameters) instead.")] public Task<IEnumerable<WorkflowCommand>> GetInitialCommandsAsync(string schemeCode, string identityId) #
Return the list of commands which is available from initial activity for specified user (async version)

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme
identityId
String
User id for whom formed initial commands list

Returns

Type
Description
Task<WorkflowCommand>
List of WorkflowCommand commands
[Obsolete("Use GetInitialCommandsAsync(GetInitialCommandsParams parameters) instead.")] public Task<IEnumerable<WorkflowCommand>> GetInitialCommandsAsync(string schemeCode, string identityId, CultureInfo culture) #
Return the list of commands which is available from initial activity for specified user (async version)

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme
identityId
String
User id for whom formed initial commands list
culture
CultureInfo
Culture to localize command and command parameter names

Returns

Type
Description
Task<WorkflowCommand>
List of WorkflowCommand commands
[Obsolete("Use GetInitialCommandsAsync(GetInitialCommandsParams parameters) instead.")] public Task<IEnumerable<WorkflowCommand>> GetInitialCommandsAsync(string schemeCode, IEnumerable<string> identityIds, string commandNameFilter = null, CultureInfo culture = null) #
Return the list of commands which is available from initial activity for specified users (async version)

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme
identityIds
IEnumerable<String>
List of User ids for which formed initial commands list
commandNameFilter
String
Selects only the specified command if not null
culture
CultureInfo
Culture to localize command and command parameter names

Returns

Type
Description
Task<WorkflowCommand>
List of WorkflowCommand commands
public Task<IEnumerable<WorkflowCommand>> GetInitialCommandsAsync(GetInitialCommandsParams parameters) #
Return the list of commands which is available from initial activity (async version)

Parameters

Name
Type
Description
parameters
GetInitialCommandsParams
Parameters for getting initial commands

Returns

Type
Description
Task<WorkflowCommand>
List of WorkflowCommand commands
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsWithConditionCheckAsync(Guid processId, string identityId) #
Return the list of commands which is available from current activity for specified user with conditions check

Parameters

Name
Type
Description
processId
Guid
Process id
identityId
String
User id for whom formed initial commands list

Returns

Type
Description
Task<WorkflowCommand>
List of WorkflowCommand commands
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsWithConditionCheckAsync(Guid processId, string identityId, CultureInfo culture) #
Return the list of commands which is available from current activity for specified user with conditions check

Parameters

Name
Type
Description
processId
Guid
Process id
identityId
String
User id for whom formed initial commands list
culture
CultureInfo
Culture to localize command and command parameter names

Returns

Type
Description
Task<WorkflowCommand>
List of WorkflowCommand commands
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsWithConditionCheckAsync(Guid processId, IEnumerable<string> identityIds, string commandNameFilter = null, string mainIdentityId = null, CultureInfo culture = null) #
Return the list of commands which is available from current activity for specified user with conditions check

Parameters

Name
Type
Description
processId
Guid
Process id
identityIds
IEnumerable<String>
List of User ids for which formed initial commands list
commandNameFilter
String
Selects only the specified command if not null
mainIdentityId
String
User id for priority check of rules
culture
CultureInfo
Culture to localize command and command parameter names

Returns

Type
Description
Task<WorkflowCommand>
List of WorkflowCommand commands
public Task CreateInstanceAsync(string schemeCode, Guid processId, CancellationToken token = default) #
Create instance of process (async version)

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme
processId
Guid
Process id
token
CancellationToken
Cancellation token

Returns

Type
Description
Task
public Task CreateInstanceAsync(CreateInstanceParams createInstanceParams, CancellationToken token = default) #
Create instance of the process (async version)

Parameters

Name
Type
Description
createInstanceParams
CreateInstanceParams
Parameters for creation of an instance of a process
token
CancellationToken
Cancellation token

Returns

Type
Description
Task
public Task DeleteInstanceAsync(Guid processId) #
Delete instance of the process and all child subprocesses. (async version)

Parameters

Name
Type
Description
processId
Guid
Process id

Returns

Type
Description
Task
public Task<bool> IsProcessExistsAsync(Guid processId) #
Check existence of the specified process

Parameters

Name
Type
Description
processId
Guid
Process id

Returns

Type
Description
Task<Boolean>
True if process with specified identifier is exists
public Task DeleteInstanceAsync(ProcessInstance processInstance) #
Delete instance of the process and all child subprocesses. (Async version)

Parameters

Name
Type
Description
processInstance
ProcessInstance
Instance to delete

Returns

Type
Description
Task
public Task<ProcessInstancesTree> GetProcessInstancesTreeAsync(Guid rootProcessId, CancellationToken cancellationToken = default) #
Returns process instance tree (root process and subprocesses) (Async version)

Parameters

Name
Type
Description
rootProcessId
Guid
Root process id
cancellationToken
CancellationToken
Cancellation token

Returns

Type
Description
Task<ProcessInstancesTree>
ProcessInstancesTree object
public Task<ProcessInstancesTree> GetProcessInstancesTreeAsync(ProcessInstance processInstance, CancellationToken cancellationToken = default) #
Returns process instance tree (root process and subprocesses) (Async version)

Parameters

Name
Type
Description
processInstance
ProcessInstance
ProcessInstance for which tree is builds
cancellationToken
CancellationToken
Cancellation token

Returns

Type
Description
Task<ProcessInstancesTree>
ProcessInstancesTree object
public Task<ProcessInstance> GetProcessInstanceAndFillProcessParametersAsync(Guid processId) #
Get process instance with all parameters for specified process id (async version)

Parameters

Name
Type
Description
processId
Guid
Process id

Returns

Type
Description
Task<ProcessInstance>
public Task<List<ProcessHistoryItem>> GetProcessHistoryAsync(Guid processId, Paging paging = null) #
Returns the history of process (async version)

Parameters

Name
Type
Description
processId
Guid
Id of the process
paging
Paging

Returns

Type
Description
Task<ProcessHistoryItem>
public Task<int> GetProcessHistoryCountAsync(Guid processId) #
Returns count of process history (async version)

Parameters

Name
Type
Description
processId
Guid
Id of the process

Returns

Type
Description
Task<Int32>
public Task<bool> ChangeProcessLogEnabledAsync(Guid processId) #
Change log enabled for process and all subprocesses. Returns new value of log enabled.

Parameters

Name
Type
Description
processId
Guid
Id of the process.

Returns

Type
Description
Task<Boolean>
The new value of log enabled.
public string GetLocalizedStateName(Guid processId, string stateName) #
Get localized state name for specified process in current culture

Parameters

Name
Type
Description
processId
Guid
Process id
stateName
String
State name to localize

Returns

Type
Description
String
Localized state name
public Task<string> GetLocalizedStateNameAsync(Guid processId, string stateName) #
Get localized state name for specified process in current culture

Parameters

Name
Type
Description
processId
Guid
Process id
stateName
String
State name to localize

Returns

Type
Description
Task<String>
Localized state name
public string GetLocalizedStateNameBySchemeId(Guid schemeId, string stateName) #
Get localized state name for specified scheme in current culture

Parameters

Name
Type
Description
schemeId
Guid
Id of the scheme
stateName
String
State name to localize

Returns

Type
Description
String
Localized state name
public Task<string> GetLocalizedStateNameBySchemeIdAsync(Guid schemeId, string stateName) #
Get localized state name for specified scheme in current culture

Parameters

Name
Type
Description
schemeId
Guid
Id of the scheme
stateName
String
State name to localize

Returns

Type
Description
Task<String>
Localized state name
public string GetLocalizedStateNameBySchemeCode(string schemeCode, string stateName) #
Get localized state name for specified scheme in current culture

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme
stateName
String
State name to localize

Returns

Type
Description
String
Localized state name
public Task<string> GetLocalizedStateNameBySchemeCodeAsync(string schemeCode, string stateName) #
Get localized state name for specified scheme in current culture

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme
stateName
String
State name to localize

Returns

Type
Description
Task<String>
Localized state name
public string GetLocalizedStateNameBySchemeCode(string schemeCode, string? tenantId, string stateName) #
Get localized state name for specified scheme in current culture

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme
tenantId
String
Tenant identifier
stateName
String
State name to localize

Returns

Type
Description
String
Localized state name
public Task<string> GetLocalizedStateNameBySchemeCodeAsync(string schemeCode, string? tenantId, string stateName) #
Get localized state name for specified scheme in current culture

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme
tenantId
String
Tenant identifier
stateName
String
State name to localize

Returns

Type
Description
Task<String>
Localized state name
public string GetLocalizedCommandName(Guid processId, string commandName) #
Get localized command name for specified process in current culture

Parameters

Name
Type
Description
processId
Guid
Process id
commandName
String
Command name to localize

Returns

Type
Description
String
Localized command name
public Task<string> GetLocalizedCommandNameAsync(Guid processId, string commandName) #
Get localized command name for specified process in current culture

Parameters

Name
Type
Description
processId
Guid
Process id
commandName
String
Command name to localize

Returns

Type
Description
Task<String>
Localized command name
public string GetLocalizedCommandNameBySchemeId(Guid schemeId, string commandName) #
Get localized command name for specified scheme in current culture

Parameters

Name
Type
Description
schemeId
Guid
Id of the scheme
commandName
String
Command name to localize

Returns

Type
Description
String
Localized command name
public Task<string> GetLocalizedCommandNameBySchemeIdAsync(Guid schemeId, string commandName) #
Get localized command name for specified scheme in current culture

Parameters

Name
Type
Description
schemeId
Guid
Id of the scheme
commandName
String
Command name to localize

Returns

Type
Description
Task<String>
Localized command name
public void LogInfo(string message, Dictionary<string, string> parameters) #
Writes a message to the log with Info level

Parameters

Name
Type
Description
message
String
message to write
parameters
Dictionary<String>
dictionary of properties to serialize within the log entry
public void LogInfoIfLoggerExists(string message, Dictionary<string, string> parameters) #
Writes a message to the log with Info level if WorkflowRuntime.Logger is defined

Parameters

Name
Type
Description
message
String
message to write
parameters
Dictionary<String>
dictionary of properties to serialize within the log entry
public void LogDebug(string message, Dictionary<string, string> parameters) #
Writes a message to the log with Debug level

Parameters

Name
Type
Description
message
String
message to write
parameters
Dictionary<String>
dictionary of properties to serialize within the log entry
public void LogDebugIfLoggerExists(string message, Dictionary<string, string> parameters) #
Writes a message to the log with Debug level if WorkflowRuntime.Logger is defined

Parameters

Name
Type
Description
message
String
message to write
parameters
Dictionary<String>
dictionary of properties to serialize within the log entry
public void LogError(string message, Dictionary<string, string> parameters) #
Writes a message to the log with Error level

Parameters

Name
Type
Description
message
String
message to write
parameters
Dictionary<String>
dictionary of properties to serialize within the log entry
public void LogErrorIfLoggerExists(string message, Dictionary<string, string> parameters) #
Writes a message to the log with Error level if WorkflowRuntime.Logger is defined

Parameters

Name
Type
Description
message
String
message to write
parameters
Dictionary<String>
dictionary of properties to serialize within the log entry
public void LogExceptionIfLoggerExists(Exception exception, string message, Dictionary<string, string> parameters) #
Writes a message and exception properties to the log with Error level if WorkflowRuntime.Logger is defined.

Parameters

Name
Type
Description
exception
Exception
Exception to write
message
String
Message to write
parameters
Dictionary<String>
Dictionary of properties to serialize within the log entry
public Task<List<ActivityDto>> PreExecuteFromInitialActivityAsync(Guid processId, bool ignoreCurrentStateCheck = false, CancellationToken token = default) #
Pre-execution from initial activity of the process (async version)

Parameters

Name
Type
Description
processId
Guid
Process id
ignoreCurrentStateCheck
Boolean
If false and Current State Name and State Name of Current Activity is different (in case of scheme upgrade) do not run pre-execution
token
CancellationToken
Cancellation token

Returns

Type
Description
Task<ActivityDto>
List of activities which will presumably be executed
public Task<List<ActivityDto>> PreExecuteFromCurrentActivityAsync(Guid processId, bool ignoreCurrentStateCheck = false, CancellationToken token = default) #
Pre-execution from current activity of the process (async version)

Parameters

Name
Type
Description
processId
Guid
Process id
ignoreCurrentStateCheck
Boolean
If false and Current State Name and State Name of Current Activity is different (in case of scheme upgrade) do not run pre-execution
token
CancellationToken
Cancellation token

Returns

Type
Description
Task<ActivityDto>
List of activities which will presumably be executed
public Task<List<ActivityDto>> PreExecuteAsync(Guid processId, string fromActivityName, bool ignoreCurrentStateCheck = false, CancellationToken token = default) #
Pre-execution from specified activity of the process (async version)

Parameters

Name
Type
Description
processId
Guid
Process id
fromActivityName
String
Activity name which begins pre-execution
ignoreCurrentStateCheck
Boolean
If false and Current State Name and State Name of Current Activity is different (in case of scheme upgrade) do not run pre-execution
token
CancellationToken
Cancellation token

Returns

Type
Description
Task<ActivityDto>
List of activities which will presumably be executed
public Task<List<string>> GetSchemeCodesAsync(List<string>? tags = null) #
Returns the list of shared scheme codes with the given tags. If tags are null, returns all shared scheme codes.

Parameters

Name
Type
Description
tags
List<String>

Returns

Type
Description
Task<String>
public Task<List<string>> GetSchemeCodesAsync(string tenantId) #
Returns the list of scheme codes in the specified tenant scope.

Parameters

Name
Type
Description
tenantId
String

Returns

Type
Description
Task<String>
public Task<List<string>> GetSchemeCodesAsync(string tenantId, List<string> tags) #
Returns the list of scheme codes with the given tags in the specified tenant scope.

Parameters

Name
Type
Description
tenantId
String
tags
List<String>

Returns

Type
Description
Task<String>
public Task SetSchemeIsObsoleteAsync(string schemeCode, string? tenantId = null) #
Set flag IsObsolete for all schemas of process with specific code (async version)

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme
tenantId
String
Tenant id of the scheme. If null, marks schemes with the specified code obsolete in all tenants.

Returns

Type
Description
Task
public Task UpdateSchemeIfObsoleteAsync(Guid processId) #
Updating scheme of specific process

Parameters

Name
Type
Description
processId
Guid
Process id

Returns

Type
Description
Task
public Task UpdateSchemeIfObsoleteAsync(Guid processId, bool ignoreAutoSchemeUpdate) #
Updating scheme of specific process

Parameters

Name
Type
Description
processId
Guid
Process id
ignoreAutoSchemeUpdate
Boolean
If true the attribute of Activity - IsAutoScheme update will be ignored.

Returns

Type
Description
Task
public Task<ProcessInstance> UpdateSchemeIfObsoleteAsync(ProcessInstance processInstance) #
Updating scheme of a specific process instance

Parameters

Name
Type
Description
processInstance
ProcessInstance
Process instance

Returns

Type
Description
Task<ProcessInstance>
Updated process instance
public Task<ProcessDefinition> GetProcessSchemeAsync(Guid processId) #
Get procees definition (parsed scheme) for specified process (async version)

Parameters

Name
Type
Description
processId
Guid
Process id

Returns

Type
Description
Task<ProcessDefinition>
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(Guid processId) #
Get the list of all states which available for set of specified process localized in current culture (async version)

Parameters

Name
Type
Description
processId
Guid
Process id

Returns

Type
Description
Task<WorkflowState>
List of WorkflowState objects
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(Guid processId, CultureInfo culture) #
Get the list of all states which available for set of specified process localized in specified culture (async version)

Parameters

Name
Type
Description
processId
Guid
Process id
culture
CultureInfo
Culture to localize state names

Returns

Type
Description
Task<WorkflowState>
List of WorkflowState objects
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(ProcessInstance processInstance) #
Get the list of all states which available for set of specified process localized in current culture (async version)

Parameters

Name
Type
Description
processInstance
ProcessInstance
Process instance

Returns

Type
Description
Task<WorkflowState>
List of WorkflowState objects
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(ProcessInstance processInstance, CultureInfo culture) #
Get the list of all states which available for set of specified process localized in specified culture (async version)

Parameters

Name
Type
Description
processInstance
ProcessInstance
Process instance
culture
CultureInfo
Culture to localize state names

Returns

Type
Description
Task<WorkflowState>
List of WorkflowState objects
[Obsolete("Use GetAvailableStateToSetAsync(GetStateBySchemeParams parameters) instead.")] public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(string schemeCode) #
Get the list of all states which available for set of specified scheme in current culture (async version)

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme

Returns

Type
Description
Task<WorkflowState>
List of WorkflowState objects
[Obsolete("Use GetAvailableStateToSetAsync(GetStateBySchemeParams parameters) instead.")] public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(string schemeCode, CultureInfo culture) #
Get the list of all states which available for set of specified scheme in specified culture (async version)

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme
culture
CultureInfo
Culture to localize state names

Returns

Type
Description
Task<WorkflowState>
List of WorkflowState objects
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(GetStateBySchemeParams parameters) #
Get the list of all states which available for set of specified scheme (async version)

Parameters

Name
Type
Description
parameters
GetStateBySchemeParams
Parameters for getting states available for set

Returns

Type
Description
Task<WorkflowState>
List of WorkflowState objects
public Task SetStateAsync(SetStateParams setStateParams) #
Set specified state for specified process (async version)

Parameters

Name
Type
Description
setStateParams
SetStateParams
Parameters of setting stateSetStateParams

Returns

Type
Description
Task
public Task SetActivityWithoutExecutionAsync(ActivityDefinition activityToSet, ProcessInstance processInstance, bool doNotSetRunningStatus = false) #
Set specified activity as current without execution of the implementation of the activity (Async version)

Parameters

Name
Type
Description
activityToSet
ActivityDefinition
Activity to set
processInstance
ProcessInstance
Process instance for set activity as current
doNotSetRunningStatus
Boolean
The status of the process - ProcessStatus.Running will not be set if true

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) #
Set specified activity as current and executing the implementation of the activity (Async version)

Parameters

Name
Type
Description
identityId
String
The user id which set the activity
impersonatedIdentityId
String
The user id for whom sets the activity (impersonation)
parameters
IDictionary<Object>
Dictionary of ProcessInstance parameters which transferred to executed actions
activityToSet
ActivityDefinition
Activity to set
processInstance
ProcessInstance
Process instance for set activity as current
doNotSetRunningStatus
Boolean
The status of the process - ProcessStatus.Running will not be set if true
token
CancellationToken
Cancellation token

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) #
Set specified activity as current and executing the implementation of the activity (Async version)

Parameters

Name
Type
Description
identityId
String
The user id which set the activity
impersonatedIdentityId
String
The user id for whom sets the activity (impersonation)
parameters
IDictionary<Object>
Dictionary of ProcessInstance parameters which transferred to executed actions
activityToSet
ActivityDefinition
Activity to set
processInstance
ProcessInstance
Process instance for set activity as current
doNotSetRunningStatus
Boolean
The status of the process - ProcessStatus.Running will not be set if true
persist
List<String>
List of parameters which should persist
token
CancellationToken
Cancellation token

Returns

Type
Description
Task
public Task<ResumeResult> ResumeAsync(Guid processId, CancellationToken token = default) #
Resumes the process from the current activity. In this case, the activity itself is not executed, and the process goes on if it can.

Parameters

Name
Type
Description
processId
Guid
token
CancellationToken

Returns

Type
Description
Task<ResumeResult>
public Task<ResumeResult> ResumeAsync(ResumeParams resumeParams, CancellationToken token = default) #
Resumes the process from the current or specific activity. In this case, the activity itself is not executed, and the process goes on if it can.

Parameters

Name
Type
Description
resumeParams
ResumeParams
token
CancellationToken

Returns

Type
Description
Task<ResumeResult>
public Task<string> GetCurrentStateNameAsync(Guid processId) #
Return the current state name of specified process (async version)

Parameters

Name
Type
Description
processId
Guid
Process id

Returns

Type
Description
Task<String>
Name of current state
public Task<string> GetCurrentActivityNameAsync(Guid processId) #
Return the current activity name of specified process (async version)

Parameters

Name
Type
Description
processId
Guid
Process id

Returns

Type
Description
Task<String>
Current activity name
public Task<WorkflowState> GetCurrentStateAsync(Guid processId, CultureInfo culture = null) #
Return the current state of specified process (async version)

Parameters

Name
Type
Description
processId
Guid
Process id
culture
CultureInfo
Culture to localize state name

Returns

Type
Description
Task<WorkflowState>
[Obsolete("Use GetInitialStateAsync(GetStateBySchemeParams parameters) instead.")] public Task<WorkflowState> GetInitialStateAsync(string schemeCode, CultureInfo culture = null) #
Return the initial state for process scheme (async version)

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme
culture
CultureInfo
Culture to localize state name

Returns

Type
Description
Task<WorkflowState>
public Task<WorkflowState> GetInitialStateAsync(GetStateBySchemeParams parameters) #
Return the initial state for process scheme (async version)

Parameters

Name
Type
Description
parameters
GetStateBySchemeParams
Parameters for getting initial state

Returns

Type
Description
Task<WorkflowState>

Fields

public List<IWorkflowPlugin> Plugins #
All registered plugins
public List<ActivityBase> CustomActivities #
All custom activities
public List<FormBase> CustomConditions #

Events

public event EventHandler<CodeActionsCompiledEventArgs> GlobalCodeActionsCompiled #
Raises after global Code Actions compilation
public event EventHandler<SchemaWasChangedEventArgs> OnSchemaWasChanged #
Raises when the scheme of the process was changed
public event EventHandler<WorkflowErrorEventArgs> OnWorkflowError #
Raises when workflow error occurred
public event EventHandler<StartingTransitionNotFoundEventArgs> OnStartingTransitionNotFound #
Raises when runtime can not find starting transition of a subprocess in a new root scheme
public event EventHandler<ProcessActivityChangedEventArgs> OnProcessActivityChanged #
Raises when current activity of a process was changed
public event EventHandler<BeforeActivityExecutionEventArgs> OnBeforeActivityExecution #
Raises before execution of choosen activity
public event EventHandler<ProcessStatusChangedEventArgs> OnProcessStatusChanged #
Raises when the status of the procees ProcessStatus was changed
public event EventHandler<RuntimeStartEventArgs> OnRuntimeStart #
Raises just after the runtime was started
public event EventHandler<EventArgs> OnRuntimeShutdown #
Raises just before the runtime switched off its API
public event AsyncEventHandler<SchemaWasChangedEventArgs> OnSchemaWasChangedAsync #
Raises when the scheme of the process was changed
public event AsyncEventHandler<WorkflowErrorEventArgs> OnWorkflowErrorAsync #
Raises when workflow error occurred
public event AsyncEventHandler<StartingTransitionNotFoundEventArgs> OnStartingTransitionNotFoundAsync #
Raises when runtime can not find starting transition of a subprocess in a new root scheme
public event AsyncEventHandler<ProcessActivityChangedEventArgs> OnProcessActivityChangedAsync #
Raises when current activity of a process was changed
public event AsyncEventHandler<BeforeActivityExecutionEventArgs> OnBeforeActivityExecutionAsync #
Raises before execution of choosen activity
public event AsyncEventHandler<ProcessStatusChangedEventArgs> OnProcessStatusChangedAsync #
Raises when the status of the procees ProcessStatus was changed
public event AsyncEventHandler<RuntimeStartEventArgs> OnRuntimeStartAsync #
Raises just after the runtime was started
public event AsyncEventHandler<EventArgs> OnRuntimeShutdownAsync #
Raises just before the runtime switched off its API