Workflow Engine .NET

Assembly: OptimaJet.Workflow.Api

Class Extensions

OptimaJet.Workflow.Api.Extensions

This class contains extensions for configuring Workflow Engine Api services and connecting ASP.NET middleware.

public static class Extensions

Inheritance

  • Object

Methods

public static IServiceCollection AddWorkflowApiCore(this IServiceCollection services, Action<WorkflowApiCoreOptions>? setupAction = null) #
Adds the core Workflow Engine Web Api services, enabling you to add endpoints using Extensions.MapWorkflowApi(IEndpointRouteBuilder).

Parameters

Name
Type
Description
services
IServiceCollection
setupAction
Action<WorkflowApiCoreOptions>
A delegate to configure the core Workflow Engine Api options.

Returns

Type
Description
IServiceCollection
A IServiceCollection that can be used to further configure services.
public static IServiceCollection AddWorkflowRuntime(this IServiceCollection services, Action<WorkflowTenantCreationOptions>? setupAction = null) #
Creates WorkflowRuntime and registers it with the service collection in single-tenant mode. For multi-tenant applications, use Extensions.AddWorkflowTenants(IServiceCollection, params WorkflowTenantCreationOptions[]) instead.

Parameters

Name
Type
Description
services
IServiceCollection
setupAction
Action<WorkflowTenantCreationOptions>
A delegate to configure the Workflow Runtime options. Using this method implies single-tenant mode, so the tenant ids will be set to a WorkflowApiConstants.SingleTenantId.

Returns

Type
Description
IServiceCollection
A IServiceCollection that can be used to further configure services.
public static IServiceCollection AddWorkflowTenants(this IServiceCollection services, params WorkflowTenantCreationOptions[] options) #
Creates IWorkflowTenant implementations and registers them with the service collection in multi-tenant mode. For single-tenant applications, use Extensions.AddWorkflowRuntime(IServiceCollection, Action<WorkflowTenantCreationOptions>?) instead.

Parameters

Name
Type
Description
services
IServiceCollection
options
WorkflowTenantCreationOptions[]
An array of options for creating the tenants.

Returns

Type
Description
IServiceCollection
A IServiceCollection that can be used to further configure services.
public static IServiceCollection AddWorkflowTenants(this IServiceCollection services, IEnumerable<WorkflowTenantCreationOptions> options) #
Creates IWorkflowTenant implementations and registers them with the service collection in multi-tenant mode. For single-tenant applications, use Extensions.AddWorkflowRuntime(IServiceCollection, Action<WorkflowTenantCreationOptions>?) instead.

Parameters

Name
Type
Description
services
IServiceCollection
options
IEnumerable<WorkflowTenantCreationOptions>
An enumerable of options for creating the tenants.

Returns

Type
Description
IServiceCollection
A IServiceCollection that can be used to further configure services.
public static IServiceCollection AddWorkflowApiSecurity(this IServiceCollection services, Action<WorkflowApiSecurityOptions>? setupAction = null) #
Adds services to provide authentication and authorization to Workflow Engine Web Api endpoints.

Parameters

Name
Type
Description
services
IServiceCollection
setupAction
Action<WorkflowApiSecurityOptions>
A delegate to configure the security options for Workflow Engine Api.

Returns

Type
Description
IServiceCollection
A IServiceCollection that can be used to further configure services.
public static IEndpointRouteBuilder MapWorkflowApi(this IEndpointRouteBuilder endpoints) #
Maps all Workflow Engine Web Api endpoints to the specified IEndpointRouteBuilder. When using this method, you must first add services using Extensions.AddWorkflowApiCore(IServiceCollection, Action<WorkflowApiCoreOptions>?).

Parameters

Name
Type
Description
endpoints
IEndpointRouteBuilder

Returns

Type
Description
IEndpointRouteBuilder
A IEndpointRouteBuilder that can be used to further configure endpoints.
public static IWorkflowTenantSnapshot GetHttpContextWorkflowTenantSnapshot(this IServiceProvider services) #
Gets the workflow tenant snapshot from the current HTTP context.

Parameters

Name
Type
Description
services
IServiceProvider

Returns

Type
Description
IWorkflowTenantSnapshot
The workflow tenant snapshot.
public static string GetHttpContextWorkflowTenantId(this IServiceProvider services) #
Gets the workflow tenant id from the current HTTP context based on the provided header or default tenant id.

Parameters

Name
Type
Description
services
IServiceProvider

Returns

Type
Description
String
The tenant id.
public static IWorkflowTenant GetHttpContextWorkflowTenant(this IServiceProvider services) #
Gets the workflow tenant instance from the current HTTP context.

Parameters

Name
Type
Description
services
IServiceProvider

Returns

Type
Description
IWorkflowTenant
>The tenant instance.
public static WorkflowRuntime GetHttpContextWorkflowRuntime(this IServiceProvider services) #
Gets the workflow runtime instance for the workflow tenant identified in the current HTTP context.

Parameters

Name
Type
Description
services
IServiceProvider

Returns

Type
Description
WorkflowRuntime
>The workflow runtime instance.