Interface IBulkApi
OptimaJet.Workflow.Core.Runtime.Bulk.IBulkApi
Provides an API for executing WorkflowRuntime operations in bulk mode.
Namespace: OptimaJet.Workflow.Core.Runtime.Bulk
public interface IBulkApiProperties
Name
Type
DefaultMaxDegreeOfParallelism #Int32Gets or sets the default value used for the
maxDegreeOfParallelism argument in Bulk API methods.DefaultThrowOnError #BooleanGets 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) #Executes WorkflowRuntime.CreateInstanceAsync(CreateInstanceParams, CancellationToken) for each
createInstanceParams item.Parameters
Name
Type
Description
createInstanceParamsIEnumerable<CreateInstanceParams>A collection of CreateInstanceParams values describing the process instances to create.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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) #Executes WorkflowRuntime.CreateInstanceAsync(string, Guid, CancellationToken) for each
processIds item.Parameters
Name
Type
Description
processIdsIEnumerable<Guid>A collection of process IDs for which instances are created.
schemaCodeStringSchema code used when creating instances.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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) #Executes WorkflowRuntime.GetProcessInstanceAndFillProcessParametersAsync(Guid) for each
processIds item.Parameters
Name
Type
Description
processIdsIEnumerable<Guid>A collection of process IDs for which process instances are obtained and filled.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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) #Executes WorkflowRuntime.GetProcessInstancesTreeAsync(Guid, CancellationToken) for each
rootProcessIds item.Parameters
Name
Type
Description
rootProcessIdsIEnumerable<Guid>A collection of root process IDs for which instance trees are obtained.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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) #Executes WorkflowRuntime.GetProcessInstancesTreeAsync(ProcessInstance, CancellationToken) for each
processInstances item.Parameters
Name
Type
Description
processInstancesIEnumerable<ProcessInstance>A collection of process instances for which trees are obtained.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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) #Executes WorkflowRuntime.GetAvailableCommandsAsync(ProcessInstance, IEnumerable<string>, string, string, CultureInfo, bool, CancellationToken) for each
processInstances item.Parameters
Name
Type
Description
processInstancesIEnumerable<ProcessInstance>A collection of process instances for which commands are queried.
identityIdsIEnumerable<String>Identity IDs used for building the initial command list.
commandNameFilterStringReturns only the named command when provided.
mainIdentityIdStringMain identity ID used for priority rule checks.
cultureCultureInfoCulture used for localizing command names and parameters.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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) #Executes WorkflowRuntime.GetAvailableCommandsAsync(ProcessInstance, IEnumerable<string>, string, string, CultureInfo, bool, CancellationToken) for each
processInstances item.Parameters
Name
Type
Description
processInstancesIEnumerable<ProcessInstance>A collection of process instances for which commands are queried.
identityIdStringIdentity ID used for building the initial command list.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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) #Executes WorkflowRuntime.GetAvailableCommandsAsync(Guid, IEnumerable<string>, string, string, CultureInfo, bool, CancellationToken) for each
processIds item.Parameters
Name
Type
Description
processIdsIEnumerable<Guid>A collection of process IDs for which commands are queried.
identityIdsIEnumerable<String>Identity IDs used for building the initial command list.
commandNameFilterStringReturns only the named command when provided.
mainIdentityIdStringMain identity ID used for priority rule checks.
cultureCultureInfoCulture used for localizing command names and parameters.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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) #Executes WorkflowRuntime.GetAvailableCommandsAsync(Guid, IEnumerable<string>, string, string, CultureInfo, bool, CancellationToken) for each
processIds item.Parameters
Name
Type
Description
processIdsIEnumerable<Guid>A collection of process IDs for which commands are queried.
identityIdStringIdentity ID used for building the initial command list.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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) #Executes WorkflowRuntime.GetAvailableCommandsAsync(Guid, IEnumerable<string>, string, string, CultureInfo, bool, CancellationToken) for each
processIds item.Parameters
Name
Type
Description
processIdsIEnumerable<Guid>A collection of process IDs for which commands are queried.
identityIdStringIdentity ID used for building the initial command list.
cultureCultureInfoCulture used for localizing command names and parameters.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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) #Executes WorkflowRuntime.ExecuteCommandAsync(WorkflowCommand, string, string, CancellationToken, bool) for each command in
commands.Parameters
Name
Type
Description
commandsIEnumerable<WorkflowCommand>A collection of commands to execute.
identityIdStringThe identity ID that initiates command execution.
impersonatedIdentityIdStringThe identity ID on whose behalf the commands are executed.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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) #Executes WorkflowRuntime.ExecuteCommandWithRestrictionCheckAsync(WorkflowCommand, string, string, CancellationToken) for each command in
commands.Parameters
Name
Type
Description
commandsIEnumerable<WorkflowCommand>A collection of commands to execute.
identityIdStringThe identity ID that initiates command execution.
impersonatedIdentityIdStringThe identity ID on whose behalf the commands are executed.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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) #Executes WorkflowRuntime.UpdateSchemeIfObsoleteAsync(Guid, bool) for each
processIds item.Parameters
Name
Type
Description
processIdsList<Guid>A collection of process IDs for which schema updates are performed.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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
processIdsList<Guid>A collection of process IDs for which schema updates are performed.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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
processIdsList<Guid>A collection of process IDs for which instances are deleted.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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
processIdsList<Guid>A collection of process IDs to check for existence.
taskFinalizedHandlerEventHandler<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>.
maxDegreeOfParallelismNullable<Int32>Maximum number of tasks that may execute concurrently while running this bulk call.
throwOnErrorNullable<Boolean>When true, after all tasks are completed, an AggregateException is thrown if at least one task has failed.
cancellationTokenCancellationTokenCancellation 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.