Skip to main content

Introducing Formengine - The New Formbuilder, try for FREE formengine.io.

Class WorkflowRuntime

Provides main API to operations with workflow processes

Inheritance

↳ object

    ↳ WorkflowRuntime

Inherited Members

Equals(object)

Equals(object, object)

GetHashCode()

GetType()

ReferenceEquals(object, object)

ToString()

Namespace: OptimaJet.Workflow.Core.Runtime

Assembly: OptimaJet.Workflow.Core.dll

Syntax
public sealed class WorkflowRuntime

Constructors

WorkflowRuntime(Guid)

Creates the WFE runtime object

Declaration
public WorkflowRuntime(Guid runtimeId)
Parameters
TypeNameDescription
GuidruntimeIdId of the runtime (reserved for further extension)

WorkflowRuntime(string)

Creates the WFE runtime object

Declaration
public WorkflowRuntime(string runtimeId)
Parameters
TypeNameDescription
stringruntimeIdId of the runtime (reserved for further extension)

WorkflowRuntime(IRuntimeIdProvider)

Declaration
public WorkflowRuntime(IRuntimeIdProvider runtimeIdProvider)
Parameters
TypeNameDescription
IRuntimeIdProviderruntimeIdProvider

WorkflowRuntime()

Creates the WFE runtime object

Declaration
public WorkflowRuntime()

Properties

OfflineApi

Declaration
public OfflineApi OfflineApi { get; }
Property value
TypeDescription
OfflineApi

AssignmentApi

Declaration
public AssignmentApi AssignmentApi { get; }
Property value
TypeDescription
AssignmentApi

ActorsApi

Declaration
public ActorsApi ActorsApi { get; }
Property value
TypeDescription
ActorsApi

GetUsersWithIdentitiesAsync

Declaration
public GetUsersWithIdentitiesAsyncDelegate GetUsersWithIdentitiesAsync { get; set; }
Property value
TypeDescription
GetUsersWithIdentitiesAsyncDelegate

GetUserByIdentityAsync

Declaration
public GetUserByIdentityAsyncDelegate GetUserByIdentityAsync { get; set; }
Property value
TypeDescription
GetUserByIdentityAsyncDelegate

GetCustomTimerValueAsync

Declaration
public GetCustomTimerValueAsyncDelegate GetCustomTimerValueAsync { get; set; }
Property value
TypeDescription
GetCustomTimerValueAsyncDelegate

Id

Runtime identifier

Declaration
public string Id { get; }
Property value
TypeDescription
string

Settings

Declaration
public WorkflowRuntimeSettings Settings { get; }
Property value
TypeDescription
WorkflowRuntimeSettings

DesignerAutocompleteProvider

Instance of the autocomplete provider (only for the Designer) IDesignerAutocompleteProvider

Declaration
public IDesignerAutocompleteProvider DesignerAutocompleteProvider { get; set; }
Property value
TypeDescription
IDesignerAutocompleteProvider

CodeAutocompleteProvider

Auto initialize by WorkflowRuntime.CodeAutocompleteProvider. Use setter to use custom implementation

Declaration
public ICodeAutocompleteProvider CodeAutocompleteProvider { get; set; }
Property value
TypeDescription
ICodeAutocompleteProvider

DesignerParameterFormatProvider

Instance of the parameter format provider (only for the Designer) IDesignerParameterFormatProvider

Declaration
public IDesignerParameterFormatProvider DesignerParameterFormatProvider { get; set; }
Property value
TypeDescription
IDesignerParameterFormatProvider

RuleProvider

Instance of the Workflow rule provider IWorkflowRuleProvider

Declaration
public IWorkflowRuleProvider RuleProvider { get; }
Property value
TypeDescription
IWorkflowRuleProvider

Builder

Instance of the Workflow builder IWorkflowBuilder

Declaration
public IWorkflowBuilder Builder { get; }
Property value
TypeDescription
IWorkflowBuilder

TimerManager

Instance of the Timer manager ITimerManager

Declaration
public ITimerManager TimerManager { get; }
Property value
TypeDescription
ITimerManager

Calendars

List of work calendars ICalendar

Declaration
public ConcurrentDictionary<string, ICalendar> Calendars { get; set; }
Property value
TypeDescription
ConcurrentDictionary<string, ICalendar>

DefaultCalendarName

Default work calendar name />

Declaration
public string DefaultCalendarName { get; }
Property value
TypeDescription
string

PersistenceProvider

Instance of the Persistence provider IPersistenceProvider

Declaration
public IPersistenceProvider PersistenceProvider { get; }
Property value
TypeDescription
IPersistenceProvider

ActionProvider

Instance of the Action provider IWorkflowActionProvider

Declaration
public IWorkflowActionProvider ActionProvider { get; }
Property value
TypeDescription
IWorkflowActionProvider

ExternalParametersProvider

Instance of the External parameters provider IWorkflowExternalParametersProvider

Declaration
public IWorkflowExternalParametersProvider ExternalParametersProvider { get; }
Property value
TypeDescription
IWorkflowExternalParametersProvider

LocalizationProvider

Declaration
public ILocalizationProvider? LocalizationProvider { get; }
Property value
TypeDescription
ILocalizationProvider

RuntimeDateTimeNow

Get date and time which used by runtime

Declaration
public DateTime RuntimeDateTimeNow { get; }
Property value
TypeDescription
DateTime

IsCold

Runtime in cold start state if true

Declaration
public bool IsCold { get; }
Property value
TypeDescription
bool

CancellationTokenHandling

The way of handling System.Threading.CancellationToken after activity execution

Declaration
public CancellationTokenHandling CancellationTokenHandling { get; set; }
Property value
TypeDescription
CancellationTokenHandling

WorkflowServiceRunner

Declaration
public IWorkflowServiceRunner WorkflowServiceRunner { get; }
Property value
TypeDescription
IWorkflowServiceRunner

IsRunning

Declaration
public bool IsRunning { get; }
Property value
TypeDescription
bool

CodeActionsCompillationEnable

Default value is true. Enable compillation for Code Actions CodeActionDefinition

Declaration
public static bool CodeActionsCompillationEnable { get; set; }
Property value
TypeDescription
bool

ExpressionsCompilationEnable

Declaration
public static bool ExpressionsCompilationEnable { get; set; }
Property value
TypeDescription
bool

ExpressionsCompilerOptions

Expressions Compiler Options

Declaration
public static ExpressionsCompilerOptions ExpressionsCompilerOptions { get; set; }
Property value
TypeDescription
ExpressionsCompilerOptions

CodeActionsDebugMode

Default value is false. Enable debug in code action. You can put a breakpoint by or /break/ in a code action's code

Declaration
public static bool CodeActionsDebugMode { get; set; }
Property value
TypeDescription
bool

GlobalActionsInvoker

Invoker which calls the global Code Actions

Declaration
public CodeActionsInvoker GlobalActionsInvoker { get; }
Property value
TypeDescription
CodeActionsInvoker

LastGlobalActionsCompilationTime

Time of the last global Code Actions compilation

Declaration
public DateTime LastGlobalActionsCompilationTime { get; }
Property value
TypeDescription
DateTime

Bulk

Gets the bulk API for the current runtime.

Declaration
public IBulkApi Bulk { get; }
Property value
TypeDescription
IBulkApi

Localizer

Provides localized strings. For search used property by default.

Declaration
public Localizer Localizer { get; }
Property value
TypeDescription
Localizer

Logger

Instance of the logger ILogger

Declaration
public ILogger Logger { get; set; }
Property value
TypeDescription
ILogger

ProcessLogger

Declaration
public IProcessLogProvider ProcessLogger { get; set; }
Property value
TypeDescription
IProcessLogProvider

Methods

CodeActionsRegisterAssembly(Assembly)

Register assembly in CodeActionsCompiller as referenced assembly

Declaration
public static void CodeActionsRegisterAssembly(Assembly assembly)
Parameters
TypeNameDescription
Assemblyassembly

CompileGlobalCodeActionsAsync(bool)

Compiles global Code Actions

Declaration
public Task<(bool success, Dictionary<string, string> compilerErrors)> CompileGlobalCodeActionsAsync(bool ignoreNotCompiled)
Parameters
TypeNameDescription
boolignoreNotCompiledif true all compillation errors in the global codeactions will be ignored
Returns
TypeDescription
Task<(bool success, Dictionary<string, string> compilerErrors)>

RegisterLicense(string)

Register the license to remove license restrictions

Declaration
public static void RegisterLicense(string licenseText)
Parameters
TypeNameDescription
stringlicenseTextLicense text

GetLicenseRestrictions()

Get the restrictions of the current license

Declaration
public static IWorkflowEngineNetRestriction GetLicenseRestrictions()
Returns
TypeDescription
IWorkflowEngineNetRestriction<xref href="OptimaJet.Workflow.Core.License.IWorkflowEngineNetRestriction" data-throw-if-not-resolved="false"></xref> License Restrictions

CheckAllSubprocessesCompletedAsync(ProcessInstance)

Checks that all subprocesses was completed

Declaration
public Task<bool> CheckAllSubprocessesCompletedAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcessInstance for check
Returns
TypeDescription
Task<bool>true - if there are no active suprocesses

CheckAllSubprocessesAndParentProcessCompletedAsync(ProcessInstance)

Check that all subprocesses and the parent process reach the same point (completed)

Declaration
public Task<bool> CheckAllSubprocessesAndParentProcessCompletedAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstance
Returns
TypeDescription
Task<bool>

DeleteAllSubprocessesAsync(ProcessInstance)

Delete all subprocesses for process

Declaration
public Task<int> DeleteAllSubprocessesAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstance
Returns
TypeDescription
Task<int>Count of deleted subprocesses

SetPersistentProcessParameterAsync(Guid, string, object)

Set single persistent parameter in the process(async)

Declaration
public Task SetPersistentProcessParameterAsync(Guid processId, string parameterName, object parameterValue)
Parameters
TypeNameDescription
GuidprocessId>Process id
stringparameterNameParameter name
objectparameterValueParameter value
Returns
TypeDescription
Task

GetProcessTimersAsync(Guid)

Returns list of timers for a process

Declaration
public Task<IEnumerable<ProcessTimer>> GetProcessTimersAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdId of the process
Returns
TypeDescription
Task<IEnumerable<ProcessTimer>>

SetTimerValueAsync(Guid, string, DateTime)

Sets new value of named timer (async version). Use this method outside of your process.

Declaration
public Task SetTimerValueAsync(Guid processId, string timerName, DateTime newValue)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringtimerNameTimer name in Scheme
DateTimenewValueNew value of the timer
Returns
TypeDescription
Task

ResetTimerValueAsync(Guid, string)

Resets value of named timer (async version)

Declaration
public Task ResetTimerValueAsync(Guid processId, string timerName)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringtimerNameTimer name in Scheme
Returns
TypeDescription
Task

GetProcessStatusAsync(Guid)

Get status of specified process (async version)

Declaration
public Task<ProcessStatus> GetProcessStatusAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
Task<ProcessStatus><xref href="OptimaJet.Workflow.Core.Persistence.ProcessStatus" data-throw-if-not-resolved="false"></xref> object

ShutdownAsync(int)

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.

Declaration
public Task ShutdownAsync(int timeout = -1)
Parameters
TypeNameDescription
inttimeoutShutdown timeout
Returns
TypeDescription
Task

RegisterDesignerAction(string, IDesignerAction)

Register designer extension action.

Declaration
public void RegisterDesignerAction(string operation, IDesignerAction designerAction)
Parameters
TypeNameDescription
stringoperationOperation name.
IDesignerActiondesignerActionAction.

GetDesignerAction(string)

Get designer extension actions by operation.

Declaration
public IDesignerAction GetDesignerAction(string operation)
Parameters
TypeNameDescription
stringoperationOperation name.
Returns
TypeDescription
IDesignerActionAction.

ExecuteTimerAsync(Guid, string)

Declaration
public Task ExecuteTimerAsync(Guid processId, string timerName)
Parameters
TypeNameDescription
GuidprocessId
stringtimerName
Returns
TypeDescription
Task

SetProcessNewStatusAsync(ProcessInstance, ProcessStatus, bool)

Declaration
public Task SetProcessNewStatusAsync(ProcessInstance processInstance, ProcessStatus newStatus, bool suppressEvent = false)
Parameters
TypeNameDescription
ProcessInstanceprocessInstance
ProcessStatusnewStatus
boolsuppressEvent
Returns
TypeDescription
Task

SetIdledOrFinalizedStatusAsync(ProcessInstance, ActivityDefinition)

Declaration
public Task SetIdledOrFinalizedStatusAsync(ProcessInstance processInstance, ActivityDefinition newCurrentActivity)
Parameters
TypeNameDescription
ProcessInstanceprocessInstance
ActivityDefinitionnewCurrentActivity
Returns
TypeDescription
Task

CheckIdentityAsync(ProcessInstance, string, string, string, CancellationToken)

Declaration
public Task<bool> CheckIdentityAsync(ProcessInstance processInstance, string identityId, string ruleName, string parameter, CancellationToken token)
Parameters
TypeNameDescription
ProcessInstanceprocessInstance
stringidentityId
stringruleName
stringparameter
CancellationTokentoken
Returns
TypeDescription
Task<bool>

CheckIdentityByActorAsync(ProcessInstance, string, string, CancellationToken)

Declaration
public Task<bool> CheckIdentityByActorAsync(ProcessInstance processInstance, string identityId, string actorName, CancellationToken token)
Parameters
TypeNameDescription
ProcessInstanceprocessInstance
stringidentityId
stringactorName
CancellationTokentoken
Returns
TypeDescription
Task<bool>

GetAvailableCommandsAsync(ProcessInstance, IEnumerable<string>, string, string, CultureInfo, bool, CancellationToken)

Return the list of commands which is available from current activity for specified user (async version)

Declaration
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)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
IEnumerable<string>identityIdsList of User ids for which formed initial commands list
stringcommandNameFilterSelects only the specified command if not null
stringmainIdentityIdUser id for priority check of rules
CultureInfocultureCulture to localize command and command parameter names
boolconditionCheckIf true then commands with failed condition checks will be excluded
CancellationTokentokenCancellation token
Returns
TypeDescription
Task<IEnumerable<WorkflowCommand>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetAvailableCommandsAsync(ProcessInstance, string)

Return the list of commands which is available from current activity for specified user (async version)

Declaration
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsAsync(ProcessInstance processInstance, string identityId)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
stringidentityIdUser id for whom formed initial commands list
Returns
TypeDescription
Task<IEnumerable<WorkflowCommand>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetAvailableCommandsAsync(Guid, IEnumerable<string>, string, string, CultureInfo, bool, CancellationToken)

Return the list of commands which is available from current activity for specified user (async version)

Declaration
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)
Parameters
TypeNameDescription
GuidprocessIdProcess id
IEnumerable<string>identityIdsList of User ids for which formed initial commands list
stringcommandNameFilterSelects only the specified command if not null
stringmainIdentityIdUser id for priority check of rules
CultureInfocultureCulture to localize command and command parameter names
boolconditionCheckIf true then commands with failed condition checks will be excluded
CancellationTokentokenCancellation token
Returns
TypeDescription
Task<IEnumerable<WorkflowCommand>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetAvailableCommandsAsync(Guid, string)

Return the list of commands which is available from current activity for specified user (async version)

Declaration
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsAsync(Guid processId, string identityId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringidentityIdUser id for whom formed initial commands list
Returns
TypeDescription
Task<IEnumerable<WorkflowCommand>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetAvailableCommandsAsync(Guid, string, CultureInfo)

Return the list of commands which is available from current activity for specified user (async version)

Declaration
public Task<IEnumerable<WorkflowCommand>> GetAvailableCommandsAsync(Guid processId, string identityId, CultureInfo culture)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringidentityIdUser id for whom formed initial commands list
CultureInfocultureCulture to localize command and command parameter names
Returns
TypeDescription
Task<IEnumerable<WorkflowCommand>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

ExecuteCommandAsync(WorkflowCommand, string, string, CancellationToken, bool)

Execute specified command for specified users (async version)

Declaration
public Task<CommandExecutionResult> ExecuteCommandAsync(WorkflowCommand command, string identityId, string impersonatedIdentityId, CancellationToken token = default, bool checkRestrictions = false)
Parameters
TypeNameDescription
WorkflowCommandcommandCommand to execute
stringidentityIdThe user id which execute command
stringimpersonatedIdentityIdThe user id for whom executes command (impersonation)
CancellationTokentokenCancellation token
boolcheckRestrictionsIf true then actor restriction check will be performed for every transition
Returns
TypeDescription
Task<CommandExecutionResult>Result of the execution

ExecuteCommandWithRestrictionCheckAsync(WorkflowCommand, string, string, CancellationToken)

Execute specified command for specified users (async version) with actor restrictions check

Declaration
public Task<CommandExecutionResult> ExecuteCommandWithRestrictionCheckAsync(WorkflowCommand command, string identityId, string impersonatedIdentityId, CancellationToken token = default)
Parameters
TypeNameDescription
WorkflowCommandcommandCommand to execute
stringidentityIdThe user id which execute command
stringimpersonatedIdentityIdThe user id for whom executes command (impersonation)
CancellationTokentokenCancellation token
Returns
TypeDescription
Task<CommandExecutionResult>Result of the execution

ExecuteCommandAsync(Guid, string, string, WorkflowCommand)

Execute specified command for specified users (async version)

Declaration
[Obsolete("Since version 1.5 argument processId not used to determine the process, the process is determined by the command.ProcessId property.\r\nPlease use the following method: public void ExecuteCommandAsync(WorkflowCommand command, string identityId, string impersonatedIdentityId)")]
public Task<CommandExecutionResult> ExecuteCommandAsync(Guid processId, string identityId, string impersonatedIdentityId, WorkflowCommand command)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringidentityIdThe user id which execute command
stringimpersonatedIdentityIdThe user id for whom executes command (impersonation)
WorkflowCommandcommandCommand to execute
Returns
TypeDescription
Task<CommandExecutionResult>Result of the execution

GetInitialCommandsAsync(string, string)

Return the list of commands which is available from initial activity for specified user (async version)

Declaration
public Task<IEnumerable<WorkflowCommand>> GetInitialCommandsAsync(string schemeCode, string identityId)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
stringidentityIdUser id for whom formed initial commands list
Returns
TypeDescription
Task<IEnumerable<WorkflowCommand>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetInitialCommandsAsync(string, string, CultureInfo)

Return the list of commands which is available from initial activity for specified user (async version)

Declaration
public Task<IEnumerable<WorkflowCommand>> GetInitialCommandsAsync(string schemeCode, string identityId, CultureInfo culture)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
stringidentityIdUser id for whom formed initial commands list
CultureInfocultureCulture to localize command and command parameter names
Returns
TypeDescription
Task<IEnumerable<WorkflowCommand>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetInitialCommandsAsync(string, IEnumerable<string>, IDictionary<string, object>, string, CultureInfo)

Return the list of commands which is available from initial activity for specified users (async version)

Declaration
public Task<IEnumerable<WorkflowCommand>> GetInitialCommandsAsync(string schemeCode, IEnumerable<string> identityIds, IDictionary<string, object> processParameters = null, string commandNameFilter = null, CultureInfo culture = null)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
IEnumerable<string>identityIdsList of User ids for which formed initial commands list
IDictionary<string, object>processParametersParameters for creating scheme of process
stringcommandNameFilterSelects only the specified command if not null
CultureInfocultureCulture to localize command and command parameter names
Returns
TypeDescription
Task<IEnumerable<WorkflowCommand>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

CreateInstanceAsync(string, Guid, CancellationToken)

Create instance of process (async version)

Declaration
public Task CreateInstanceAsync(string schemeCode, Guid processId, CancellationToken token = default)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
GuidprocessIdProcess id
CancellationTokentokenCancellation token
Returns
TypeDescription
Task

CreateInstanceAsync(string, Guid, string, string, CancellationToken)

Create instance of process (async version)

Declaration
public Task CreateInstanceAsync(string schemeCode, Guid processId, string identityId, string impersonatedIdentityId, CancellationToken token = default)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
GuidprocessIdProcess id
stringidentityIdThe user id which execute initial command if command is available
stringimpersonatedIdentityIdThe user id for whom executes initial command if command is available
CancellationTokentokenCancellation token
Returns
TypeDescription
Task

CreateInstanceAsync(string, Guid, IDictionary<string, object>, CancellationToken)

Create instance of process (async version)

Declaration
public Task CreateInstanceAsync(string schemeCode, Guid processId, IDictionary<string, object> schemeCreationParameters, CancellationToken token = default)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
GuidprocessIdProcess id
IDictionary<string, object>schemeCreationParametersThe parameters for creating scheme of process
CancellationTokentokenCancellation token
Returns
TypeDescription
Task

CreateInstanceAsync(string, Guid, string, string, IDictionary<string, object>, CancellationToken)

Create instance of process (async version)

Declaration
public Task CreateInstanceAsync(string schemeCode, Guid processId, string identityId, string impersonatedIdentityId, IDictionary<string, object> schemeCreationParameters, CancellationToken token = default)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
GuidprocessIdProcess id
stringidentityIdThe user id which execute initial command if command is available
stringimpersonatedIdentityIdThe user id for whom executes initial command if command is available
IDictionary<string, object>schemeCreationParametersThe parameters for creating scheme of process
CancellationTokentokenCancellation token
Returns
TypeDescription
Task

CreateInstanceAsync(CreateInstanceParams, CancellationToken)

Create instance of the process (async version)

Declaration
public Task CreateInstanceAsync(CreateInstanceParams createInstanceParams, CancellationToken token = default)
Parameters
TypeNameDescription
CreateInstanceParamscreateInstanceParamsParameters for creation of an instance of a process
CancellationTokentokenCancellation token
Returns
TypeDescription
Task

DeleteInstanceAsync(Guid)

Delete instance of the process and all child subprocesses. (async version)

Declaration
public Task DeleteInstanceAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
Task

IsProcessExistsAsync(Guid)

Check existence of the specified process

Declaration
public Task<bool> IsProcessExistsAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
Task<bool>True if process with specified identifier is exists

DeleteInstanceAsync(ProcessInstance)

Delete instance of the process and all child subprocesses. (Async version)

Declaration
public Task DeleteInstanceAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance to delete
Returns
TypeDescription
Task

GetProcessInstancesTreeAsync(Guid, CancellationToken)

Returns process instance tree (root process and subprocesses) (Async version)

Declaration
public Task<ProcessInstancesTree> GetProcessInstancesTreeAsync(Guid rootProcessId, CancellationToken cancellationToken = default)
Parameters
TypeNameDescription
GuidrootProcessIdRoot process id
CancellationTokencancellationTokenCancellation token
Returns
TypeDescription
Task<ProcessInstancesTree>ProcessInstancesTree object

GetProcessInstancesTreeAsync(ProcessInstance, CancellationToken)

Returns process instance tree (root process and subprocesses) (Async version)

Declaration
public Task<ProcessInstancesTree> GetProcessInstancesTreeAsync(ProcessInstance processInstance, CancellationToken cancellationToken = default)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcessInstance for which tree is builds
CancellationTokencancellationTokenCancellation token
Returns
TypeDescription
Task<ProcessInstancesTree>ProcessInstancesTree object

GetProcessInstanceAndFillProcessParametersAsync(Guid)

Get process instance with all parameters for specified process id (async version)

Declaration
public Task<ProcessInstance> GetProcessInstanceAndFillProcessParametersAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
Task<ProcessInstance><xref href="OptimaJet.Workflow.Core.Model.ProcessInstance" data-throw-if-not-resolved="false"></xref> object

GetProcessHistoryAsync(Guid, Paging)

Returns the history of process (async version)

Declaration
public Task<List<ProcessHistoryItem>> GetProcessHistoryAsync(Guid processId, Paging paging = null)
Parameters
TypeNameDescription
GuidprocessIdId of the process
Pagingpaging
Returns
TypeDescription
Task<List<ProcessHistoryItem>>

GetProcessHistoryCountAsync(Guid)

Returns count of process history (async version)

Declaration
public Task<int> GetProcessHistoryCountAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdId of the process
Returns
TypeDescription
Task<int>

ChangeProcessLogEnabledAsync(Guid)

Change log enabled for process and all subprocesses. Returns new value of log enabled.

Declaration
public Task<bool> ChangeProcessLogEnabledAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdId of the process.
Returns
TypeDescription
Task<bool>The new value of log enabled.

GetLocalizedStateName(Guid, string)

Get localized state name for specified process in current culture

Declaration
public string GetLocalizedStateName(Guid processId, string stateName)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringstateNameState name to localize
Returns
TypeDescription
stringLocalized state name

GetLocalizedStateNameAsync(Guid, string)

Get localized state name for specified process in current culture

Declaration
public Task<string> GetLocalizedStateNameAsync(Guid processId, string stateName)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringstateNameState name to localize
Returns
TypeDescription
Task<string>Localized state name

GetLocalizedStateNameBySchemeId(Guid, string)

Get localized state name for specified scheme in current culture

Declaration
public string GetLocalizedStateNameBySchemeId(Guid schemeId, string stateName)
Parameters
TypeNameDescription
GuidschemeIdId of the scheme
stringstateNameState name to localize
Returns
TypeDescription
stringLocalized state name

GetLocalizedStateNameBySchemeIdAsync(Guid, string)

Get localized state name for specified scheme in current culture

Declaration
public Task<string> GetLocalizedStateNameBySchemeIdAsync(Guid schemeId, string stateName)
Parameters
TypeNameDescription
GuidschemeIdId of the scheme
stringstateNameState name to localize
Returns
TypeDescription
Task<string>Localized state name

GetLocalizedStateNameBySchemeCode(string, string, IDictionary<string, object>)

Get localized state name for specified scheme in current culture

Declaration
public string GetLocalizedStateNameBySchemeCode(string schemeCode, string stateName, IDictionary<string, object> parameters = null)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
stringstateNameState name to localize
IDictionary<string, object>parametersThe parameters for creating scheme of process
Returns
TypeDescription
stringLocalized state name

GetLocalizedStateNameBySchemeCodeAsync(string, string, IDictionary<string, object>)

Get localized state name for specified scheme in current culture

Declaration
public Task<string> GetLocalizedStateNameBySchemeCodeAsync(string schemeCode, string stateName, IDictionary<string, object> parameters = null)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
stringstateNameState name to localize
IDictionary<string, object>parametersThe parameters for creating scheme of process
Returns
TypeDescription
Task<string>Localized state name

GetLocalizedCommandName(Guid, string)

Get localized command name for specified process in current culture

Declaration
public string GetLocalizedCommandName(Guid processId, string commandName)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringcommandNameCommand name to localize
Returns
TypeDescription
stringLocalized command name

GetLocalizedCommandNameAsync(Guid, string)

Get localized command name for specified process in current culture

Declaration
public Task<string> GetLocalizedCommandNameAsync(Guid processId, string commandName)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringcommandNameCommand name to localize
Returns
TypeDescription
Task<string>Localized command name

GetLocalizedCommandNameBySchemeId(Guid, string)

Get localized command name for specified scheme in current culture

Declaration
public string GetLocalizedCommandNameBySchemeId(Guid schemeId, string commandName)
Parameters
TypeNameDescription
GuidschemeIdId of the scheme
stringcommandNameCommand name to localize
Returns
TypeDescription
stringLocalized command name

GetLocalizedCommandNameBySchemeIdAsync(Guid, string)

Get localized command name for specified scheme in current culture

Declaration
public Task<string> GetLocalizedCommandNameBySchemeIdAsync(Guid schemeId, string commandName)
Parameters
TypeNameDescription
GuidschemeIdId of the scheme
stringcommandNameCommand name to localize
Returns
TypeDescription
Task<string>Localized command name

LogInfo(string, Dictionary<string, string>)

Writes a message to the log with Info level

Declaration
public void LogInfo(string message, Dictionary<string, string> parameters)
Parameters
TypeNameDescription
stringmessagemessage to write
Dictionary<string, string>parametersdictionary of properties to serialize within the log entry

LogInfoIfLoggerExists(string, Dictionary<string, string>)

Writes a message to the log with Info level if WorkflowRuntime.Logger is defined

Declaration
public void LogInfoIfLoggerExists(string message, Dictionary<string, string> parameters)
Parameters
TypeNameDescription
stringmessagemessage to write
Dictionary<string, string>parametersdictionary of properties to serialize within the log entry

LogDebug(string, Dictionary<string, string>)

Writes a message to the log with Debug level

Declaration
public void LogDebug(string message, Dictionary<string, string> parameters)
Parameters
TypeNameDescription
stringmessagemessage to write
Dictionary<string, string>parametersdictionary of properties to serialize within the log entry

LogDebugIfLoggerExists(string, Dictionary<string, string>)

Writes a message to the log with Debug level if WorkflowRuntime.Logger is defined

Declaration
public void LogDebugIfLoggerExists(string message, Dictionary<string, string> parameters)
Parameters
TypeNameDescription
stringmessagemessage to write
Dictionary<string, string>parametersdictionary of properties to serialize within the log entry

LogError(string, Dictionary<string, string>)

Writes a message to the log with Error level

Declaration
public void LogError(string message, Dictionary<string, string> parameters)
Parameters
TypeNameDescription
stringmessagemessage to write
Dictionary<string, string>parametersdictionary of properties to serialize within the log entry

LogErrorIfLoggerExists(string, Dictionary<string, string>)

Writes a message to the log with Error level if WorkflowRuntime.Logger is defined

Declaration
public void LogErrorIfLoggerExists(string message, Dictionary<string, string> parameters)
Parameters
TypeNameDescription
stringmessagemessage to write
Dictionary<string, string>parametersdictionary of properties to serialize within the log entry

LogExceptionIfLoggerExists(Exception, string, Dictionary<string, string>)

Writes a message and exception properties to the log with Error level if WorkflowRuntime.Logger is defined.

Declaration
public void LogExceptionIfLoggerExists(Exception exception, string message, Dictionary<string, string> parameters)
Parameters
TypeNameDescription
ExceptionexceptionException to write
stringmessageMessage to write
Dictionary<string, string>parametersDictionary of properties to serialize within the log entry

PreExecuteFromInitialActivityAsync(Guid, bool, CancellationToken)

Pre-execution from initial activity of the process (async version)

Declaration
public Task<List<ActivityDto>> PreExecuteFromInitialActivityAsync(Guid processId, bool ignoreCurrentStateCheck = false, CancellationToken token = default)
Parameters
TypeNameDescription
GuidprocessIdProcess id
boolignoreCurrentStateCheckIf false and Current State Name and State Name of Current Activity is different (in case of scheme upgrade) do not run pre-execution
CancellationTokentokenCancellation token
Returns
TypeDescription
Task<List<ActivityDto>>List of activities which will presumably be executed

PreExecuteFromCurrentActivityAsync(Guid, bool, CancellationToken)

Pre-execution from current activity of the process (async version)

Declaration
public Task<List<ActivityDto>> PreExecuteFromCurrentActivityAsync(Guid processId, bool ignoreCurrentStateCheck = false, CancellationToken token = default)
Parameters
TypeNameDescription
GuidprocessIdProcess id
boolignoreCurrentStateCheckIf false and Current State Name and State Name of Current Activity is different (in case of scheme upgrade) do not run pre-execution
CancellationTokentokenCancellation token
Returns
TypeDescription
Task<List<ActivityDto>>List of activities which will presumably be executed

PreExecuteAsync(Guid, string, bool, CancellationToken)

Pre-execution from specified activity of the process (async version)

Declaration
public Task<List<ActivityDto>> PreExecuteAsync(Guid processId, string fromActivityName, bool ignoreCurrentStateCheck = false, CancellationToken token = default)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringfromActivityNameActivity name which begins pre-execution
boolignoreCurrentStateCheckIf false and Current State Name and State Name of Current Activity is different (in case of scheme upgrade) do not run pre-execution
CancellationTokentokenCancellation token
Returns
TypeDescription
Task<List<ActivityDto>>List of activities which will presumably be executed

GetSchemeCodesAsync(List<string>)

Returns the list of scheme codes into which the scheme with the given tags. If tags are null returns all scheme codes.

Declaration
public Task<List<string>> GetSchemeCodesAsync(List<string> tags = null)
Parameters
TypeNameDescription
List<string>tags
Returns
TypeDescription
Task<List<string>>

SetSchemeIsObsoleteAsync(string, Dictionary<string, object>)

Set flag IsObsolete for all schemas of process with specific code and parameters (async version)

Declaration
public Task SetSchemeIsObsoleteAsync(string schemeCode, Dictionary<string, object> parameters)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
Dictionary<string, object>parametersThe parameters for creating scheme of process
Returns
TypeDescription
Task

SetSchemeIsObsoleteAsync(string)

Set flag IsObsolete for all schemas of process with specific code (async version)

Declaration
public Task SetSchemeIsObsoleteAsync(string schemeCode)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
Returns
TypeDescription
Task

UpdateSchemeIfObsoleteAsync(Guid)

Updating scheme of specific process

Declaration
public Task UpdateSchemeIfObsoleteAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
Task

UpdateSchemeIfObsoleteAsync(Guid, IDictionary<string, object>, bool)

Updating scheme of specific process (async version)

Declaration
public Task UpdateSchemeIfObsoleteAsync(Guid processId, IDictionary<string, object> parameters, bool ignoreAutoSchemeUpdate = false)
Parameters
TypeNameDescription
GuidprocessIdProcess id
IDictionary<string, object>parametersParameters for creating scheme of process
boolignoreAutoSchemeUpdateIf true the attribute of Activity - IsAutoScheme update will be ignored.
Returns
TypeDescription
Task

GetProcessSchemeAsync(Guid)

Get procees definition (parsed scheme) for specified process (async version)

Declaration
public Task<ProcessDefinition> GetProcessSchemeAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
Task<ProcessDefinition><xref href="OptimaJet.Workflow.Core.Model.ProcessDefinition" data-throw-if-not-resolved="false"></xref> object

GetAvailableStateToSetAsync(Guid)

Get the list of all states which available for set of specified process localized in current culture (async version)

Declaration
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
Task<IEnumerable<WorkflowState>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> objects

GetAvailableStateToSetAsync(Guid, CultureInfo)

Get the list of all states which available for set of specified process localized in specified culture (async version)

Declaration
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(Guid processId, CultureInfo culture)
Parameters
TypeNameDescription
GuidprocessIdProcess id
CultureInfocultureCulture to localize state names
Returns
TypeDescription
Task<IEnumerable<WorkflowState>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> objects

GetAvailableStateToSetAsync(ProcessInstance)

Get the list of all states which available for set of specified process localized in current culture (async version)

Declaration
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
Returns
TypeDescription
Task<IEnumerable<WorkflowState>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> objects

GetAvailableStateToSetAsync(ProcessInstance, CultureInfo)

Get the list of all states which available for set of specified process localized in specified culture (async version)

Declaration
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(ProcessInstance processInstance, CultureInfo culture)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
CultureInfocultureCulture to localize state names
Returns
TypeDescription
Task<IEnumerable<WorkflowState>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> objects

GetAvailableStateToSetAsync(string, IDictionary<string, object>)

Get the list of all states which available for set of specified scheme in current culture (async version)

Declaration
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(string schemeCode, IDictionary<string, object> parameters = null)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
IDictionary<string, object>parametersThe parameters for creating scheme of process
Returns
TypeDescription
Task<IEnumerable<WorkflowState>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> objects

GetAvailableStateToSetAsync(string, CultureInfo, IDictionary<string, object>)

Get the list of all states which available for set of specified scheme in specified culture (async version)

Declaration
public Task<IEnumerable<WorkflowState>> GetAvailableStateToSetAsync(string schemeCode, CultureInfo culture, IDictionary<string, object> parameters = null)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
CultureInfocultureCulture to localize state names
IDictionary<string, object>parametersThe parameters for creating scheme of process
Returns
TypeDescription
Task<IEnumerable<WorkflowState>>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> objects

SetStateAsync(Guid, string, string, string, IDictionary<string, object>, bool)

Set specified state for specified process (async version)

Declaration
[Obsolete("Use SetStateAsync(SetStateParams setStateParams) method instead of this")]
public Task SetStateAsync(Guid processId, string identityId, string impersonatedIdentityId, string stateName, IDictionary<string, object> parameters = null, bool preventExecution = false)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringidentityIdThe user id which set the state
stringimpersonatedIdentityIdThe user id for whom sets the state (impersonation)
stringstateNameState name to set
IDictionary<string, object>parametersDictionary of ProcessInstance parameters which transferred to executed actions
boolpreventExecutionActions due to transition process do not executed if true
Returns
TypeDescription
Task

SetStateAsync(SetStateParams)

Set specified state for specified process (async version)

Declaration
public Task SetStateAsync(SetStateParams setStateParams)
Parameters
TypeNameDescription
SetStateParamssetStateParamsParameters of setting state<xref href="OptimaJet.Workflow.Core.Runtime.SetStateParams" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
Task

SetActivityWithoutExecutionAsync(ActivityDefinition, ProcessInstance, bool)

Set specified activity as current without execution of the implementation of the activity (Async version)

Declaration
public Task SetActivityWithoutExecutionAsync(ActivityDefinition activityToSet, ProcessInstance processInstance, bool doNotSetRunningStatus = false)
Parameters
TypeNameDescription
ActivityDefinitionactivityToSetActivity to set
ProcessInstanceprocessInstanceProcess instance for set activity as current
booldoNotSetRunningStatusThe status of the process - <xref href="OptimaJet.Workflow.Core.Persistence.ProcessStatus.Running" data-throw-if-not-resolved="false"></xref> will not be set if true
Returns
TypeDescription
Task

SetActivityWithExecutionAsync(string, string, IDictionary<string, object>, ActivityDefinition, ProcessInstance, bool, CancellationToken)

Set specified activity as current and executing the implementation of the activity (Async version)

Declaration
public Task SetActivityWithExecutionAsync(string identityId, string impersonatedIdentityId, IDictionary<string, object> parameters, ActivityDefinition activityToSet, ProcessInstance processInstance, bool doNotSetRunningStatus = false, CancellationToken token = default)
Parameters
TypeNameDescription
stringidentityIdThe user id which set the activity
stringimpersonatedIdentityIdThe user id for whom sets the activity (impersonation)
IDictionary<string, object>parametersDictionary of ProcessInstance parameters which transferred to executed actions
ActivityDefinitionactivityToSetActivity to set
ProcessInstanceprocessInstanceProcess instance for set activity as current
booldoNotSetRunningStatusThe status of the process - <xref href="OptimaJet.Workflow.Core.Persistence.ProcessStatus.Running" data-throw-if-not-resolved="false"></xref> will not be set if true
CancellationTokentokenCancellation token
Returns
TypeDescription
Task

ResumeAsync(Guid, CancellationToken)

Resumes the process from the current activity. In this case, the activity itself is not executed, and the process goes on if it can.

Declaration
public Task<ResumeResult> ResumeAsync(Guid processId, CancellationToken token = default)
Parameters
TypeNameDescription
GuidprocessId
CancellationTokentoken
Returns
TypeDescription
Task<ResumeResult>

ResumeAsync(ResumeParams, CancellationToken)

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.

Declaration
public Task<ResumeResult> ResumeAsync(ResumeParams resumeParams, CancellationToken token = default)
Parameters
TypeNameDescription
ResumeParamsresumeParams
CancellationTokentoken
Returns
TypeDescription
Task<ResumeResult>

GetCurrentStateNameAsync(Guid)

Return the current state name of specified process (async version)

Declaration
public Task<string> GetCurrentStateNameAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
Task<string>Name of current state

GetCurrentActivityNameAsync(Guid)

Return the current activity name of specified process (async version)

Declaration
public Task<string> GetCurrentActivityNameAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
Task<string>Current activity name

GetCurrentStateAsync(Guid, CultureInfo)

Return the current state of specified process (async version)

Declaration
public Task<WorkflowState> GetCurrentStateAsync(Guid processId, CultureInfo culture = null)
Parameters
TypeNameDescription
GuidprocessIdProcess id
CultureInfocultureCulture to localize state name
Returns
TypeDescription
Task<WorkflowState><xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> object

GetInitialStateAsync(string, IDictionary<string, object>, CultureInfo)

Return the initial state for process scheme (async version)

Declaration
public Task<WorkflowState> GetInitialStateAsync(string schemeCode, IDictionary<string, object> processParameters = null, CultureInfo culture = null)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
IDictionary<string, object>processParametersParameters for creating scheme of process
CultureInfocultureCulture to localize state name
Returns
TypeDescription
Task<WorkflowState><xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> object

IsProcessExists(Guid)

Check existence of the specified process

Declaration
public bool IsProcessExists(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
boolTrue if process with specified identifier is exists

CreateInstance(string, Guid)

Create instance of process.

Declaration
public void CreateInstance(string schemeCode, Guid processId)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
GuidprocessIdProcess id

CreateInstance(string, Guid, string, string)

Create instance of process.

Declaration
public void CreateInstance(string schemeCode, Guid processId, string identityId, string impersonatedIdentityId)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
GuidprocessIdProcess id
stringidentityIdThe user id which execute initial command if command is available
stringimpersonatedIdentityIdThe user id for whom executes initial command if command is available

CreateInstance(string, Guid, IDictionary<string, object>)

Create instance of process.

Declaration
public void CreateInstance(string schemeCode, Guid processId, IDictionary<string, object> schemeCreationParameters)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
GuidprocessIdProcess id
IDictionary<string, object>schemeCreationParametersParameters for creating the scheme of the process (defining parameters)

CreateInstance(string, Guid, string, string, IDictionary<string, object>)

Create instance of the process.

Declaration
public void CreateInstance(string schemeCode, Guid processId, string identityId, string impersonatedIdentityId, IDictionary<string, object> schemeCreationParameters)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
GuidprocessIdProcess id
stringidentityIdThe user id which execute initial command if command is available
stringimpersonatedIdentityIdThe user id for whom executes initial command if command is available
IDictionary<string, object>schemeCreationParametersThe parameters for creating scheme of process (defining parameters)

CreateInstance(CreateInstanceParams)

Create instance of the process.

Declaration
public void CreateInstance(CreateInstanceParams createInstanceParams)
Parameters
TypeNameDescription
CreateInstanceParamscreateInstanceParamsParameters for creation of an instance of a process

DeleteInstance(Guid)

Delete instance of the process and all child subprocesses.

Declaration
public void DeleteInstance(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id

DeleteInstance(ProcessInstance)

Delete instance of the process and all child subprocesses.

Declaration
public void DeleteInstance(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceInstance to delete

GetProcessInstancesTree(Guid)

Returns process instance tree (root process and subprocesses)

Declaration
public ProcessInstancesTree GetProcessInstancesTree(Guid rootProcessId)
Parameters
TypeNameDescription
GuidrootProcessIdRoot process id
Returns
TypeDescription
ProcessInstancesTreeProcessInstancesTree object

GetProcessInstancesTree(ProcessInstance)

Returns process instance tree (root process and subprocesses)

Declaration
public ProcessInstancesTree GetProcessInstancesTree(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcessInstance for which tree is builds
Returns
TypeDescription
ProcessInstancesTreeProcessInstancesTree object

CheckAllSubprocessesCompleted(ProcessInstance)

Checks that all subprocesses was completed

Declaration
public bool CheckAllSubprocessesCompleted(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcessInstance for check
Returns
TypeDescription
booltrue - if there are no active suprocesses

CheckAllSubprocessesAndParentProcessCompleted(ProcessInstance)

Check that all subprocesses and the parent process reach the same point (completed)

Declaration
public bool CheckAllSubprocessesAndParentProcessCompleted(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstance
Returns
TypeDescription
bool

DeleteAllSubprocesses(ProcessInstance)

Delete all subprocesses for process

Declaration
public int DeleteAllSubprocesses(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstance
Returns
TypeDescription
intCount of deleted subprocesses

SetSchemeIsObsolete(string, Dictionary<string, object>)

Set flag IsObsolete for all schemas of process with specific code and parameters

Declaration
public void SetSchemeIsObsolete(string schemeCode, Dictionary<string, object> parameters)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
Dictionary<string, object>parametersThe parameters for creating scheme of process

SetSchemeIsObsolete(string)

Set flag IsObsolete for all schemas of process with specific code

Declaration
public void SetSchemeIsObsolete(string schemeCode)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme

SetTimerValue(Guid, string, DateTime)

Sets new value of named timer. Use this method outside of your process.

Declaration
public void SetTimerValue(Guid processId, string timerName, DateTime newValue)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringtimerNameTimer name in Scheme
DateTimenewValueNew value of the timer

SetTimerValue(ProcessInstance, string, DateTime)

Sets new value of named timer. Use this method inside of your process (in actions).

Declaration
public void SetTimerValue(ProcessInstance processInstance, string timerName, DateTime newValue)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
stringtimerNameTimer name in Scheme
DateTimenewValueNew value of the timer

ResetTimerValue(Guid, string)

Resets value of named timer. Use this method outside of your process.

Declaration
public void ResetTimerValue(Guid processId, string timerName)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringtimerNameTimer name in Scheme

ResetTimerValue(ProcessInstance, string)

Resets value of named timer. Use this method inside of your process (in actions).

Declaration
public void ResetTimerValue(ProcessInstance processInstance, string timerName)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
stringtimerNameTimer name in Scheme

UpdateSchemeIfObsolete(Guid, bool)

Updating scheme of specific process

Declaration
public void UpdateSchemeIfObsolete(Guid processId, bool ignoreAutoSchemeUpdate = false)
Parameters
TypeNameDescription
GuidprocessIdProcess id
boolignoreAutoSchemeUpdateIf true the attribute of Activity - IsAutoScheme update will be ignored.

UpdateSchemeIfObsolete(Guid, IDictionary<string, object>, bool)

Updating scheme of specific process

Declaration
public void UpdateSchemeIfObsolete(Guid processId, IDictionary<string, object> parameters, bool ignoreAutoSchemeUpdate = false)
Parameters
TypeNameDescription
GuidprocessIdThe process id
IDictionary<string, object>parametersParameters for creating scheme of process
boolignoreAutoSchemeUpdateIf true the attribute of Activity - IsAutoScheme update will be ignored.

PreExecuteFromInitialActivity(Guid, bool)

Pre-execution from initial activity of the process

Declaration
public List<ActivityDto> PreExecuteFromInitialActivity(Guid processId, bool ignoreCurrentStateCheck = false)
Parameters
TypeNameDescription
GuidprocessIdThe process id
boolignoreCurrentStateCheckIf false and Current State Name and State Name of Current Activity is different (in case of scheme upgrade) do not run pre-execution
Returns
TypeDescription
List<ActivityDto>List of activities which will presumably be executed

PreExecuteFromCurrentActivity(Guid, bool)

Pre-execution from current activity of the process

Declaration
public List<ActivityDto> PreExecuteFromCurrentActivity(Guid processId, bool ignoreCurrentStateCheck = false)
Parameters
TypeNameDescription
GuidprocessIdThe process id
boolignoreCurrentStateCheckIf false and Current State Name and State Name of Current Activity is different (in case of scheme upgrade) do not run pre-execution
Returns
TypeDescription
List<ActivityDto>List of activities which will presumably be executed

PreExecute(Guid, string, bool)

Pre-execution from specified activity of the process

Declaration
public List<ActivityDto> PreExecute(Guid processId, string fromActivityName, bool ignoreCurrentStateCheck = false)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringfromActivityNameActivity name which begins pre-execution
boolignoreCurrentStateCheckIf false and Current State Name and State Name of Current Activity is different (in case of scheme upgrade) do not run pre-execution
Returns
TypeDescription
List<ActivityDto>List of activities which will presumably be executed

GetInitialCommands(string, string)

Return the list of commands which is available from initial activity for specified user

Declaration
public IEnumerable<WorkflowCommand> GetInitialCommands(string schemeCode, string identityId)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
stringidentityIdUser id for whom formed initial commands list
Returns
TypeDescription
IEnumerable<WorkflowCommand>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetInitialCommands(string, string, CultureInfo)

Return the list of commands which is available from initial activity for specified user

Declaration
public IEnumerable<WorkflowCommand> GetInitialCommands(string schemeCode, string identityId, CultureInfo culture)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
stringidentityIdUser id for whom formed initial commands list
CultureInfocultureCulture to localize command and command parameter names
Returns
TypeDescription
IEnumerable<WorkflowCommand>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetInitialCommands(string, IEnumerable<string>, IDictionary<string, object>, string, CultureInfo)

Return the list of commands which is available from initial activity for specified users

Declaration
public IEnumerable<WorkflowCommand> GetInitialCommands(string schemeCode, IEnumerable<string> identityIds, IDictionary<string, object> processParameters = null, string commandNameFilter = null, CultureInfo culture = null)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
IEnumerable<string>identityIdsList of User ids for which formed initial commands list
IDictionary<string, object>processParametersParameters for creating scheme of process
stringcommandNameFilterSelects only the specified command if not null
CultureInfocultureCulture to localize command and command parameter names
Returns
TypeDescription
IEnumerable<WorkflowCommand>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetAvailableCommands(Guid, string)

Return the list of commands which is available from current activity for specified user

Declaration
public IEnumerable<WorkflowCommand> GetAvailableCommands(Guid processId, string identityId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringidentityIdUser id for whom formed initial commands list
Returns
TypeDescription
IEnumerable<WorkflowCommand>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetAvailableCommands(Guid, string, CultureInfo)

Return the list of commands which is available from current activity for specified user Async

Declaration
public IEnumerable<WorkflowCommand> GetAvailableCommands(Guid processId, string identityId, CultureInfo culture)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringidentityIdUser id for whom formed initial commands list
CultureInfocultureCulture to localize command and command parameter names
Returns
TypeDescription
IEnumerable<WorkflowCommand>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetAvailableCommands(Guid, IEnumerable<string>, string, string, CultureInfo, bool)

Return the list of commands which is available from current activity for specified user (async version)

Declaration
public IEnumerable<WorkflowCommand> GetAvailableCommands(Guid processId, IEnumerable<string> identityIds, string commandNameFilter = null, string mainIdentityId = null, CultureInfo culture = null, bool conditionCheck = false)
Parameters
TypeNameDescription
GuidprocessIdProcess id
IEnumerable<string>identityIdsList of User ids for which formed initial commands list
stringcommandNameFilterSelects only the specified command if not null
stringmainIdentityIdUser id for priority check of rules
CultureInfocultureCulture to localize command and command parameter names
boolconditionCheckIf true then commands with failed condition checks will be excluded
Returns
TypeDescription
IEnumerable<WorkflowCommand>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetAvailableCommands(ProcessInstance, string)

Return the list of commands which is available from current activity for specified user

Declaration
public IEnumerable<WorkflowCommand> GetAvailableCommands(ProcessInstance processInstance, string identityId)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
stringidentityIdUser id for whom formed initial commands list
Returns
TypeDescription
IEnumerable<WorkflowCommand>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetAvailableCommands(ProcessInstance, string, CultureInfo)

Return the list of commands which is available from current activity for specified user Async

Declaration
public IEnumerable<WorkflowCommand> GetAvailableCommands(ProcessInstance processInstance, string identityId, CultureInfo culture)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
stringidentityIdUser id for whom formed initial commands list
CultureInfocultureCulture to localize command and command parameter names
Returns
TypeDescription
IEnumerable<WorkflowCommand>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetAvailableCommands(ProcessInstance, IEnumerable<string>, string, string, CultureInfo, bool)

Return the list of commands which is available from current activity for specified user (async version)

Declaration
public IEnumerable<WorkflowCommand> GetAvailableCommands(ProcessInstance processInstance, IEnumerable<string> identityIds, string commandNameFilter = null, string mainIdentityId = null, CultureInfo culture = null, bool conditionCheck = false)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
IEnumerable<string>identityIdsList of User ids for which formed initial commands list
stringcommandNameFilterSelects only the specified command if not null
stringmainIdentityIdUser id for priority check of rules
CultureInfocultureCulture to localize command and command parameter names
boolconditionCheckIf true then commands with failed condition checks will be excluded
Returns
TypeDescription
IEnumerable<WorkflowCommand>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetAvailableCommandsWithConditionCheck(Guid, string)

Return the list of commands which is available from current activity for specified user with conditions check

Declaration
public IEnumerable<WorkflowCommand> GetAvailableCommandsWithConditionCheck(Guid processId, string identityId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringidentityIdUser id for whom formed initial commands list
Returns
TypeDescription
IEnumerable<WorkflowCommand>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetAvailableCommandsWithConditionCheck(Guid, string, CultureInfo)

Return the list of commands which is available from current activity for specified user with conditions check

Declaration
public IEnumerable<WorkflowCommand> GetAvailableCommandsWithConditionCheck(Guid processId, string identityId, CultureInfo culture)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringidentityIdUser id for whom formed initial commands list
CultureInfocultureCulture to localize command and command parameter names
Returns
TypeDescription
IEnumerable<WorkflowCommand>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

GetAvailableCommandsWithConditionCheck(Guid, IEnumerable<string>, string, string, CultureInfo)

Return the list of commands which is available from current activity for specified user with conditions check

Declaration
public IEnumerable<WorkflowCommand> GetAvailableCommandsWithConditionCheck(Guid processId, IEnumerable<string> identityIds, string commandNameFilter = null, string mainIdentityId = null, CultureInfo culture = null)
Parameters
TypeNameDescription
GuidprocessIdProcess id
IEnumerable<string>identityIdsList of User ids for which formed initial commands list
stringcommandNameFilterSelects only the specified command if not null
stringmainIdentityIdUser id for priority check of rules
CultureInfocultureCulture to localize command and command parameter names
Returns
TypeDescription
IEnumerable<WorkflowCommand>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowCommand" data-throw-if-not-resolved="false"></xref> commands

ExecuteCommand(WorkflowCommand, string, string)

Execute specified command for specified users

Declaration
public CommandExecutionResult ExecuteCommand(WorkflowCommand command, string identityId, string impersonatedIdentityId)
Parameters
TypeNameDescription
WorkflowCommandcommandCommand to execute
stringidentityIdThe user id which execute command
stringimpersonatedIdentityIdThe user id for whom executes command (impersonation)
Returns
TypeDescription
CommandExecutionResultResult of the execution

ExecuteCommand(Guid, string, string, WorkflowCommand)

Execute specified command for specified users

Declaration
[Obsolete("Since version 1.5 argument processId not used to determine the process, the process is determined by the command.ProcessId property. \r\nPlease use the following method: public void ExecuteCommand(WorkflowCommand command, string identityId, string impersonatedIdentityId)")]
public CommandExecutionResult ExecuteCommand(Guid processId, string identityId, string impersonatedIdentityId, WorkflowCommand command)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringidentityIdThe user id which execute command
stringimpersonatedIdentityIdThe user id for whom executes command (impersonation)
WorkflowCommandcommandCommand to execute
Returns
TypeDescription
CommandExecutionResultResult of the execution

GetInitialState(string, IDictionary<string, object>, CultureInfo)

Return the initial state for process scheme

Declaration
public WorkflowState GetInitialState(string schemeCode, IDictionary<string, object> processParameters = null, CultureInfo culture = null)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
IDictionary<string, object>processParametersParameters for creating scheme of process
CultureInfocultureCulture to localize state name
Returns
TypeDescription
WorkflowState<xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> object

GetCurrentState(Guid, CultureInfo)

Return the current state of specified process

Declaration
public WorkflowState GetCurrentState(Guid processId, CultureInfo culture = null)
Parameters
TypeNameDescription
GuidprocessIdProcess id
CultureInfocultureCulture to localize state name
Returns
TypeDescription
WorkflowState<xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> object

GetCurrentStateName(Guid)

Return the current state name of specified process

Declaration
public string GetCurrentStateName(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
stringName of current state

GetCurrentActivityName(Guid)

Return the current activity name of specified process

Declaration
public string GetCurrentActivityName(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
stringCurrent activity name

GetAvailableStateToSet(Guid)

Get the list of all states which available for set of specified process localized in current culture

Declaration
public IEnumerable<WorkflowState> GetAvailableStateToSet(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
IEnumerable<WorkflowState>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> objects

GetAvailableStateToSet(ProcessInstance, CultureInfo)

Get the list of all states which available for set of specified process localized in specified culture

Declaration
public IEnumerable<WorkflowState> GetAvailableStateToSet(ProcessInstance processInstance, CultureInfo culture)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
CultureInfocultureCulture to localize state names
Returns
TypeDescription
IEnumerable<WorkflowState>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> objects

GetAvailableStateToSet(ProcessInstance)

Get the list of all states which available for set of specified process in current culture

Declaration
public IEnumerable<WorkflowState> GetAvailableStateToSet(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
Returns
TypeDescription
IEnumerable<WorkflowState>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> objects

GetAvailableStateToSet(Guid, CultureInfo)

Get the list of all states which available for set of specified process localized in specified culture

Declaration
public IEnumerable<WorkflowState> GetAvailableStateToSet(Guid processId, CultureInfo culture)
Parameters
TypeNameDescription
GuidprocessIdProcess id
CultureInfocultureCulture to localize state names
Returns
TypeDescription
IEnumerable<WorkflowState>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> objects

GetAvailableStateToSet(string, IDictionary<string, object>)

Get the list of all states which available for set of specified scheme in current culture

Declaration
public IEnumerable<WorkflowState> GetAvailableStateToSet(string schemeCode, IDictionary<string, object> parameters = null)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
IDictionary<string, object>parametersThe parameters for creating scheme of process
Returns
TypeDescription
IEnumerable<WorkflowState>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> objects

GetAvailableStateToSet(string, CultureInfo, IDictionary<string, object>)

Get the list of all states which available for set of specified scheme in specified culture

Declaration
public IEnumerable<WorkflowState> GetAvailableStateToSet(string schemeCode, CultureInfo culture, IDictionary<string, object> parameters = null)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
CultureInfocultureCulture to localize state names
IDictionary<string, object>parametersThe parameters for creating scheme of process
Returns
TypeDescription
IEnumerable<WorkflowState>List of <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowState" data-throw-if-not-resolved="false"></xref> objects

SetState(Guid, string, string, string, IDictionary<string, object>, bool)

Set specified state for specified process

Declaration
[Obsolete("Use SetState(SetStateParams setStateParams) method instead of this")]
public void SetState(Guid processId, string identityId, string impersonatedIdentityId, string stateName, IDictionary<string, object> parameters = null, bool preventExecution = false)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringidentityIdThe user id which set the state
stringimpersonatedIdentityIdThe user id for whom sets the state (impersonation)
stringstateNameState name to set
IDictionary<string, object>parametersDictionary of ProcessInstance parameters which transferred to executed actions
boolpreventExecutionActions due to transition process do not executed if true

SetState(SetStateParams)

Set specified state for specified process (async version)

Declaration
public void SetState(SetStateParams setStateParams)
Parameters
TypeNameDescription
SetStateParamssetStateParamsParameters of setting state<xref href="OptimaJet.Workflow.Core.Runtime.SetStateParams" data-throw-if-not-resolved="false"></xref>

SetActivityWithoutExecution(ActivityDefinition, ProcessInstance, bool)

Set specified activity as current without execution of the implementation of the activity

Declaration
public void SetActivityWithoutExecution(ActivityDefinition activityToSet, ProcessInstance processInstance, bool doNotSetRunningStatus = false)
Parameters
TypeNameDescription
ActivityDefinitionactivityToSetActivity to set
ProcessInstanceprocessInstanceProcess instance for set activity as current
booldoNotSetRunningStatusThe status of the process - <xref href="OptimaJet.Workflow.Core.Persistence.ProcessStatus.Running" data-throw-if-not-resolved="false"></xref> will not be set if true

SetActivityWithExecution(string, string, IDictionary<string, object>, ActivityDefinition, ProcessInstance, bool)

Set specified activity as current and executing the implementation of the activity

Declaration
public void SetActivityWithExecution(string identityId, string impersonatedIdentityId, IDictionary<string, object> parameters, ActivityDefinition activityToSet, ProcessInstance processInstance, bool doNotSetRunningStatus = false)
Parameters
TypeNameDescription
stringidentityIdThe user id which set the activity
stringimpersonatedIdentityIdThe user id for whom sets the activity (impersonation)
IDictionary<string, object>parametersDictionary of ProcessInstance parameters which transferred to executed actions
ActivityDefinitionactivityToSetActivity to set
ProcessInstanceprocessInstanceProcess instance for set activity as current
booldoNotSetRunningStatusThe status of the process - <xref href="OptimaJet.Workflow.Core.Persistence.ProcessStatus.Running" data-throw-if-not-resolved="false"></xref> will not be set if true

GetProcessScheme(Guid)

Get procees definition (parsed scheme) for specified process

Declaration
public ProcessDefinition GetProcessScheme(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
ProcessDefinition<xref href="OptimaJet.Workflow.Core.Model.ProcessDefinition" data-throw-if-not-resolved="false"></xref> object

GetProcessStatus(Guid)

Get status of specified process

Declaration
public ProcessStatus GetProcessStatus(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
ProcessStatus<xref href="OptimaJet.Workflow.Core.Persistence.ProcessStatus" data-throw-if-not-resolved="false"></xref> object

GetProcessInstanceAndFillProcessParameters(Guid)

Get process instance with all parameters for specified process id

Declaration
public ProcessInstance GetProcessInstanceAndFillProcessParameters(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
ProcessInstance<xref href="OptimaJet.Workflow.Core.Model.ProcessInstance" data-throw-if-not-resolved="false"></xref> object

SetPersistentProcessParameter(Guid, string, object)

Set single persistent parameter in the process

Declaration
public void SetPersistentProcessParameter(Guid processId, string parameterName, object parameterValue)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringparameterNameParameter name
objectparameterValue

GetProcessHistory(Guid, Paging)

Returns the history of process

Declaration
public List<ProcessHistoryItem> GetProcessHistory(Guid processId, Paging paging = null)
Parameters
TypeNameDescription
GuidprocessIdId of the process
Pagingpaging
Returns
TypeDescription
List<ProcessHistoryItem>

GetProcessHistoryCount(Guid)

Returns count of process history (async version)

Declaration
public int GetProcessHistoryCount(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdId of the process
Returns
TypeDescription
int

GetProcessTimers(Guid)

Returns list of timers for a process

Declaration
public IEnumerable<ProcessTimer> GetProcessTimers(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdId of the process
Returns
TypeDescription
IEnumerable<ProcessTimer>

CheckIdentity(ProcessInstance, string, string, string)

Declaration
public bool CheckIdentity(ProcessInstance processInstance, string identityId, string ruleName, string parameter)
Parameters
TypeNameDescription
ProcessInstanceprocessInstance
stringidentityId
stringruleName
stringparameter
Returns
TypeDescription
bool

CheckIdentityByActor(ProcessInstance, string, string)

Declaration
public bool CheckIdentityByActor(ProcessInstance processInstance, string identityId, string actorName)
Parameters
TypeNameDescription
ProcessInstanceprocessInstance
stringidentityId
stringactorName
Returns
TypeDescription
bool

Shutdown(int)

Switches off the runtime. Switches off API, waits for API calls to be completed. Switches off all timers. IMPORTANT! Call this method from the SYNCHRONOUS method only.

Declaration
public void Shutdown(int timeout = -1)
Parameters
TypeNameDescription
inttimeoutShutdown timeout

GetSchemeCodes(List<string>)

Returns the list of scheme codes into which the scheme with the given tags. If tags are null returns all scheme codes.

Declaration
public List<string> GetSchemeCodes(List<string> tags = null)
Parameters
TypeNameDescription
List<string>tags
Returns
TypeDescription
List<string>

ExecuteCommandWithRestrictionCheck(WorkflowCommand, string, string)

Execute specified command for specified users with actor restrictions check

Declaration
public CommandExecutionResult ExecuteCommandWithRestrictionCheck(WorkflowCommand command, string identityId, string impersonatedIdentityId)
Parameters
TypeNameDescription
WorkflowCommandcommandCommand to execute
stringidentityIdThe user id which execute command
stringimpersonatedIdentityIdThe user id for whom executes command (impersonation)
Returns
TypeDescription
CommandExecutionResultResult of the execution

Resume(Guid)

Resumes the process from the current activity. In this case, the activity itself is not executed, and the process goes on if it can.

Declaration
public ResumeResult Resume(Guid processId)
Parameters
TypeNameDescription
GuidprocessId
Returns
TypeDescription
ResumeResult

Resume(ResumeParams)

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.

Declaration
public ResumeResult Resume(ResumeParams resumeParams)
Parameters
TypeNameDescription
ResumeParamsresumeParams
Returns
TypeDescription
ResumeResult

Fields

Plugins

All registered plugins

Declaration
public List<IWorkflowPlugin> Plugins
Returns
TypeDescription
List<IWorkflowPlugin>

CustomActivities

All custom activities

Declaration
public List<ActivityBase> CustomActivities
Returns
TypeDescription
List<ActivityBase>

CustomConditions

Declaration
public List<FormBase> CustomConditions
Returns
TypeDescription
List<FormBase>

Events

GlobalCodeActionsCompiled

Raises after global Code Actions compilation

Declaration
public event EventHandler<CodeActionsCompiledEventArgs> GlobalCodeActionsCompiled
Returns
TypeDescription
EventHandler<CodeActionsCompiledEventArgs>

OnNeedDeterminingParameters

Raises when runtime need to obtain parameters for creating the scheme of the process

Declaration
public event EventHandler<NeedDeterminingParametersEventArgs> OnNeedDeterminingParameters
Returns
TypeDescription
EventHandler<NeedDeterminingParametersEventArgs>

OnSchemaWasChanged

Raises when the scheme of the process was changed

Declaration
public event EventHandler<SchemaWasChangedEventArgs> OnSchemaWasChanged
Returns
TypeDescription
EventHandler<SchemaWasChangedEventArgs>

OnWorkflowError

Raises when workflow error occurred

Declaration
public event EventHandler<WorkflowErrorEventArgs> OnWorkflowError
Returns
TypeDescription
EventHandler<WorkflowErrorEventArgs>

OnStartingTransitionNotFound

Raises when runtime can not find starting transition of a subprocess in a new root scheme

Declaration
public event EventHandler<StartingTransitionNotFoundEventArgs> OnStartingTransitionNotFound
Returns
TypeDescription
EventHandler<StartingTransitionNotFoundEventArgs>

ProcessActivityChanged

Raises when current activity of a process was changed

Declaration
[Obsolete("Use OnProcessActivityChanged instead of this.")]
public event EventHandler<ProcessActivityChangedEventArgs> ProcessActivityChanged
Returns
TypeDescription
EventHandler<ProcessActivityChangedEventArgs>

OnProcessActivityChanged

Raises when current activity of a process was changed

Declaration
public event EventHandler<ProcessActivityChangedEventArgs> OnProcessActivityChanged
Returns
TypeDescription
EventHandler<ProcessActivityChangedEventArgs>

BeforeActivityExecution

Raises before execution of choosen activity

Declaration
[Obsolete("Use OnBeforeActivityExecution instead of this.")]
public event EventHandler<BeforeActivityExecutionEventArgs> BeforeActivityExecution
Returns
TypeDescription
EventHandler<BeforeActivityExecutionEventArgs>

OnBeforeActivityExecution

Raises before execution of choosen activity

Declaration
public event EventHandler<BeforeActivityExecutionEventArgs> OnBeforeActivityExecution
Returns
TypeDescription
EventHandler<BeforeActivityExecutionEventArgs>

NeedTimerValue

Raises when the timer value must be obtained

Declaration
[Obsolete("Use OnNeedTimerValue instead of this.")]
public event EventHandler<NeedTimerValueEventArgs> NeedTimerValue
Returns
TypeDescription
EventHandler<NeedTimerValueEventArgs>

OnNeedTimerValue

Raises when the timer value must be obtained

Declaration
public event EventHandler<NeedTimerValueEventArgs> OnNeedTimerValue
Returns
TypeDescription
EventHandler<NeedTimerValueEventArgs>

ProcessStatusChanged

Raises when the status of the procees ProcessStatus was changed

Declaration
[Obsolete("Use OnProcessStatusChanged instead of this.")]
public event EventHandler<ProcessStatusChangedEventArgs> ProcessStatusChanged
Returns
TypeDescription
EventHandler<ProcessStatusChangedEventArgs>

OnProcessStatusChanged

Raises when the status of the procees ProcessStatus was changed

Declaration
public event EventHandler<ProcessStatusChangedEventArgs> OnProcessStatusChanged
Returns
TypeDescription
EventHandler<ProcessStatusChangedEventArgs>

OnRuntimeStart

Raises just after the runtime was started

Declaration
public event EventHandler<RuntimeStartEventArgs> OnRuntimeStart
Returns
TypeDescription
EventHandler<RuntimeStartEventArgs>

OnRuntimeShutdown

Raises just before the runtime switched off its API

Declaration
public event EventHandler<EventArgs> OnRuntimeShutdown
Returns
TypeDescription
EventHandler<EventArgs>

OnNeedDeterminingParametersAsync

Raises when runtime need to obtain parameters for creating the scheme of the process

Declaration
public event AsyncEventHandler<NeedDeterminingParametersEventArgs> OnNeedDeterminingParametersAsync
Returns
TypeDescription
AsyncEventHandler<NeedDeterminingParametersEventArgs>

OnSchemaWasChangedAsync

Raises when the scheme of the process was changed

Declaration
public event AsyncEventHandler<SchemaWasChangedEventArgs> OnSchemaWasChangedAsync
Returns
TypeDescription
AsyncEventHandler<SchemaWasChangedEventArgs>

OnWorkflowErrorAsync

Raises when workflow error occurred

Declaration
public event AsyncEventHandler<WorkflowErrorEventArgs> OnWorkflowErrorAsync
Returns
TypeDescription
AsyncEventHandler<WorkflowErrorEventArgs>

OnStartingTransitionNotFoundAsync

Raises when runtime can not find starting transition of a subprocess in a new root scheme

Declaration
public event AsyncEventHandler<StartingTransitionNotFoundEventArgs> OnStartingTransitionNotFoundAsync
Returns
TypeDescription
AsyncEventHandler<StartingTransitionNotFoundEventArgs>

OnProcessActivityChangedAsync

Raises when current activity of a process was changed

Declaration
public event AsyncEventHandler<ProcessActivityChangedEventArgs> OnProcessActivityChangedAsync
Returns
TypeDescription
AsyncEventHandler<ProcessActivityChangedEventArgs>

OnBeforeActivityExecutionAsync

Raises before execution of choosen activity

Declaration
public event AsyncEventHandler<BeforeActivityExecutionEventArgs> OnBeforeActivityExecutionAsync
Returns
TypeDescription
AsyncEventHandler<BeforeActivityExecutionEventArgs>

OnProcessStatusChangedAsync

Raises when the status of the procees ProcessStatus was changed

Declaration
public event AsyncEventHandler<ProcessStatusChangedEventArgs> OnProcessStatusChangedAsync
Returns
TypeDescription
AsyncEventHandler<ProcessStatusChangedEventArgs>

OnNeedTimerValueAsync

Raises when the timer value must be obtained

Declaration
public event AsyncEventHandler<NeedTimerValueEventArgs> OnNeedTimerValueAsync
Returns
TypeDescription
AsyncEventHandler<NeedTimerValueEventArgs>

OnRuntimeStartAsync

Raises just after the runtime was started

Declaration
public event AsyncEventHandler<RuntimeStartEventArgs> OnRuntimeStartAsync
Returns
TypeDescription
AsyncEventHandler<RuntimeStartEventArgs>

OnRuntimeShutdownAsync

Raises just before the runtime switched off its API

Declaration
public event AsyncEventHandler<EventArgs> OnRuntimeShutdownAsync
Returns
TypeDescription
AsyncEventHandler<EventArgs>

Extension Methods

Stay in the know
Build Workflow Applications Faster
Star us on GitHub