Class OfflineApi
OptimaJet.Workflow.Core.Runtime.OfflineApi
Provides API operations for building approval maps and executing ordered batches of workflow commands.
Namespace: OptimaJet.Workflow.Core.Runtime
public sealed class OfflineApiConstructors
public OfflineApi(WorkflowRuntime runtimeOwner) #Initializes a new OfflineApi instance for the specified WorkflowRuntime.
Parameters
Name
Type
Description
runtimeOwnerWorkflowRuntimeRuntime used to query process state and execute commands.
Methods
public Task<Dictionary<string, ActivityDto>> GetApprovalMapAsync(ProcessDefinition scheme, Func<TransitionDefinition, Task<bool>> predicate = null, bool ignoreSubprocesses = false) #Gets the possible approval transitions for a process scheme.
Parameters
Name
Type
Description
schemeProcessDefinitionProcess scheme containing transitions to evaluate.
predicateFunc<TransitionDefinition, Boolean>Optional asynchronous validation callback executed for each transition before it is added to the map. If omitted, all applicable transitions are included.
ignoreSubprocessesBooleantrue to skip transitions where either end of the transition has a nesting level greater than zero.
Returns
Type
Description
Task<String, ActivityDto>A dictionary of activity names and corresponding ActivityDto objects with their possible approval transitions.
public Task<Dictionary<string, ActivityDto>> GetApprovalMapAsync(ProcessInstance pi, string identityId) #Gets the approval map for a running process instance and marks activities that are currently active.
Parameters
Name
Type
Description
piProcessInstanceProcess instance to analyze.
identityIdStringThe workflow participant identity evaluated against actor restrictions on transitions.
Returns
Type
Description
Task<String, ActivityDto>A dictionary of activity names and corresponding ActivityDto objects where matching activities are marked with ActivityDto.IsCurrent when they are active in the process tree.
public Task<List<CommandExecutionResult>> ExecuteSomeCommandsAsync(IEnumerable<Command> commands) #Executes multiple commands, grouping them by process identifier and ordering each group by command date.
Parameters
Name
Type
Description
commandsIEnumerable<Command>Commands to execute.
Returns
Type
Description
Task<CommandExecutionResult>One execution result per input command, returned in the original input order. An exception while executing a command interrupts only the remaining commands in the same process group.
public Task<List<CommandExecutionResult>> ExecuteSomeCommandsAsync(Guid processId, IEnumerable<Command> commands) #Executes several commands for one process, in command date order.
Parameters
Name
Type
Description
processIdGuidIdentifier of the process for which all commands are executed.
Returns
Type
Description
Task<CommandExecutionResult>Execution results in the original input order. If executing a command throws, later commands by date are not executed and are marked as interrupted.