Interface IWorkflowBuilder
OptimaJet.Workflow.Core.Builder.IWorkflowBuilder
Converts raw process scheme media into ProcessDefinition instances and coordinates scheme loading, parsing, generation, and build-step execution.
Namespace: OptimaJet.Workflow.Core.Builder
public interface IWorkflowBuilderType Hierarchy
- IWorkflowBuilder Current type
- Implementing types
Properties
WorkflowRuntime Runtime { get; set; } #Gets or sets the runtime used by this builder.
Methods
Task<ProcessInstance> CreateNewProcessAsync(Guid processId, string schemeCode, string? tenantId) #Creates a new process instance object for the specified scheme code. If the scheme does not exist, the builder generates and stores it before creating the instance.
Parameters
Name
Type
Description
processIdGuidIdentifier for the new process instance.
schemeCodeStringCode of the scheme to instantiate.
tenantIdStringOptional tenant identifier that selects the exact tenant scheme. If not specified, a shared scheme is used.
Returns
Type
Description
Task<ProcessInstance>A new ProcessInstance.
Task<ProcessInstance> CreateNewSubprocessAsync(Guid processId, ProcessInstance parentProcessInstance, TransitionDefinition startingTransition) #Creates a subprocess process instance for the transition from a parent process.
Parameters
Name
Type
Description
processIdGuidIdentifier for the new subprocess instance.
Returns
Type
Description
Task<ProcessInstance>A new subprocess ProcessInstance.
Task<ProcessDefinition> CreateNewProcessSchemeAsync(string schemeCode, string? tenantId = null) #Generates a new process scheme, runs the registered build steps, and stores the resulting scheme.
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme to create.
tenantIdStringOptional tenant identifier. If not specified, a shared scheme is used.
Returns
Type
Description
Task<ProcessDefinition>The generated ProcessDefinition.
Task<ProcessDefinition> CreateNewSubprocessSchemeAsync(ProcessDefinition parentProcessScheme, TransitionDefinition startingTransition) #Creates and stores a parsed subprocess scheme for the given parent scheme and transition.
Parameters
Name
Type
Description
parentProcessSchemeProcessDefinitionThe parent ProcessDefinition from which the subprocess is derived.
Returns
Type
Description
Task<ProcessDefinition>The parsed subprocess ProcessDefinition.
Task<ProcessInstance> GetProcessInstanceAsync(Guid processId) #Gets an existing process instance by process identifier.
Parameters
Name
Type
Description
processIdGuidIdentifier of the process instance to load.
Returns
Type
Description
Task<ProcessInstance>The loaded ProcessInstance.
Task<ProcessDefinition> GetProcessSchemeAsync(Guid schemeId) #Gets a parsed process scheme by scheme identifier.
Parameters
Name
Type
Description
schemeIdGuidIdentifier of the scheme to load.
Returns
Type
Description
Task<ProcessDefinition>The loaded ProcessDefinition.
void SetCache(IParsedProcessCache cache) #Configures a cache for parsed ProcessDefinition instances.
Parameters
Name
Type
Description
void RemoveCache() #Clears and disables the parsed process definition cache.
Task<ProcessDefinition> GetProcessSchemeAsync(string schemeCode, string? tenantId = null) #Gets a process scheme by code and tenant, creating it if it does not exist.
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme.
tenantIdStringOptional tenant identifier. If not specified, a shared scheme is used.
Returns
Type
Description
Task<ProcessDefinition>The requested ProcessDefinition. If missing, a new scheme is generated, stored, and returned.
Task SetSchemeIsObsoleteAsync(string schemeCode, string? tenantId = null) #Marks schemes with the specified code as obsolete.
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme.
tenantIdStringTenant id of the scheme. If null, marks schemes with the specified code obsolete in all tenants.
Returns
Type
Description
TaskTask<ProcessDefinition> GetProcessSchemeForDesignerAsync(string code, string? tenantId = null) #Gets a parsed process scheme from the persistence store by code for designer operations.
Parameters
Name
Type
Description
codeStringCode of the scheme.
tenantIdStringOptional tenant identifier.
Returns
Type
Description
Task<ProcessDefinition>The loaded ProcessDefinition.
Task<(bool success, List<string>? errors, string? failedStep)> SaveProcessSchemeAsync(string schemeCode, ProcessDefinition pd) #Runs the registered build steps on a clone of the process definition to validate it and determine its inline scheme dependencies, then saves the supplied definition when validation succeeds.
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme.
Returns
Type
Description
Task<Boolean, String, String>A tuple containing:
success is true when validation succeeds; errors contains validation messages when validation fails; failedStep contains the name of the build step that failed, if any.ProcessDefinition Parse(string scheme, SchemeParsingType schemeParsingType = SchemeParsingType.Strict) #Parses a raw scheme string into a ProcessDefinition.
Parameters
Name
Type
Description
schemeStringRaw scheme content to parse.
schemeParsingTypeSchemeParsingTypeParse mode. Use SchemeParsingType.Soft only for relaxed validation.
Returns
Type
Description
ProcessDefinitionThe parsed ProcessDefinition.
string Serialize(ProcessDefinition processDefinition) #Serializes a process definition into raw scheme text.
Parameters
Name
Type
Description
Returns
Type
Description
StringString representation of the unparsed scheme.
void AddBuildStep(int order, BuildStepPosition buildStepPosition, BuildStep step) #Adds a build step at the specified position and order.
Parameters
Name
Type
Description
orderInt32Order value used to sort build-step execution.
void AddSystemBuildStepAtTheEnd(BuildStep step, int startOrder = 0, int endOrder = 1000) #Adds a system build step after the highest existing system step in the specified search range.
Parameters
Name
Type
Description
startOrderInt32The order used when the search range contains no existing system steps.
endOrderInt32The exclusive upper bound of the range searched for existing system steps.
void AddBuildStepAtTheEnd(BuildStep step) #Adds a build step after all existing build steps.
Parameters
Name
Type
Description
Task<ProcessDefinition> GenerateProcessDefinitionAsync(string schemeCode, string? tenantId = null) #Generates and parses a process definition without reading or writing persistence, using the cache, or executing build steps.
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme to generate.
tenantIdStringOptional tenant identifier.
Returns
Type
Description
Task<ProcessDefinition>The generated ProcessDefinition.
bool ContainsBuildStep(string name) #Determines whether a build step with the specified name is already registered.
Parameters
Name
Type
Description
nameStringName of the build step to check.
Returns
Type
Description
Booleantrue when a build step with this name exists.
Task<List<string>> GetInlinedSchemeCodesAsync(string? tenantId = null) #Gets codes of schemes that may be inlined by other schemes.
Parameters
Name
Type
Description
tenantIdStringOptional tenant identifier. If specified, both shared and tenant-specific schemes are returned. If omitted, only shared schemes are returned.
Returns
Type
Description
Task<String>The list of scheme codes.
Task<Dictionary<string, ParameterDefinition[]>> GetInlinedSchemeParametersAsync(string? tenantId = null) #Gets inlined scheme parameters by scheme code.
Parameters
Name
Type
Description
tenantIdStringOptional tenant identifier. If specified, both shared and tenant-specific schemes are resolved. If omitted, only shared schemes are included.
Returns
Type
Description
Task<String, ParameterDefinition[]>A dictionary keyed by scheme code containing non-system parameters for each inlined scheme.
Task RemoveSchemeTagsAsync(string schemeCode, IEnumerable<string> tags) #Removes tags from the shared scheme with the specified code.
Parameters
Name
Type
Description
schemeCodeStringCode of the shared scheme.
tagsIEnumerable<String>Tags to remove.
Returns
Type
Description
TaskTask RemoveSchemeTagsAsync(string schemeCode, string? tenantId, IEnumerable<string> tags) #Removes tags from a scheme in the exact tenant scope. If tenantId is null, updates only the shared scheme.
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme.
tenantIdStringTenant identifier or
null for shared scope.tagsIEnumerable<String>Tags to remove.
Returns
Type
Description
TaskTask SetSchemeTagsAsync(string schemeCode, IEnumerable<string> tags) #Replaces tags for the shared scheme with the specified code.
Parameters
Name
Type
Description
schemeCodeStringCode of the shared scheme.
tagsIEnumerable<String>Tags to set.
Returns
Type
Description
TaskTask SetSchemeTagsAsync(string schemeCode, string? tenantId, IEnumerable<string> tags) #Replaces tags for a scheme in the exact tenant scope. If tenantId is null, updates only the shared scheme.
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme.
tenantIdStringTenant identifier or
null for shared scope.tagsIEnumerable<String>Tags to set.
Returns
Type
Description
TaskTask<List<string>> SearchSchemesByTagsAsync(IEnumerable<string>? tags) #Gets shared scheme codes matching a tag list.
Parameters
Name
Type
Description
tagsIEnumerable<String>Optional tags to filter schemes. If
null, returns all shared scheme codes.Returns
Type
Description
Task<String>Codes of matching shared schemes.
Task<List<string>> SearchSchemesByTagsAsync(string? tenantId, IEnumerable<string>? tags) #Gets scheme codes in a tenant scope matching a tag list.
Parameters
Name
Type
Description
tenantIdStringTenant identifier. If
null, only shared schemes are searched.tagsIEnumerable<String>Optional tags to filter schemes. If
null, all codes in scope are returned.Returns
Type
Description
Task<String>Codes of matching schemes in the specified scope.
Task AddSchemeTagsAsync(string schemeCode, IEnumerable<string> tags) #Adds tags to the shared scheme with the specified code.
Parameters
Name
Type
Description
schemeCodeStringCode of the shared scheme.
tagsIEnumerable<String>Tags to add.
Returns
Type
Description
TaskTask AddSchemeTagsAsync(string schemeCode, string? tenantId, IEnumerable<string> tags) #Adds tags to a scheme in the exact tenant scope. If tenantId is null, updates only the shared scheme.
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme.
tenantIdStringTenant identifier or
null for shared scope.tagsIEnumerable<String>Tags to add.
Returns
Type
Description
TaskTask<(List<string>? codes, List<string>? errors, string? failedStep)> GetInlineSchemesAsync(ProcessDefinition pd) #Runs the registered build steps on a clone of the process definition and gets the codes represented by the resulting inlined activities.
Parameters
Name
Type
Description
Returns
Type
Description
Task<String, String, String>A tuple containing:
codes list of inlined scheme codes, errors validation errors when build steps fail, and failedStep the failing build step name.[Obsolete("Do not use this API. It was used only by the deprecated Assignment plugin and will be removed soon.")] Task UpsertProcessInstanceScheme(ProcessDefinition processDefinition) Obsolete #Executes build steps and upserts the parsed scheme into the persistence store.
Parameters
Name
Type
Description
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) Obsolete #Removes a parsed process definition from the cache by scheme identifier.
Parameters
Name
Type
Description
schemeIdGuidIdentifier of the scheme cache entry to remove.