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
Namespace: OptimaJet.Workflow.Core.Builder
public interface IWorkflowBuilderProperties
Methods
Task<ProcessInstance> CreateNewProcessAsync(Guid processId, string schemeCode, string? tenantId) #Create a new instance of the process.
Parameters
Name
Type
Description
processIdGuidProcess id
schemeCodeStringCode of the scheme
tenantIdStringTenant id of the scheme
Returns
Type
Description
Task<ProcessInstance>ProcessInstance object
Task<ProcessInstance> CreateNewSubprocessAsync(Guid processId, ProcessInstance parentProcessInstance, TransitionDefinition startingTransition) #Parameters
Name
Type
Description
processIdGuidparentProcessInstanceProcessInstancestartingTransitionTransitionDefinitionReturns
Type
Description
Task<ProcessInstance>Task<ProcessDefinition> CreateNewProcessSchemeAsync(string schemeCode, string? tenantId = null) #Create a new scheme for an existing process
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme
tenantIdStringTenant id of the scheme
Returns
Type
Description
Task<ProcessDefinition>ProcessDefinition object
Task<ProcessDefinition> CreateNewSubprocessSchemeAsync(ProcessDefinition parentProcessScheme, TransitionDefinition startingTransition) #Parameters
Name
Type
Description
parentProcessSchemeProcessDefinitionstartingTransitionTransitionDefinitionReturns
Type
Description
Task<ProcessDefinition>Task<ProcessInstance> GetProcessInstanceAsync(Guid processId) #Returns existing process instance
Parameters
Name
Type
Description
processIdGuidProcess 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
schemeIdGuidId 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
cacheIParsedProcessCacheInstance 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
schemeCodeStringName of the scheme
tenantIdStringTenant 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
schemeCodeStringName 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) #Returns existing process scheme directly from scheme persistence store
Parameters
Name
Type
Description
codeStringName of the scheme
tenantIdStringTenant 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
schemeCodeStringCode of the scheme
pdProcessDefinitionObject 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
schemeStringString representation of not parsed scheme
schemeParsingTypeSchemeParsingTypeType of parsing strict or soft. Uses only for upload operations where we need softer scheme check
Returns
Type
Description
ProcessDefinitionProcessDefinition object
string Serialize(ProcessDefinition processDefinition) #Serialize process scheme to the string
Parameters
Name
Type
Description
processDefinitionProcessDefinitionSProcessDefinition object
Returns
Type
Description
StringString representation of not parsed scheme
void AddBuildStep(int order, BuildStepPosition buildStepPosition, BuildStep step) #Adds a build step into workflow builder
Parameters
Name
Type
Description
orderInt32Order in position
buildStepPositionBuildStepPositionIndicates whether the build step is added after the system steps or before the system steps.
stepBuildStepBuild step
void AddSystemBuildStepAtTheEnd(BuildStep step, int startOrder = 0, int endOrder = 1000) #Adds a build step into workflow builder
Parameters
Name
Type
Description
stepBuildStepBuild step
startOrderInt32The order from which the ordering begins
endOrderInt32The 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
stepBuildStepBuild 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
schemeCodeStringName of the scheme
tenantIdStringTenant 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
nameStringName of build step
Returns
Type
Description
BooleanTask<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
tenantIdStringTenant 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
tenantIdStringTenant id of the scheme
Returns
Type
Description
Task<ParameterDefinition[]>The dictionary of inlined scheme parameters
Task RemoveSchemeTagsAsync(string schemeCode, IEnumerable<string> tags) #Removes tags from the shared scheme with the given schemeCode.
Parameters
Name
Type
Description
schemeCodeStringtagsIEnumerable<String>Returns
Type
Description
TaskTask 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
schemeCodeStringtenantIdStringtagsIEnumerable<String>Returns
Type
Description
TaskTask SetSchemeTagsAsync(string schemeCode, IEnumerable<string> tags) #Sets tags on the shared scheme with the given schemeCode.
Parameters
Name
Type
Description
schemeCodeStringtagsIEnumerable<String>Returns
Type
Description
TaskTask 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
schemeCodeStringtenantIdStringtagsIEnumerable<String>Returns
Type
Description
TaskTask<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
tagsIEnumerable<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
tenantIdStringtagsIEnumerable<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
schemeCodeStringtagsIEnumerable<String>Returns
Type
Description
TaskTask 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
schemeCodeStringtenantIdStringtagsIEnumerable<String>Returns
Type
Description
TaskTask<(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
pdProcessDefinitionObject 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
processDefinitionProcessDefinitionProcess 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
schemeIdGuid