Class WorkflowRuntime
OptimaJet.Workflow.Core.Runtime.WorkflowRuntime
Provides main API to operations with workflow processes
Namespace: OptimaJet.Workflow.Core.Runtime
public sealed class WorkflowRuntimeInheritance
- System.Object
Constructors
public WorkflowRuntime(Guid runtimeId) #Creates the WFE runtime object
Parameters
Name
Type
Description
runtimeIdGuidId of the runtime (reserved for further extension)
public WorkflowRuntime(string runtimeId) #Creates the WFE runtime object
Parameters
Name
Type
Description
runtimeIdStringId of the runtime (reserved for further extension)
public WorkflowRuntime(IRuntimeIdProvider runtimeIdProvider) #Parameters
Name
Type
Description
runtimeIdProviderIRuntimeIdProviderpublic WorkflowRuntime() #Creates the WFE runtime object
Properties
Name
Type
OfflineApi #OfflineApiActorsApi #ActorsApiGetUsersWithIdentitiesAsync #GetUsersWithIdentitiesAsyncDelegateGetUserByIdentityAsync #GetUserByIdentityAsyncDelegateGetCustomTimerValueAsync #GetCustomTimerValueAsyncDelegateId #StringRuntime identifier
Settings #WorkflowRuntimeSettingsDesignerAutocompleteProvider #IDesignerAutocompleteProviderInstance of the autocomplete provider (only for the Designer) IDesignerAutocompleteProvider
CodeAutocompleteProvider #ICodeAutocompleteProviderAuto initialize by WorkflowRuntime.CodeAutocompleteProvider. Use setter to use custom implementation
DesignerParameterFormatProvider #IDesignerParameterFormatProviderInstance of the parameter format provider (only for the Designer) IDesignerParameterFormatProvider
RuleProvider #IWorkflowRuleProviderInstance of the Workflow rule provider IWorkflowRuleProvider
Builder #IWorkflowBuilderInstance of the Workflow builder IWorkflowBuilder
TimerManager #ITimerManagerInstance of the Timer manager ITimerManager
Calendars #ConcurrentDictionary<ICalendar>List of work calendars ICalendar
DefaultCalendarName #StringDefault work calendar name />
PersistenceProvider #IPersistenceProviderInstance of the Persistence provider IPersistenceProvider
ActionProvider #IWorkflowActionProviderInstance of the Action provider IWorkflowActionProvider
ExternalParametersProvider #IWorkflowExternalParametersProviderInstance of the External parameters provider IWorkflowExternalParametersProvider
LocalizationProvider #ILocalizationProviderRuntimeDateTimeNow #DateTimeGet date and time which used by runtime
IsCold #BooleanRuntime in cold start state if true
CancellationTokenHandling #CancellationTokenHandlingThe way of handling CancellationToken after activity execution
WorkflowServiceRunner #IWorkflowServiceRunnerIsRunning #BooleanCodeActionsCompillationEnable #BooleanDefault value is true. Enable compillation for Code Actions CodeActionDefinition
ExpressionsCompilationEnable #BooleanExpressionsCompilerOptions #ExpressionsCompilerOptionsExpressions Compiler Options
CodeActionsDebugMode #BooleanDefault 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 #CodeActionsInvokerInvoker which calls the global Code Actions
LastGlobalActionsCompilationTime #DateTimeTime of the last global Code Actions compilation
Bulk #IBulkApiGets the bulk API for the current runtime.
Localizer #LocalizerProvides localized strings. For search used WorkflowRuntime.ExternalLocalization property by default.
Logger #ILoggerInstance of the logger ILogger
ProcessLogger #IProcessLogProviderMethods
public static void CodeActionsRegisterAssembly(Assembly assembly) #Register assembly in CodeActionsCompiller as referenced assembly
Parameters
Name
Type
Description
assemblyAssemblypublic Task<(bool success, Dictionary<string, string> compilerErrors)> CompileGlobalCodeActionsAsync(bool ignoreNotCompiled) #Compiles global Code Actions
Parameters
Name
Type
Description
ignoreNotCompiledBooleanif 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
licenseTextStringLicense text
public static IWorkflowEngineNetRestriction GetLicenseRestrictions() #Get the restrictions of the current license
Returns
Type
Description
IWorkflowEngineNetRestrictionIWorkflowEngineNetRestriction License Restrictions
public Task<bool> CheckAllSubprocessesCompletedAsync(ProcessInstance processInstance) #Checks that all subprocesses was completed
Parameters
Name
Type
Description
processInstanceProcessInstanceProcessInstance 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
processInstanceProcessInstanceReturns
Type
Description
Task<Boolean>public Task<int> DeleteAllSubprocessesAsync(ProcessInstance processInstance) #Delete all subprocesses for process
Parameters
Name
Type
Description
processInstanceProcessInstanceReturns
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
processIdGuid>Process id
parameterNameStringParameter name
parameterValueObjectParameter value
Returns
Type
Description
Taskpublic Task<IEnumerable<ProcessTimer>> GetProcessTimersAsync(Guid processId) #Returns list of timers for a process
Parameters
Name
Type
Description
processIdGuidId 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
processIdGuidProcess id
Returns
Type
Description
Task<ProcessStatus>ProcessStatus object
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
timeoutInt32Shutdown timeout
Returns
Type
Description
Taskpublic void RegisterDesignerAction(string operation, IDesignerAction designerAction) #Register designer extension action.
Parameters
Name
Type
Description
operationStringOperation name.
designerActionIDesignerActionAction.
public IDesignerAction GetDesignerAction(string operation) #Get designer extension actions by operation.
Parameters
Name
Type
Description
operationStringOperation name.
Returns
Type
Description
IDesignerActionAction.
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
processIdGuidtimerNameStringReturns
Type
Description
Taskpublic Task SetProcessNewStatusAsync(ProcessInstance processInstance, ProcessStatus newStatus, bool suppressEvent = false) #Parameters
Name
Type
Description
processInstanceProcessInstancenewStatusProcessStatussuppressEventBooleanReturns
Type
Description
Taskpublic Task SetIdledOrFinalizedStatusAsync(ProcessInstance processInstance, ActivityDefinition newCurrentActivity) #Parameters
Name
Type
Description
processInstanceProcessInstancenewCurrentActivityActivityDefinitionReturns
Type
Description
Taskpublic Task<bool> CheckIdentityAsync(ProcessInstance processInstance, string identityId, string ruleName, string parameter, CancellationToken token) #Parameters
Name
Type
Description
processInstanceProcessInstanceidentityIdStringruleNameStringparameterStringtokenCancellationTokenReturns
Type
Description
Task<Boolean>public Task<bool> CheckIdentityByActorAsync(ProcessInstance processInstance, string identityId, string actorName, CancellationToken token) #Parameters
Name
Type
Description
processInstanceProcessInstanceidentityIdStringactorNameStringtokenCancellationTokenReturns
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
processInstanceProcessInstanceProcess instance
identityIdsIEnumerable<String>List of User ids for which formed initial commands list
commandNameFilterStringSelects only the specified command if not null
mainIdentityIdStringUser id for priority check of rules
cultureCultureInfoCulture to localize command and command parameter names
conditionCheckBooleanIf true then commands with failed condition checks will be excluded
tokenCancellationTokenCancellation 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
processInstanceProcessInstanceProcess instance
identityIdStringUser 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
processIdGuidProcess id
identityIdsIEnumerable<String>List of User ids for which formed initial commands list
commandNameFilterStringSelects only the specified command if not null
mainIdentityIdStringUser id for priority check of rules
cultureCultureInfoCulture to localize command and command parameter names
conditionCheckBooleanIf true then commands with failed condition checks will be excluded
tokenCancellationTokenCancellation 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
processIdGuidProcess id
identityIdStringUser 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
processIdGuidProcess id
identityIdStringUser id for whom formed initial commands list
cultureCultureInfoCulture 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
commandWorkflowCommandCommand to execute
identityIdStringThe user id which execute command
impersonatedIdentityIdStringThe user id for whom executes command (impersonation)
tokenCancellationTokenCancellation token
checkRestrictionsBooleanIf 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
commandWorkflowCommandCommand to execute
identityIdStringThe user id which execute command
impersonatedIdentityIdStringThe user id for whom executes command (impersonation)
tokenCancellationTokenCancellation 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
schemeCodeStringCode of the scheme
identityIdStringUser 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
schemeCodeStringCode of the scheme
identityIdStringUser id for whom formed initial commands list
cultureCultureInfoCulture 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
schemeCodeStringCode of the scheme
identityIdsIEnumerable<String>List of User ids for which formed initial commands list
commandNameFilterStringSelects only the specified command if not null
cultureCultureInfoCulture 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
parametersGetInitialCommandsParamsParameters 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
processIdGuidProcess id
identityIdStringUser 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
processIdGuidProcess id
identityIdStringUser id for whom formed initial commands list
cultureCultureInfoCulture 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
processIdGuidProcess id
identityIdsIEnumerable<String>List of User ids for which formed initial commands list
commandNameFilterStringSelects only the specified command if not null
mainIdentityIdStringUser id for priority check of rules
cultureCultureInfoCulture 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
schemeCodeStringCode of the scheme
processIdGuidProcess id
tokenCancellationTokenCancellation token
Returns
Type
Description
Taskpublic Task CreateInstanceAsync(CreateInstanceParams createInstanceParams, CancellationToken token = default) #Create instance of the process (async version)
Parameters
Name
Type
Description
createInstanceParamsCreateInstanceParamsParameters for creation of an instance of a process
tokenCancellationTokenCancellation token
Returns
Type
Description
Taskpublic Task DeleteInstanceAsync(Guid processId) #Delete instance of the process and all child subprocesses. (async version)
Parameters
Name
Type
Description
processIdGuidProcess id
Returns
Type
Description
Taskpublic Task<bool> IsProcessExistsAsync(Guid processId) #Check existence of the specified process
Parameters
Name
Type
Description
processIdGuidProcess 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
processInstanceProcessInstanceInstance to delete
Returns
Type
Description
Taskpublic Task<ProcessInstancesTree> GetProcessInstancesTreeAsync(Guid rootProcessId, CancellationToken cancellationToken = default) #Returns process instance tree (root process and subprocesses) (Async version)
Parameters
Name
Type
Description
rootProcessIdGuidRoot process id
cancellationTokenCancellationTokenCancellation 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
processInstanceProcessInstanceProcessInstance for which tree is builds
cancellationTokenCancellationTokenCancellation 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
processIdGuidProcess id
Returns
Type
Description
Task<ProcessInstance>ProcessInstance object
public Task<List<ProcessHistoryItem>> GetProcessHistoryAsync(Guid processId, Paging paging = null) #Returns the history of process (async version)
Parameters
Name
Type
Description
processIdGuidId of the process
pagingPagingReturns
Type
Description
Task<ProcessHistoryItem>public Task<int> GetProcessHistoryCountAsync(Guid processId) #Returns count of process history (async version)
Parameters
Name
Type
Description
processIdGuidId 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
processIdGuidId 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
processIdGuidProcess id
stateNameStringState name to localize
Returns
Type
Description
StringLocalized state name
public Task<string> GetLocalizedStateNameAsync(Guid processId, string stateName) #Get localized state name for specified process in current culture
Parameters
Name
Type
Description
processIdGuidProcess id
stateNameStringState 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
schemeIdGuidId of the scheme
stateNameStringState name to localize
Returns
Type
Description
StringLocalized state name
public Task<string> GetLocalizedStateNameBySchemeIdAsync(Guid schemeId, string stateName) #Get localized state name for specified scheme in current culture
Parameters
Name
Type
Description
schemeIdGuidId of the scheme
stateNameStringState 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
schemeCodeStringCode of the scheme
stateNameStringState name to localize
Returns
Type
Description
StringLocalized state name
public Task<string> GetLocalizedStateNameBySchemeCodeAsync(string schemeCode, string stateName) #Get localized state name for specified scheme in current culture
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme
stateNameStringState 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
schemeCodeStringCode of the scheme
tenantIdStringTenant identifier
stateNameStringState name to localize
Returns
Type
Description
StringLocalized 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
schemeCodeStringCode of the scheme
tenantIdStringTenant identifier
stateNameStringState 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
processIdGuidProcess id
commandNameStringCommand name to localize
Returns
Type
Description
StringLocalized command name
public Task<string> GetLocalizedCommandNameAsync(Guid processId, string commandName) #Get localized command name for specified process in current culture
Parameters
Name
Type
Description
processIdGuidProcess id
commandNameStringCommand 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
schemeIdGuidId of the scheme
commandNameStringCommand name to localize
Returns
Type
Description
StringLocalized command name
public Task<string> GetLocalizedCommandNameBySchemeIdAsync(Guid schemeId, string commandName) #Get localized command name for specified scheme in current culture
Parameters
Name
Type
Description
schemeIdGuidId of the scheme
commandNameStringCommand 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
messageStringmessage to write
parametersDictionary<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
messageStringmessage to write
parametersDictionary<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
messageStringmessage to write
parametersDictionary<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
messageStringmessage to write
parametersDictionary<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
messageStringmessage to write
parametersDictionary<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
messageStringmessage to write
parametersDictionary<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
exceptionExceptionException to write
messageStringMessage to write
parametersDictionary<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
processIdGuidProcess id
ignoreCurrentStateCheckBooleanIf false and Current State Name and State Name of Current Activity is different (in case of scheme upgrade) do not run pre-execution
tokenCancellationTokenCancellation 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
processIdGuidProcess id
ignoreCurrentStateCheckBooleanIf false and Current State Name and State Name of Current Activity is different (in case of scheme upgrade) do not run pre-execution
tokenCancellationTokenCancellation 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
processIdGuidProcess id
fromActivityNameStringActivity name which begins pre-execution
ignoreCurrentStateCheckBooleanIf false and Current State Name and State Name of Current Activity is different (in case of scheme upgrade) do not run pre-execution
tokenCancellationTokenCancellation 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
tagsList<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
tenantIdStringReturns
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
tenantIdStringtagsList<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
schemeCodeStringCode of the scheme
tenantIdStringTenant id of the scheme. If null, marks schemes with the specified code obsolete in all tenants.
Returns
Type
Description
Taskpublic Task UpdateSchemeIfObsoleteAsync(Guid processId) #Updating scheme of specific process
Parameters
Name
Type
Description
processIdGuidProcess id
Returns
Type
Description
Taskpublic Task UpdateSchemeIfObsoleteAsync(Guid processId, bool ignoreAutoSchemeUpdate) #Updating scheme of specific process
Parameters
Name
Type
Description
processIdGuidProcess id
ignoreAutoSchemeUpdateBooleanIf true the attribute of Activity - IsAutoScheme update will be ignored.
Returns
Type
Description
Taskpublic Task<ProcessInstance> UpdateSchemeIfObsoleteAsync(ProcessInstance processInstance) #Updating scheme of a specific process instance
Parameters
Name
Type
Description
processInstanceProcessInstanceProcess 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
processIdGuidProcess id
Returns
Type
Description
Task<ProcessDefinition>ProcessDefinition object
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
processIdGuidProcess 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
processIdGuidProcess id
cultureCultureInfoCulture 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
processInstanceProcessInstanceProcess 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
processInstanceProcessInstanceProcess instance
cultureCultureInfoCulture 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
schemeCodeStringCode 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
schemeCodeStringCode of the scheme
cultureCultureInfoCulture 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
parametersGetStateBySchemeParamsParameters 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
Returns
Type
Description
Taskpublic 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
activityToSetActivityDefinitionActivity to set
processInstanceProcessInstanceProcess instance for set activity as current
doNotSetRunningStatusBooleanThe status of the process - ProcessStatus.Running will not be set if true
Returns
Type
Description
Taskpublic 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
identityIdStringThe user id which set the activity
impersonatedIdentityIdStringThe user id for whom sets the activity (impersonation)
parametersIDictionary<Object>Dictionary of ProcessInstance parameters which transferred to executed actions
activityToSetActivityDefinitionActivity to set
processInstanceProcessInstanceProcess instance for set activity as current
doNotSetRunningStatusBooleanThe status of the process - ProcessStatus.Running will not be set if true
tokenCancellationTokenCancellation token
Returns
Type
Description
Taskpublic 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
identityIdStringThe user id which set the activity
impersonatedIdentityIdStringThe user id for whom sets the activity (impersonation)
parametersIDictionary<Object>Dictionary of ProcessInstance parameters which transferred to executed actions
activityToSetActivityDefinitionActivity to set
processInstanceProcessInstanceProcess instance for set activity as current
doNotSetRunningStatusBooleanThe status of the process - ProcessStatus.Running will not be set if true
persistList<String>List of parameters which should persist
tokenCancellationTokenCancellation token
Returns
Type
Description
Taskpublic 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
processIdGuidtokenCancellationTokenReturns
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
resumeParamsResumeParamstokenCancellationTokenReturns
Type
Description
Task<ResumeResult>public Task<string> GetCurrentStateNameAsync(Guid processId) #Return the current state name of specified process (async version)
Parameters
Name
Type
Description
processIdGuidProcess 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
processIdGuidProcess 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
processIdGuidProcess id
cultureCultureInfoCulture to localize state name
Returns
Type
Description
Task<WorkflowState>WorkflowState object
[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
schemeCodeStringCode of the scheme
cultureCultureInfoCulture to localize state name
Returns
Type
Description
Task<WorkflowState>WorkflowState object
public Task<WorkflowState> GetInitialStateAsync(GetStateBySchemeParams parameters) #Return the initial state for process scheme (async version)
Parameters
Name
Type
Description
parametersGetStateBySchemeParamsParameters for getting initial state
Returns
Type
Description
Task<WorkflowState>WorkflowState object
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