Workflow Engine .NET

Assembly: OptimaJet.Workflow.Core

Interface IWorkflowBuilder

OptimaJet.Workflow.Core.Builder.IWorkflowBuilder

Interface of a workflow builder, which convert not parsed process scheme SchemeDefinition<T> to the object model of a scheme of a process ProcessDefinition

public interface IWorkflowBuilder

Properties

Name
Type
Runtime #
WorkflowRuntime
Workflow runtime instance WorkflowRuntime

Methods

Task<ProcessInstance> CreateNewProcessAsync(Guid processId, string schemeCode, string? tenantId) #
Create a new instance of the process.

Parameters

Name
Type
Description
processId
Guid
Process id
schemeCode
String
Code of the scheme
tenantId
String
Tenant id of the scheme

Returns

Type
Description
Task<ProcessInstance>
ProcessInstance object
Task<ProcessInstance> CreateNewSubprocessAsync(Guid processId, ProcessInstance parentProcessInstance, TransitionDefinition startingTransition) #

Parameters

Name
Type
Description
processId
Guid
parentProcessInstance
ProcessInstance
startingTransition
TransitionDefinition

Returns

Type
Description
Task<ProcessInstance>
Task<ProcessDefinition> CreateNewProcessSchemeAsync(string schemeCode, string? tenantId = null) #
Create a new scheme for an existing process

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme
tenantId
String
Tenant id of the scheme

Returns

Type
Description
Task<ProcessDefinition>
ProcessDefinition object
Task<ProcessDefinition> CreateNewSubprocessSchemeAsync(ProcessDefinition parentProcessScheme, TransitionDefinition startingTransition) #

Parameters

Name
Type
Description
parentProcessScheme
ProcessDefinition
startingTransition
TransitionDefinition

Returns

Type
Description
Task<ProcessDefinition>
Task<ProcessInstance> GetProcessInstanceAsync(Guid processId) #
Returns existing process instance

Parameters

Name
Type
Description
processId
Guid
Process id

Returns

Type
Description
Task<ProcessInstance>
ProcessInstance object
Task<ProcessDefinition> GetProcessSchemeAsync(Guid schemeId) #
Returns process scheme by specific id, if scheme not exists creates it

Parameters

Name
Type
Description
schemeId
Guid
Id of the scheme

Returns

Type
Description
Task<ProcessDefinition>
ProcessDefinition object
void SetCache(IParsedProcessCache cache) #
Sets the cache to store parsed ProcessDefinition objects ProcessDefinition

Parameters

Name
Type
Description
cache
IParsedProcessCache
Instance of cache object
void RemoveCache() #
Removes the cache to store parsed ProcessDefinition objects ProcessDefinition
Task<ProcessDefinition> GetProcessSchemeAsync(string schemeCode, string? tenantId = null) #
Returns process scheme by specific name, if scheme not exists creates it

Parameters

Name
Type
Description
schemeCode
String
Name of the scheme
tenantId
String
Tenant id of the scheme

Returns

Type
Description
Task<ProcessDefinition>
ProcessDefinition object
Task SetSchemeIsObsoleteAsync(string schemeCode, string? tenantId = null) #
Set IsObsolete sign to the scheme with specific name

Parameters

Name
Type
Description
schemeCode
String
Name of the scheme
tenantId
String
Tenant id of the scheme. If null, marks schemes with the specified code obsolete in all tenants.

Returns

Type
Description
Task
Task<ProcessDefinition> GetProcessSchemeForDesignerAsync(string code, string? tenantId = null) #
Returns existing process scheme directly from scheme persistence store

Parameters

Name
Type
Description
code
String
Name of the scheme
tenantId
String
Tenant id of the scheme

Returns

Type
Description
Task<ProcessDefinition>
ProcessDefinition object
Task<(bool success, List<string>? errors, string? failedStep)> SaveProcessSchemeAsync(string schemeCode, ProcessDefinition pd) #
Saves process scheme to scheme persistence store

Parameters

Name
Type
Description
schemeCode
String
Code of the scheme
pd
ProcessDefinition
Object representation of the scheme

Returns

Type
Description
Task<String>
success - true if scheme validation was success, errors - validation errors, failedStep - the name of failed build step
ProcessDefinition Parse(string scheme, SchemeParsingType schemeParsingType = SchemeParsingType.Strict) #
Parses process scheme from the string

Parameters

Name
Type
Description
scheme
String
String representation of not parsed scheme
schemeParsingType
SchemeParsingType
Type of parsing strict or soft. Uses only for upload operations where we need softer scheme check

Returns

Type
Description
ProcessDefinition
ProcessDefinition object
string Serialize(ProcessDefinition processDefinition) #
Serialize process scheme to the string

Parameters

Name
Type
Description
processDefinition
ProcessDefinition
SProcessDefinition object

Returns

Type
Description
String
String representation of not parsed scheme
void AddBuildStep(int order, BuildStepPosition buildStepPosition, BuildStep step) #
Adds a build step into workflow builder

Parameters

Name
Type
Description
order
Int32
Order in position
buildStepPosition
BuildStepPosition
Indicates whether the build step is added after the system steps or before the system steps.
step
BuildStep
Build step
void AddSystemBuildStepAtTheEnd(BuildStep step, int startOrder = 0, int endOrder = 1000) #
Adds a build step into workflow builder

Parameters

Name
Type
Description
step
BuildStep
Build step
startOrder
Int32
The order from which the ordering begins
endOrder
Int32
The order on which the ordering ends
void AddBuildStepAtTheEnd(BuildStep step) #
Adds a build step after all build steps into workflow builder

Parameters

Name
Type
Description
step
BuildStep
Build step
Task<ProcessDefinition> GenerateProcessDefinitionAsync(string schemeCode, string? tenantId = null) #
Generates new Process Definition, doesn't save it in a database, doesn't use cache, doesn't execute build steps

Parameters

Name
Type
Description
schemeCode
String
Name of the scheme
tenantId
String
Tenant id of the scheme

Returns

Type
Description
Task<ProcessDefinition>
Generated process definition
bool ContainsBuildStep(string name) #
Returns true if the builder contains a build step with the name

Parameters

Name
Type
Description
name
String
Name of build step

Returns

Type
Description
Boolean
Task<List<string>> GetInlinedSchemeCodesAsync(string? tenantId = null) #
Returns the list of scheme codes that can be inlined into other schemes. If tenantId is null, returns only shared schemes. If tenantId is specified, returns shared and tenant-specific schemes with distinct codes.

Parameters

Name
Type
Description
tenantId
String
Tenant id of the scheme

Returns

Type
Description
Task<String>
The list of scheme codes
Task<Dictionary<string, ParameterDefinition[]>> GetInlinedSchemeParametersAsync(string? tenantId = null) #
Returns the dictionary of inlined scheme parameters. If tenantId is null, returns parameters only for shared schemes. If tenantId is specified, resolves parameters for shared and tenant-specific schemes with distinct codes.

Parameters

Name
Type
Description
tenantId
String
Tenant id of the scheme

Returns

Type
Description
Task<ParameterDefinition[]>
The dictionary of inlined scheme parameters
Task<List<string>> GetRelatedByInliningSchemeCodesAsync(string schemeCode, string? tenantId = null) #
Returns the list of scheme codes into which the scheme with the given code has been inlined

Parameters

Name
Type
Description
schemeCode
String
Inlined scheme code
tenantId
String
Tenant id of the parent scheme. If null, searches in all tenants and shared schemes.

Returns

Type
Description
Task<String>
The list of scheme codes into which the scheme with the given code has been inlined
Task RemoveSchemeTagsAsync(string schemeCode, IEnumerable<string> tags) #
Removes tags from the shared scheme with the given schemeCode.

Parameters

Name
Type
Description
schemeCode
String
tags
IEnumerable<String>

Returns

Type
Description
Task
Task RemoveSchemeTagsAsync(string schemeCode, string? tenantId, IEnumerable<string> tags) #
Removes tags from the scheme with the given schemeCode in the exact tenant scope. If tenantId is null, updates only the shared scheme.

Parameters

Name
Type
Description
schemeCode
String
tenantId
String
tags
IEnumerable<String>

Returns

Type
Description
Task
Task SetSchemeTagsAsync(string schemeCode, IEnumerable<string> tags) #
Sets tags on the shared scheme with the given schemeCode.

Parameters

Name
Type
Description
schemeCode
String
tags
IEnumerable<String>

Returns

Type
Description
Task
Task SetSchemeTagsAsync(string schemeCode, string? tenantId, IEnumerable<string> tags) #
Sets tags on the scheme with the given schemeCode in the exact tenant scope. If tenantId is null, updates only the shared scheme.

Parameters

Name
Type
Description
schemeCode
String
tenantId
String
tags
IEnumerable<String>

Returns

Type
Description
Task
Task<List<string>> SearchSchemesByTagsAsync(IEnumerable<string>? tags) #
Returns the list of shared scheme codes with the given tags. If tags are null, returns all shared scheme codes.

Parameters

Name
Type
Description
tags
IEnumerable<String>

Returns

Type
Description
Task<String>
Task<List<string>> SearchSchemesByTagsAsync(string? tenantId, IEnumerable<string>? tags) #
Returns the list of scheme codes with the given tags in the exact tenant scope. If tags are null, returns all scheme codes in the specified tenant scope. If tenantId is null, searches only in shared schemes.

Parameters

Name
Type
Description
tenantId
String
tags
IEnumerable<String>

Returns

Type
Description
Task<String>
Task AddSchemeTagsAsync(string schemeCode, IEnumerable<string> tags) #
Adds tags to the shared scheme with the given schemeCode.

Parameters

Name
Type
Description
schemeCode
String
tags
IEnumerable<String>

Returns

Type
Description
Task
Task AddSchemeTagsAsync(string schemeCode, string? tenantId, IEnumerable<string> tags) #
Adds tags to the scheme with the given schemeCode in the exact tenant scope. If tenantId is null, updates only the shared scheme.

Parameters

Name
Type
Description
schemeCode
String
tenantId
String
tags
IEnumerable<String>

Returns

Type
Description
Task
Task<(List<string>? codes, List<string>? errors, string? failedStep)> GetInlineSchemesAsync(ProcessDefinition pd) #
Get the list of inlined schemes for a given scheme

Parameters

Name
Type
Description
pd
ProcessDefinition
Object representation of the scheme

Returns

Type
Description
Task<String>
codes - list of inlined scheme codes, errors - validation errors, failedStep - the name of failed build step
[Obsolete("Do not use this API. It was used only by the deprecated Assignment plugin and will be removed soon.")] Task UpsertProcessInstanceScheme(ProcessDefinition processDefinition) #
Saves scheme directly in WorkflowProcessScheme

Parameters

Name
Type
Description
processDefinition
ProcessDefinition
Process definition to save

Returns

Type
Description
Task
[Obsolete("Do not use this API. It was used only by the deprecated Assignment plugin and will be removed soon.")] void RemoveSchemeFromCache(Guid schemeId) #
Remove scheme from scheme cache if the cache is exists

Parameters

Name
Type
Description
schemeId
Guid

Derived Types