Workflow Engine .NET

Assembly: OptimaJet.Workflow.Core

Interface IBulkApi

OptimaJet.Workflow.Core.Runtime.Bulk.IBulkApi

Provides an API for executing WorkflowRuntime operations in bulk mode.

public interface IBulkApi

Properties

Name
Type
DefaultMaxDegreeOfParallelism #
Int32
Gets or sets the default value used for the maxDegreeOfParallelism argument in Bulk API methods.
DefaultThrowOnError #
Boolean
Gets or sets the default value used for the throwOnError argument in Bulk API methods.

Methods

Task<Dictionary<Guid, BulkTaskResult<Empty>>> CreateInstanceAsync(IEnumerable<CreateInstanceParams> createInstanceParams, EventHandler<BulkTaskFinalizedEventArgs<Guid, Empty>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #

Parameters

Name
Type
Description
createInstanceParams
IEnumerable<CreateInstanceParams>
A collection of CreateInstanceParams values describing the process instances to create.
taskFinalizedHandler
EventHandler<Guid, Empty>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, Empty>
A dictionary of final task states and results. The key is CreateInstanceParams.ProcessId.
Task<Dictionary<Guid, BulkTaskResult<Empty>>> CreateInstanceAsync(IEnumerable<Guid> processIds, string schemaCode, EventHandler<BulkTaskFinalizedEventArgs<Guid, Empty>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #

Parameters

Name
Type
Description
processIds
IEnumerable<Guid>
A collection of process IDs for which instances are created.
schemaCode
String
Schema code used when creating instances.
taskFinalizedHandler
EventHandler<Guid, Empty>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, Empty>
A dictionary of final task states and results. The key is each corresponding item from processIds.
Task<Dictionary<Guid, BulkTaskResult<ProcessInstance>>> GetProcessInstanceAndFillProcessParametersAsync(IEnumerable<Guid> processIds, EventHandler<BulkTaskFinalizedEventArgs<Guid, ProcessInstance>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #

Parameters

Name
Type
Description
processIds
IEnumerable<Guid>
A collection of process IDs for which process instances are obtained and filled.
taskFinalizedHandler
EventHandler<Guid, ProcessInstance>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, ProcessInstance>
A dictionary of final task states and results. The key is the ProcessInstance.ProcessId of each requested process.
Task<Dictionary<Guid, BulkTaskResult<ProcessInstancesTree>>> GetProcessInstancesTreeAsync(IEnumerable<Guid> rootProcessIds, EventHandler<BulkTaskFinalizedEventArgs<Guid, ProcessInstancesTree>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #

Parameters

Name
Type
Description
rootProcessIds
IEnumerable<Guid>
A collection of root process IDs for which instance trees are obtained.
taskFinalizedHandler
EventHandler<Guid, ProcessInstancesTree>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, ProcessInstancesTree>
A dictionary of final task states and results. The key is each corresponding item from rootProcessIds.
Task<Dictionary<Guid, BulkTaskResult<ProcessInstancesTree>>> GetProcessInstancesTreeAsync(IEnumerable<ProcessInstance> processInstances, EventHandler<BulkTaskFinalizedEventArgs<Guid, ProcessInstancesTree>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #

Parameters

Name
Type
Description
processInstances
IEnumerable<ProcessInstance>
A collection of process instances for which trees are obtained.
taskFinalizedHandler
EventHandler<Guid, ProcessInstancesTree>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, ProcessInstancesTree>
A dictionary of final task states and results. The key is ProcessInstance.ProcessId.
Task<Dictionary<Guid, BulkTaskResult<List<WorkflowCommand>>>> GetAvailableCommandsAsync(IEnumerable<ProcessInstance> processInstances, IEnumerable<string> identityIds, string? commandNameFilter = null, string? mainIdentityId = null, CultureInfo? culture = null, bool conditionCheck = false, EventHandler<BulkTaskFinalizedEventArgs<Guid, List<WorkflowCommand>>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #

Parameters

Name
Type
Description
processInstances
IEnumerable<ProcessInstance>
A collection of process instances for which commands are queried.
identityIds
IEnumerable<String>
Identity IDs used for building the initial command list.
commandNameFilter
String
Returns only the named command when provided.
mainIdentityId
String
Main identity ID used for priority rule checks.
culture
CultureInfo
Culture used for localizing command names and parameters.
conditionCheck
Boolean
When true, commands with failed condition checks are excluded.
taskFinalizedHandler
EventHandler<Guid, WorkflowCommand>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, WorkflowCommand>
A dictionary of final task states and results. The key is ProcessInstance.ProcessId.
Task<Dictionary<Guid, BulkTaskResult<List<WorkflowCommand>>>> GetAvailableCommandsAsync(IEnumerable<ProcessInstance> processInstances, string identityId, EventHandler<BulkTaskFinalizedEventArgs<Guid, List<WorkflowCommand>>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #

Parameters

Name
Type
Description
processInstances
IEnumerable<ProcessInstance>
A collection of process instances for which commands are queried.
identityId
String
Identity ID used for building the initial command list.
taskFinalizedHandler
EventHandler<Guid, WorkflowCommand>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, WorkflowCommand>
A dictionary of final task states and results. The key is ProcessInstance.ProcessId.
Task<Dictionary<Guid, BulkTaskResult<List<WorkflowCommand>>>> GetAvailableCommandsAsync(IEnumerable<Guid> processIds, IEnumerable<string> identityIds, string? commandNameFilter = null, string? mainIdentityId = null, CultureInfo? culture = null, bool conditionCheck = false, EventHandler<BulkTaskFinalizedEventArgs<Guid, List<WorkflowCommand>>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #

Parameters

Name
Type
Description
processIds
IEnumerable<Guid>
A collection of process IDs for which commands are queried.
identityIds
IEnumerable<String>
Identity IDs used for building the initial command list.
commandNameFilter
String
Returns only the named command when provided.
mainIdentityId
String
Main identity ID used for priority rule checks.
culture
CultureInfo
Culture used for localizing command names and parameters.
conditionCheck
Boolean
When true, commands with failed condition checks are excluded.
taskFinalizedHandler
EventHandler<Guid, WorkflowCommand>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, WorkflowCommand>
A dictionary of final task states and results. The key is each corresponding item from processIds.
Task<Dictionary<Guid, BulkTaskResult<List<WorkflowCommand>>>> GetAvailableCommandsAsync(IEnumerable<Guid> processIds, string identityId, EventHandler<BulkTaskFinalizedEventArgs<Guid, List<WorkflowCommand>>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #

Parameters

Name
Type
Description
processIds
IEnumerable<Guid>
A collection of process IDs for which commands are queried.
identityId
String
Identity ID used for building the initial command list.
taskFinalizedHandler
EventHandler<Guid, WorkflowCommand>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, WorkflowCommand>
A dictionary of final task states and results. The key is each corresponding item from processIds.
Task<Dictionary<Guid, BulkTaskResult<List<WorkflowCommand>>>> GetAvailableCommandsAsync(IEnumerable<Guid> processIds, string identityId, CultureInfo culture, EventHandler<BulkTaskFinalizedEventArgs<Guid, List<WorkflowCommand>>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #

Parameters

Name
Type
Description
processIds
IEnumerable<Guid>
A collection of process IDs for which commands are queried.
identityId
String
Identity ID used for building the initial command list.
culture
CultureInfo
Culture used for localizing command names and parameters.
taskFinalizedHandler
EventHandler<Guid, WorkflowCommand>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, WorkflowCommand>
A dictionary of final task states and results. The key is each corresponding item from processIds.
Task<Dictionary<Guid, BulkTaskResult<CommandExecutionResult>>> ExecuteCommandAsync(IEnumerable<WorkflowCommand> commands, string identityId, string impersonatedIdentityId, bool checkRestrictions = false, EventHandler<BulkTaskFinalizedEventArgs<Guid, CommandExecutionResult>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #

Parameters

Name
Type
Description
commands
IEnumerable<WorkflowCommand>
A collection of commands to execute.
identityId
String
The identity ID that initiates command execution.
impersonatedIdentityId
String
The identity ID on whose behalf the commands are executed.
checkRestrictions
Boolean
When true, actor-restriction checks are enforced for each transition.
taskFinalizedHandler
EventHandler<Guid, CommandExecutionResult>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, CommandExecutionResult>
A dictionary of final task states and results. The key is WorkflowCommand.ProcessId.
Task<Dictionary<Guid, BulkTaskResult<CommandExecutionResult>>> ExecuteCommandWithRestrictionCheckAsync(IEnumerable<WorkflowCommand> commands, string identityId, string impersonatedIdentityId, EventHandler<BulkTaskFinalizedEventArgs<Guid, CommandExecutionResult>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #

Parameters

Name
Type
Description
commands
IEnumerable<WorkflowCommand>
A collection of commands to execute.
identityId
String
The identity ID that initiates command execution.
impersonatedIdentityId
String
The identity ID on whose behalf the commands are executed.
taskFinalizedHandler
EventHandler<Guid, CommandExecutionResult>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, CommandExecutionResult>
A dictionary of final task states and results. The key is WorkflowCommand.ProcessId.
Task<Dictionary<Guid, BulkTaskResult<Empty>>> UpdateSchemeIfObsoleteAsync(List<Guid> processIds, bool ignoreAutoSchemeUpdate, EventHandler<BulkTaskFinalizedEventArgs<Guid, Empty>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #

Parameters

Name
Type
Description
processIds
List<Guid>
A collection of process IDs for which schema updates are performed.
ignoreAutoSchemeUpdate
Boolean
When true, ignores auto-scheme update behavior.
taskFinalizedHandler
EventHandler<Guid, Empty>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, Empty>
A dictionary of final task states and results. The key is each corresponding item from processIds.
Task<Dictionary<Guid, BulkTaskResult<Empty>>> UpdateSchemeIfObsoleteAsync(List<Guid> processIds, EventHandler<BulkTaskFinalizedEventArgs<Guid, Empty>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #
Executes WorkflowRuntime.UpdateSchemeIfObsoleteAsync(Guid) for each processIds item.

Parameters

Name
Type
Description
processIds
List<Guid>
A collection of process IDs for which schema updates are performed.
taskFinalizedHandler
EventHandler<Guid, Empty>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, Empty>
A dictionary of final task states and results. The key is each corresponding item from processIds.
Task<Dictionary<Guid, BulkTaskResult<Empty>>> DeleteInstanceAsync(List<Guid> processIds, EventHandler<BulkTaskFinalizedEventArgs<Guid, Empty>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #
Executes WorkflowRuntime.DeleteInstanceAsync(Guid) for each processIds item.

Parameters

Name
Type
Description
processIds
List<Guid>
A collection of process IDs for which instances are deleted.
taskFinalizedHandler
EventHandler<Guid, Empty>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, Empty>
A dictionary of final task states and results. The key is each corresponding item from processIds.
Task<Dictionary<Guid, BulkTaskResult<bool>>> IsProcessExistsAsync(List<Guid> processIds, EventHandler<BulkTaskFinalizedEventArgs<Guid, bool>>? taskFinalizedHandler = null, int? maxDegreeOfParallelism = null, bool? throwOnError = null, CancellationToken cancellationToken = default) #
Executes WorkflowRuntime.IsProcessExistsAsync(Guid) for each processIds item.

Parameters

Name
Type
Description
processIds
List<Guid>
A collection of process IDs to check for existence.
taskFinalizedHandler
EventHandler<Guid, Boolean>
Event handler invoked when an individual task in the batch completes. It receives the task's progress and intermediate result in BulkTaskFinalizedEventArgs<TId, TResult>.
maxDegreeOfParallelism
Nullable<Int32>
Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnError
Nullable<Boolean>
When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationToken
CancellationToken
Cancellation token observed while scheduling and executing tasks. If cancellation is requested, no new tasks are started and already running tasks continue.

Returns

Type
Description
Task<Guid, Boolean>
A dictionary of final task states and results. The key is each corresponding item from processIds.