Assembly: OptimaJet.Workflow.Core

Class WorkflowRuntimeConfigurationExtension

OptimaJet.Workflow.Core.Runtime.WorkflowRuntimeConfigurationExtension

Provides fluent configuration methods for WorkflowRuntime.

public static class WorkflowRuntimeConfigurationExtension

Methods

public static WorkflowRuntime SetCancellationTokenHandling(this WorkflowRuntime runtime, CancellationTokenHandling value) #
Sets WorkflowRuntimeSettings.CancellationTokenHandling for the runtime. This controls whether an already-requested cancellation stops continuation after an activity or is ignored at that checkpoint.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
value
CancellationTokenHandling
The CancellationTokenHandling mode to use.

Returns

Type
Description
WorkflowRuntime
The configured runtime for fluent chaining.
public static IWorkflowBuilder WithDefaultBuildSteps(this IWorkflowBuilder builder, WorkflowRuntime runtime) #
Registers the default build steps on an IWorkflowBuilder. Schemes built afterward support scheme inlining, queued subprocess starts, activity timeouts, and community-edition labeling.

Parameters

Name
Type
Description
builder
IWorkflowBuilder
The instance of the builder.
runtime
WorkflowRuntime
The runtime instance. This method currently does not read this parameter.

Returns

Type
Description
IWorkflowBuilder
The configured builder.

Remarks

Adds InlineSchemesStep, SubprocessStartInTimerQueueStep, ActivitiesTimeoutsBuildStep, and the community-edition labeling step when the corresponding step is not already registered.
public static WorkflowRuntime WithBuilder(this WorkflowRuntime runtime, IWorkflowBuilder builder) #
Assigns the specified IWorkflowBuilder to WorkflowRuntime.Builder, registers any missing default build steps, and associates the builder with the runtime. The runtime can then use the builder to load, parse, build, and prepare process schemes for execution.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
builder
IWorkflowBuilder
The instance of the builder IWorkflowBuilder.

Returns

Type
Description
WorkflowRuntime
The configured runtime for fluent chaining.
public static WorkflowRuntime WithPersistenceProvider(this WorkflowRuntime runtime, IPersistenceProvider persistenceProvider) #
Assigns the specified IPersistenceProvider to WorkflowRuntime.PersistenceProvider and initializes it. The runtime then uses the provider to store and retrieve process state, parameters, timers, and runtime coordination data.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
persistenceProvider
IPersistenceProvider
The instance of the persistence provider IPersistenceProvider.

Returns

Type
Description
WorkflowRuntime
The configured runtime for fluent chaining.
public static WorkflowRuntime SwitchAutoUpdateSchemeBeforeGetAvailableCommandsOn(this WorkflowRuntime runtime) #
Sets WorkflowRuntimeSettings.IsAutoUpdateSchemeBeforeGetAvailableCommands to true. An available-command request can then update an obsolete process scheme first when the current activity permits automatic scheme updates.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.

Returns

Type
Description
WorkflowRuntime
The configured runtime for fluent chaining.
public static WorkflowRuntime SwitchAutoUpdateSchemeBeforeGetAvailableCommandsOff(this WorkflowRuntime runtime) #
Sets WorkflowRuntimeSettings.IsAutoUpdateSchemeBeforeGetAvailableCommands to false. Available commands are then calculated against the process's current scheme without an automatic scheme update.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.

Returns

Type
Description
WorkflowRuntime
The configured runtime for fluent chaining.
public static Task<WorkflowRuntime> StartAsync(this WorkflowRuntime runtime) #
Starts all services of the specified WorkflowRuntime and compiles global code actions. The runtime can then execute process operations and run the configured recovery and timer services.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.

Returns

Type
Description
Task<WorkflowRuntime>
The configured runtime.

Exceptions

Type
Description
InvalidOperationException
Thrown when runtime settings are invalid.
public static WorkflowRuntime Start(this WorkflowRuntime runtime) #
Starts all services of the specified WorkflowRuntime and compiles global code actions. The runtime can then execute process operations and run the configured recovery and timer services.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.

Returns

Type
Description
WorkflowRuntime
The configured runtime.

Exceptions

Type
Description
InvalidOperationException
Thrown when runtime settings are invalid.
public static Task<(WorkflowRuntime runtime, Dictionary<string, string> compilerErrors)> StartAsync(this WorkflowRuntime runtime, bool ignoreNotCompiledGlobalActions) #
Starts all services of the specified WorkflowRuntime and compiles global code actions. When ignoreNotCompiledGlobalActions is true, startup continues with successfully compiled actions and returns errors for the actions that could not be compiled.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
ignoreNotCompiledGlobalActions
Boolean
true to ignore global code action compilation errors.

Returns

Type
Description
Task<WorkflowRuntime, String, String>
The task result includes the configured runtime and global code action compile errors.

Exceptions

Type
Description
InvalidOperationException
Thrown when runtime settings are invalid.
public static WorkflowRuntime Start(this WorkflowRuntime runtime, bool ignoreNotCompiledGlobalActions, out Dictionary<string, string> compilerErrors) #
Starts all services of the specified WorkflowRuntime and compiles global code actions. When ignoreNotCompiledGlobalActions is true, startup continues with successfully compiled actions and returns errors for the actions that could not be compiled.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
ignoreNotCompiledGlobalActions
Boolean
true to ignore global code action compilation errors.
compilerErrors
Dictionary<String, String>
Receives the global code action compiler errors.

Returns

Type
Description
WorkflowRuntime
The configured runtime.

Exceptions

Type
Description
InvalidOperationException
Thrown when runtime settings are invalid.
public static Task<WorkflowRuntime> ColdStartAsync(this WorkflowRuntime runtime) #
Starts the WorkflowRuntime in cold mode and compiles global code actions without starting WorkflowRuntime.TimerManager or the multi-server service timer. Process operations can then be called while automatic timer processing and the multi-server service cycle remain paused.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.

Returns

Type
Description
Task<WorkflowRuntime>
The configured runtime.

Exceptions

Type
Description
InvalidOperationException
Thrown when runtime settings are invalid.
public static WorkflowRuntime ColdStart(this WorkflowRuntime runtime) #
Starts the WorkflowRuntime in cold mode and compiles global code actions without starting WorkflowRuntime.TimerManager or the multi-server service timer. Process operations can then be called while automatic timer processing and the multi-server service cycle remain paused.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.

Returns

Type
Description
WorkflowRuntime
The configured runtime.

Exceptions

Type
Description
InvalidOperationException
Thrown when runtime settings are invalid.
public static Task<(WorkflowRuntime runtime, Dictionary<string, string> compilerErrors)> ColdStartAsync(this WorkflowRuntime runtime, bool ignoreNotCompiledGlobalActions) #
Starts the WorkflowRuntime in cold mode and compiles global code actions without starting WorkflowRuntime.TimerManager or the multi-server service timer. Process operations remain available while background work is paused; when ignoreNotCompiledGlobalActions is true, compilation errors are returned without stopping startup.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
ignoreNotCompiledGlobalActions
Boolean
true to ignore global code action compilation errors.

Returns

Type
Description
Task<WorkflowRuntime, String, String>
A task that returns the configured runtime and global compiler errors.

Exceptions

Type
Description
InvalidOperationException
Thrown when runtime settings are invalid.
public static WorkflowRuntime ColdStart(this WorkflowRuntime runtime, bool ignoreNotCompiledGlobalActions, out Dictionary<string, string> compilerErrors) #
Starts the WorkflowRuntime in cold mode and compiles global code actions without starting WorkflowRuntime.TimerManager or the multi-server service timer. Process operations remain available while background work is paused; when ignoreNotCompiledGlobalActions is true, compilation errors are returned without stopping startup.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
ignoreNotCompiledGlobalActions
Boolean
true to ignore global code action compilation errors.
compilerErrors
Dictionary<String, String>
Receives the global code action compiler errors.

Returns

Type
Description
WorkflowRuntime
The configured runtime.

Exceptions

Type
Description
InvalidOperationException
Thrown when runtime settings are invalid.
public static IWorkflowBuilder WithCache(this IWorkflowBuilder bulder, IParsedProcessCache cache) #
Configures an IWorkflowBuilder with the specified IParsedProcessCache. Parsed and built process definitions can then be reused instead of being recreated each time a scheme is requested.

Parameters

Name
Type
Description
bulder
IWorkflowBuilder
The workflow builder instance.
cache
IParsedProcessCache
The cache instance for parsed process definitions.

Returns

Type
Description
IWorkflowBuilder
The configured builder.
public static IWorkflowBuilder WithDefaultCache(this IWorkflowBuilder bulder) #
Configures an IWorkflowBuilder with the default in-memory DefaultParcedProcessCache. Parsed and built process definitions can then be reused for the lifetime of this cache.

Parameters

Name
Type
Description
bulder
IWorkflowBuilder
The workflow builder instance.

Returns

Type
Description
IWorkflowBuilder
The configured builder.
public static IWorkflowBuilder WithGenerator<TSchemeMedium>(this WorkflowBuilder<TSchemeMedium> bulder, IWorkflowGenerator<TSchemeMedium> generator) where TSchemeMedium : class #
Configures a WorkflowBuilder<TSchemeMedium> with the specified IWorkflowGenerator<TSchemeMedium>. The builder can then generate a new source scheme when a requested scheme does not yet exist in storage.

Parameters

Name
Type
Description
bulder
WorkflowBuilder<TSchemeMedium>
The workflow builder instance.
generator
IWorkflowGenerator<TSchemeMedium>
The workflow scheme generator.

Returns

Type
Description
IWorkflowBuilder
The configured builder.
public static IWorkflowBuilder WithParser<TSchemeMedium>(this WorkflowBuilder<TSchemeMedium> bulder, IWorkflowParser<TSchemeMedium> parser) where TSchemeMedium : class #
Configures a WorkflowBuilder<TSchemeMedium> with the specified IWorkflowParser<TSchemeMedium>. The builder can then convert stored schemes into executable ProcessDefinition instances and serialize edited definitions back to the source representation.

Parameters

Name
Type
Description
bulder
WorkflowBuilder<TSchemeMedium>
The workflow builder instance.
parser
IWorkflowParser<TSchemeMedium>
The workflow scheme parser.

Returns

Type
Description
IWorkflowBuilder
The configured builder.
public static IWorkflowBuilder WithShemePersistenceProvider<TSchemeMedium>(this WorkflowBuilder<TSchemeMedium> builder, ISchemePersistenceProvider<TSchemeMedium> schemePersistenceProvider) where TSchemeMedium : class #
Configures a WorkflowBuilder<TSchemeMedium> with the specified ISchemePersistenceProvider<TSchemeMedium>. The builder can then load and save source schemes and resolve the scheme assigned to a process instance.

Parameters

Name
Type
Description
builder
WorkflowBuilder<TSchemeMedium>
The workflow builder instance.
schemePersistenceProvider
ISchemePersistenceProvider<TSchemeMedium>
The scheme persistence provider.

Returns

Type
Description
IWorkflowBuilder
The configured builder.
public static WorkflowRuntime WithTimerManager(this WorkflowRuntime runtime, ITimerManager timerManager) #
Assigns the specified ITimerManager to WorkflowRuntime.TimerManager and initializes it. Once the runtime starts, the manager can find due workflow timers and execute their timer transitions.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
timerManager
ITimerManager
The timer manager.

Returns

Type
Description
WorkflowRuntime
The configured runtime for fluent chaining.
public static WorkflowRuntime WithCalendars(this WorkflowRuntime runtime, params ICalendar[] calendars) #
Adds ICalendar instances whose names are not already present in WorkflowRuntime.Calendars. Registered calendars can then be selected by a process or scheme for working-time-aware date and timer calculations.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
calendars
ICalendar[]
The work calendar instances. A calendar whose name is already registered is ignored.

Returns

Type
Description
WorkflowRuntime
The configured runtime for fluent chaining.
public static WorkflowRuntime SetDefaultCalendar(this WorkflowRuntime runtime, string calendarName) #
Sets WorkflowRuntime.DefaultCalendarName. Processes whose instance and scheme do not specify a calendar then use this calendar for date and timer calculations.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
calendarName
String
The work calendar name.

Returns

Type
Description
WorkflowRuntime
The configured runtime.

Exceptions

Type
Description
ArgumentException
Thrown when the named calendar is not registered.
public static WorkflowRuntime EnableCodeActions(this WorkflowRuntime runtime) #
Sets WorkflowRuntime.CodeActionsCompillationEnable and WorkflowRuntime.ExpressionsCompilationEnable to true. Code actions and expressions defined in process schemes can then be compiled and executed.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime returned for fluent chaining; the compilation setting is process-wide.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithExpressionsCompilerOptions(this WorkflowRuntime runtime, ExpressionsCompilerOptions options) #
Sets the process-wide WorkflowRuntime.ExpressionsCompilerOptions used by ExpressionsCompiler. These options control parallelism and garbage collection while expressions from process schemes are compiled.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime returned for fluent chaining; the compiler options are process-wide.
options
ExpressionsCompilerOptions

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime CodeActionsDebugOn(this WorkflowRuntime runtime) #
Sets the process-wide WorkflowRuntime.CodeActionsDebugMode to true. Compiled code actions can then interrupt an attached debugger at an explicit debug break.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime returned for fluent chaining; debug mode is process-wide.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime DisableCodeActions(this WorkflowRuntime runtime) #
Sets WorkflowRuntime.CodeActionsCompillationEnable and WorkflowRuntime.ExpressionsCompilationEnable to false. Code actions and expressions defined in process schemes are then left uncompiled and cannot provide executable implementations.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime returned for fluent chaining; the compilation setting is process-wide.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime RegisterAssemblyForCodeActions(this WorkflowRuntime runtime, Assembly assembly, bool ignoreForDesigner = false, Func<Type, bool> designerTypeFilter = null) #
Registers an assembly with WorkflowRuntime.CodeActionsRegisterAssembly(Assembly) and, unless disabled, with the Designer type registry. Code actions can then reference types from that assembly, and the Designer can expose those types when registration for it is enabled.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime returned for fluent chaining; assembly registration is process-wide.
assembly
Assembly
The assembly for registration.
ignoreForDesigner
Boolean
true to skip registering assembly types in the designer; otherwise, false.
designerTypeFilter
Func<Type, Boolean>
Optional filter for types exposed to the designer.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime SetExecutionSearchOrder(this WorkflowRuntime runtime, ExecutionSearchOrder order) #
Sets WorkflowRuntimeSettings.ExecutionSearchOrder, which controls lookup of actions, conditions, and rules by name. When the same name exists in local code actions, global code actions, and a provider, the first matching source in this order supplies the implementation.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
order
ExecutionSearchOrder

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithRuleProvider(this WorkflowRuntime runtime, IWorkflowRuleProvider ruleProvider, List<string> schemes = null) #
Adds an IWorkflowRuleProvider to WorkflowRuntime.RuleProvider. Rules exposed by the provider can then be referenced by actors and transition restrictions to check or calculate the workflow participants allowed to execute a transition.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
ruleProvider
IWorkflowRuleProvider
The rule provider to add.
schemes
List<String>
Scheme codes for which to register the provider; null or an empty list registers it globally.

Returns

Type
Description
WorkflowRuntime
The configured runtime.

Exceptions

Type
Description
ArgumentNullException
Thrown when ruleProvider is null.
public static WorkflowRuntime ClearRuleProvider(this WorkflowRuntime runtime) #
Resets WorkflowRuntime.RuleProvider to EmptyWorkflowRuleProvider. Provider-backed rules are then unavailable, while local and global code-action rules can still be resolved.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithActionProvider(this WorkflowRuntime runtime, IWorkflowActionProvider workflowActionProvider, List<string> schemes = null) #
Adds an IWorkflowActionProvider to WorkflowRuntime.ActionProvider. Actions and conditions exposed by the provider can then be referenced by name and executed from process schemes.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
workflowActionProvider
IWorkflowActionProvider
The action provider to add.
schemes
List<String>
Scheme codes for which to register the provider; null or an empty list registers it globally.

Returns

Type
Description
WorkflowRuntime
The configured runtime.

Exceptions

Type
Description
ArgumentNullException
Thrown when workflowActionProvider is null.
public static WorkflowRuntime ClearActionProvider(this WorkflowRuntime runtime) #
Resets WorkflowRuntime.ActionProvider to EmptyWorkflowActionProvider. Provider-backed actions and conditions are then unavailable, while local and global code actions can still be resolved.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithExternalParametersProvider(this WorkflowRuntime runtime, IWorkflowExternalParametersProvider externalParametersProvider, List<string> schemes = null) #
Adds an IWorkflowExternalParametersProvider to WorkflowRuntime.ExternalParametersProvider. When process code reads or writes a parameter recognized by the provider, the runtime delegates that access to the provider instead of treating the value as an ordinary process parameter.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
externalParametersProvider
IWorkflowExternalParametersProvider
The external parameters provider to add.
schemes
List<String>
Scheme codes for which to register the provider; null or an empty list registers it globally.

Returns

Type
Description
WorkflowRuntime
The configured runtime.

Exceptions

Type
Description
ArgumentNullException
Thrown when externalParametersProvider is null.
public static WorkflowRuntime ClearExternalParametersProvider(this WorkflowRuntime runtime) #
Resets WorkflowRuntime.ExternalParametersProvider to EmptyWorkflowExternalParametersProvider. Parameter access is then limited to parameters held by the process instance because no external parameter names are recognized.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithLocalizationProvider(this WorkflowRuntime runtime, ILocalizationProvider provider) #
Sets the external ILocalizationProvider used by WorkflowRuntime.Localizer and predefined Designer localization. The runtime and Designer can then resolve localized names and translations supplied outside process schemes.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
provider
ILocalizationProvider
The localization provider implementation.

Returns

Type
Description
WorkflowRuntime
The configured runtime.

Exceptions

Type
Description
ArgumentNullException
Thrown when provider is null.

Remarks

Configure the provider before WorkflowRuntime.Localizer is first accessed because the localizer captures its sources when it is initialized.
public static WorkflowRuntime ClearLocalizationProvider(this WorkflowRuntime runtime) #
Clears the external localization provider by resetting it to null. Future localization initialization and Designer requests then stop including translations from that provider.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.

Returns

Type
Description
WorkflowRuntime
The configured runtime.

Remarks

If WorkflowRuntime.Localizer has already been initialized, that localizer retains the sources it captured during initialization.
public static WorkflowRuntime WithDesignerAutocompleteProvider(this WorkflowRuntime runtime, IDesignerAutocompleteProvider autocompleteProvider, List<string> schemes = null) #
Adds an IDesignerAutocompleteProvider to WorkflowRuntime.DesignerAutocompleteProvider. The Workflow Designer can then show its suggestions in rule, action, and condition parameter fields.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
autocompleteProvider
IDesignerAutocompleteProvider
The designer autocomplete provider to add.
schemes
List<String>
Scheme codes for which to register the provider; null or an empty list registers it globally.

Returns

Type
Description
WorkflowRuntime
The configured runtime.

Exceptions

Type
Description
ArgumentNullException
Thrown when autocompleteProvider is null.
public static WorkflowRuntime ClearDesignerAutocompleteProvider(this WorkflowRuntime runtime) #
Resets WorkflowRuntime.DesignerAutocompleteProvider to its default value, null. The Workflow Designer then receives no custom autocomplete suggestions from the runtime.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithDesignerParameterFormatProvider(this WorkflowRuntime runtime, IDesignerParameterFormatProvider designerParameterFormatProvider, List<string> schemes = null) #
Adds an IDesignerParameterFormatProvider to WorkflowRuntime.DesignerParameterFormatProvider. The Workflow Designer can then build structured forms for editing parameters of the named actions, conditions, and rules supplied by the provider.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
designerParameterFormatProvider
IDesignerParameterFormatProvider
The parameter format provider to add.
schemes
List<String>
Scheme codes for which to register the provider; null or an empty list registers it globally.

Returns

Type
Description
WorkflowRuntime
The configured runtime.

Exceptions

Type
Description
ArgumentNullException
Thrown when designerParameterFormatProvider is null.
public static WorkflowRuntime ClearDesignerParameterFormatProvider(this WorkflowRuntime runtime) #
Resets WorkflowRuntime.DesignerParameterFormatProvider to its default value, null. Provider-supplied parameter forms are then unavailable, so the Designer falls back to scheme-defined formats or raw parameter editing.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithPlugins(this WorkflowRuntime runtime, List<string> schemes, params IWorkflowPlugin[] plugins) #
Registers one or more IWorkflowPlugin instances in the workflow runtime. Any execution capabilities, external parameters, and Designer extensions implemented by the plugins then become available to the runtime.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
schemes
List<String>
Scheme codes passed to each plugin and used to scope provider capabilities that support scheme-specific registration.
plugins
IWorkflowPlugin[]
Plugin instances.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithPlugin(this WorkflowRuntime runtime, IWorkflowPlugin plugin, List<string> schemes = null) #
Registers an IWorkflowPlugin and its supported provider capabilities in the workflow runtime. Its execution capabilities, external parameters, and Designer extensions can then be used by workflows when the plugin implements the corresponding contracts.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
plugin
IWorkflowPlugin
The plugin instance.
schemes
List<String>
Scheme codes passed to the plugin and used to scope provider capabilities that support scheme-specific registration.

Returns

Type
Description
WorkflowRuntime
The configured runtime.

Exceptions

Type
Description
ArgumentNullException
Thrown when plugin is null.
public static WorkflowRuntime AsSingleServer(this WorkflowRuntime runtime) #
Configures WorkflowRuntime.WorkflowServiceRunner with a SingleServerServiceRunner and configures WorkflowRuntime.TimerManager for single-server execution using DefaultSingleServerSettingsSource. When started, this runtime can restore active processes and execute due timers without multi-server coordination.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime to configure for single-server execution.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime AsSingleServer(this WorkflowRuntime runtime, SingleServerSettings settings) #
Configures WorkflowRuntime.WorkflowServiceRunner with a SingleServerServiceRunner and configures WorkflowRuntime.TimerManager for single-server execution using the specified SingleServerSettings. When started, this runtime can restore active processes and execute due timers without multi-server coordination.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime to configure for single-server execution.
settings
SingleServerSettings
Single-server settings.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime AsSingleServer(this WorkflowRuntime runtime, ISingleServerSettingsSource settingsSource) #
Configures WorkflowRuntime.WorkflowServiceRunner with a SingleServerServiceRunner and configures WorkflowRuntime.TimerManager for single-server execution using the specified ISingleServerSettingsSource. When started, this runtime can restore active processes and execute due timers without multi-server coordination.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime to configure for single-server execution.
settingsSource
ISingleServerSettingsSource
Single-server settings source.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithProcessRestorer(this WorkflowRuntime runtime, IProcessRestorer restorer) #
Adds an IProcessRestorer that supplies custom recovery decisions while processes are restored after a runtime or server failure. A matching process can then resume according to the restorer's RestoreDecision instead of the default recovery decision.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
restorer
IProcessRestorer
The process restorer to add.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithServiceRunner(this WorkflowRuntime runtime, IWorkflowServiceRunner workflowServiceRunner) #
Sets WorkflowRuntime.WorkflowServiceRunner. The supplied runner then controls service-specific startup, including any restoration, coordination, and timer initialization that it implements.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
workflowServiceRunner
IWorkflowServiceRunner
The IWorkflowServiceRunner implementation to use.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithProcessLogger(this WorkflowRuntime runtime, IProcessLogProvider processLogger) #
Sets WorkflowRuntime.ProcessLogger. Subsequent process log entries are written to this provider and can be retrieved through its read methods.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
processLogger
IProcessLogProvider
The IProcessLogProvider implementation to use.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime ClearProcessRestorers(this WorkflowRuntime runtime) #
Removes all configured IProcessRestorer instances. Process recovery then uses the built-in default decision for every process.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime AsMultiServer(this WorkflowRuntime runtime, IMultiServerSettingsSource settingsSource) #
Configures WorkflowRuntime.WorkflowServiceRunner with a MultiServerServiceRunner and configures WorkflowRuntime.TimerManager for multi-server execution using the specified IMultiServerSettingsSource. When started, the runtime coordinates its liveness, process recovery, and timer work with the other runtime instances that use the same persistence storage.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime to configure for multi-server execution.
settingsSource
IMultiServerSettingsSource
Multi-server settings source.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime AsMultiServer(this WorkflowRuntime runtime) #
Configures WorkflowRuntime.WorkflowServiceRunner with a MultiServerServiceRunner and configures WorkflowRuntime.TimerManager for multi-server execution using DefaultMultiServerSettingsSource. When started, the runtime coordinates its liveness, process recovery, and timer work with the other runtime instances that use the same persistence storage.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime to configure for multi-server execution.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithRuntimeSettings(this WorkflowRuntime runtime, WorkflowRuntimeSettings settings) #
Replaces WorkflowRuntime.Settings with the specified WorkflowRuntimeSettings. Subsequent runtime operations use these values for execution lookup, cancellation, retries, limits, parsing, and timeouts.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
settings
WorkflowRuntimeSettings
The settings to assign.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithCustomActivities(this WorkflowRuntime runtime, List<ActivityBase> activities) #
Adds ActivityBase instances to WorkflowRuntime.CustomActivities. These activity types can then be placed in a process through the Workflow Designer and executed by the runtime.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
activities
List<ActivityBase>
The custom activities to add.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithCustomConditions(this WorkflowRuntime runtime, List<FormBase> conditions) #
Adds FormBase instances to WorkflowRuntime.CustomConditions. These condition forms can then be selected and configured in the Workflow Designer.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
conditions
List<FormBase>
The custom conditions to add.

Returns

Type
Description
WorkflowRuntime
The configured runtime.
public static WorkflowRuntime WithCustomActivity(this WorkflowRuntime runtime, ActivityBase activity) #
Adds an ActivityBase to WorkflowRuntime.CustomActivities. This activity type can then be placed in a process through the Workflow Designer and executed by the runtime.

Parameters

Name
Type
Description
runtime
WorkflowRuntime
The runtime instance.
activity
ActivityBase
The custom activity to add.

Returns

Type
Description
WorkflowRuntime
The configured runtime.