Class Extensions
OptimaJet.Workflow.Api.Extensions
This class contains extensions for configuring Workflow Engine Api services and connecting ASP.NET middleware.
Namespace: OptimaJet.Workflow.Api
public static class ExtensionsInheritance
- 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
setupActionAction<WorkflowApiCoreOptions>A delegate to configure the core Workflow Engine Api options.
Returns
Type
Description
IServiceCollectionA 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
setupActionAction<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
IServiceCollectionA 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
optionsWorkflowTenantCreationOptions[]An array of options for creating the tenants.
Returns
Type
Description
IServiceCollectionA 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
optionsIEnumerable<WorkflowTenantCreationOptions>An enumerable of options for creating the tenants.
Returns
Type
Description
IServiceCollectionA 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
setupActionAction<WorkflowApiSecurityOptions>A delegate to configure the security options for Workflow Engine Api.
Returns
Type
Description
IServiceCollectionA 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
Returns
Type
Description
IEndpointRouteBuilderA 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
servicesIServiceProviderReturns
Type
Description
IWorkflowTenantSnapshotThe 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
Returns
Type
Description
StringThe tenant id.
public static IWorkflowTenant GetHttpContextWorkflowTenant(this IServiceProvider services) #Gets the workflow tenant instance from the current HTTP context.
Parameters
Name
Type
Description
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
Returns
Type
Description
WorkflowRuntime>The workflow runtime instance.