Skip to main content

Introducing Formengine - The New Formbuilder, try for FREE formengine.io.

Interface IWorkflowBuilder

Interface of a workflow builder, which convert not parsed process scheme OptimaJet.Workflow.Core.Model.SchemeDefinition%601 to the object model of a scheme of a process ProcessDefinition

Namespace: OptimaJet.Workflow.Core.Builder

Assembly: OptimaJet.Workflow.Core.dll

Syntax
public interface IWorkflowBuilder

Methods

CreateNewProcessAsync(Guid, string, IDictionary<string, object>, string)

Create new instance of the process.

Declaration
Task<ProcessInstance> CreateNewProcessAsync(Guid processId, string schemeCode, IDictionary<string, object> parameters, string tenantId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringschemeCodeCode of the scheme
IDictionary<string, object>parametersThe parameters for creating the scheme of the process
stringtenantIdTenant id
Returns
TypeDescription
Task<ProcessInstance>ProcessInstance object

CreateNewSubprocessAsync(Guid, ProcessInstance, TransitionDefinition)

Declaration
Task<ProcessInstance> CreateNewSubprocessAsync(Guid processId, ProcessInstance parentProcessInstance, TransitionDefinition startingTransition)
Parameters
TypeNameDescription
GuidprocessId
ProcessInstanceparentProcessInstance
TransitionDefinitionstartingTransition
Returns
TypeDescription
Task<ProcessInstance>

CreateNewProcessSchemeAsync(string, IDictionary<string, object>)

Create new scheme for existing process

Declaration
Task<ProcessDefinition> CreateNewProcessSchemeAsync(string schemeCode, IDictionary<string, object> parameters)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
IDictionary<string, object>parametersThe parameters for creating scheme of process
Returns
TypeDescription
Task<ProcessDefinition>ProcessDefinition object

CreateNewSubprocessSchemeAsync(ProcessDefinition, TransitionDefinition)

Declaration
Task<ProcessDefinition> CreateNewSubprocessSchemeAsync(ProcessDefinition parentProcessScheme, TransitionDefinition startingTransition)
Parameters
TypeNameDescription
ProcessDefinitionparentProcessScheme
TransitionDefinitionstartingTransition
Returns
TypeDescription
Task<ProcessDefinition>

GetProcessInstanceAsync(Guid)

Returns existing process instance

Declaration
Task<ProcessInstance> GetProcessInstanceAsync(Guid processId)
Parameters
TypeNameDescription
GuidprocessIdProcess id
Returns
TypeDescription
Task<ProcessInstance>ProcessInstance object

GetProcessSchemeAsync(Guid)

Returns process scheme by specific id, if scheme not exists creates it

Declaration
Task<ProcessDefinition> GetProcessSchemeAsync(Guid schemeId)
Parameters
TypeNameDescription
GuidschemeIdId of the scheme
Returns
TypeDescription
Task<ProcessDefinition>ProcessDefinition object

SetCache(IParsedProcessCache)

Sets the cache to store parsed ProcessDefinition objects ProcessDefinition

Declaration
void SetCache(IParsedProcessCache cache)
Parameters
TypeNameDescription
IParsedProcessCachecacheInstance of cache object

RemoveCache()

Removes the cache to store parsed ProcessDefinition objects ProcessDefinition

Declaration
void RemoveCache()

GetProcessSchemeAsync(string)

Returns process scheme by specific name, if scheme not exists creates it

Declaration
Task<ProcessDefinition> GetProcessSchemeAsync(string schemeCode)
Parameters
TypeNameDescription
stringschemeCodeName of the scheme
Returns
TypeDescription
Task<ProcessDefinition>ProcessDefinition object

GetProcessSchemeAsync(string, IDictionary<string, object>)

Returns process scheme by specific name and parameters for creating the scheme of the process, if scheme not exists creates it

Declaration
Task<ProcessDefinition> GetProcessSchemeAsync(string schemeCode, IDictionary<string, object> parameters)
Parameters
TypeNameDescription
stringschemeCodeName of the scheme
IDictionary<string, object>parametersThe parameters for creating the scheme of the process
Returns
TypeDescription
Task<ProcessDefinition>ProcessDefinition object

SetSchemeIsObsoleteAsync(string, Dictionary<string, object>)

Set IsObsolete sign to the scheme with specific name and parameters for creating the scheme of the process

Declaration
Task SetSchemeIsObsoleteAsync(string schemeCode, Dictionary<string, object> parameters)
Parameters
TypeNameDescription
stringschemeCodeName of the scheme
Dictionary<string, object>parametersThe parameters for creating the scheme of the process
Returns
TypeDescription
Task

SetSchemeIsObsoleteAsync(string)

Set IsObsolete sign to the scheme with specific name

Declaration
Task SetSchemeIsObsoleteAsync(string schemeCode)
Parameters
TypeNameDescription
stringschemeCodeName of the scheme
Returns
TypeDescription
Task

GetProcessSchemeForDesignerAsync(string)

Returns existing process scheme directly from scheme persistence store

Declaration
Task<ProcessDefinition> GetProcessSchemeForDesignerAsync(string code)
Parameters
TypeNameDescription
stringcodeName of the scheme
Returns
TypeDescription
Task<ProcessDefinition>ProcessDefinition object

SaveProcessSchemeAsync(string, ProcessDefinition)

Saves process scheme to scheme persistence store

Declaration
Task<(bool success, List<string> errors, string failedStep)> SaveProcessSchemeAsync(string schemeCode, ProcessDefinition pd)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
ProcessDefinitionpdObject representation of the scheme
Returns
TypeDescription
Task<(bool success, List<string> errors, string failedStep)>success - true if scheme validation was success,
errors - validation errors,
failedStep - the name of failed build step

Parse(string, SchemeParsingType)

Parses process scheme from the string

Declaration
ProcessDefinition Parse(string scheme, SchemeParsingType schemeParsingType = SchemeParsingType.Strict)
Parameters
TypeNameDescription
stringschemeString representation of not parsed scheme
SchemeParsingTypeschemeParsingTypeType of parsing strict or soft. Uses only for upload operations where we need softer scheme check
Returns
TypeDescription
ProcessDefinitionProcessDefinition object

Serialize(ProcessDefinition)

Serialize process scheme to the string

Declaration
string Serialize(ProcessDefinition processDefinition)
Parameters
TypeNameDescription
ProcessDefinitionprocessDefinitionSProcessDefinition object
Returns
TypeDescription
stringString representation of not parsed scheme

AddBuildStep(int, BuildStepPosition, BuildStep)

Adds a build step into workflow builder

Declaration
void AddBuildStep(int order, BuildStepPosition buildStepPosition, BuildStep step)
Parameters
TypeNameDescription
intorderOrder in position
BuildStepPositionbuildStepPositionIndicates whether the build step is added after the system steps or before the system steps.
BuildStepstepBuild step

AddSystemBuildStepAtTheEnd(BuildStep, int, int)

Adds a build step into workflow builder

Declaration
void AddSystemBuildStepAtTheEnd(BuildStep step, int startOrder = 0, int endOrder = 1000)
Parameters
TypeNameDescription
BuildStepstepBuild step
intstartOrderThe order from which the ordering begins
intendOrderThe order on which the ordering ends

AddBuildStepAtTheEnd(BuildStep)

Adds a build step after all build steps into workflow builder

Declaration
void AddBuildStepAtTheEnd(BuildStep step)
Parameters
TypeNameDescription
BuildStepstepBuild step

GenerateProcessDefinitionAsync(string, IDictionary<string, object>)

Generates new Process Definition, doesn't save it in a database, doesn't use cache, doesn't execute build steps

Declaration
Task<ProcessDefinition> GenerateProcessDefinitionAsync(string schemeCode, IDictionary<string, object> parameters)
Parameters
TypeNameDescription
stringschemeCodeName of the scheme
IDictionary<string, object>parametersThe parameters for creating the scheme of the process
Returns
TypeDescription
Task<ProcessDefinition>Generated process definition

ContainsBuildStep(string)

Returns true if the builder contains a build step with the name

Declaration
bool ContainsBuildStep(string name)
Parameters
TypeNameDescription
stringnameName of build step
Returns
TypeDescription
bool

GetInlinedSchemeCodesAsync()

Returns the list of scheme codes that can be inlined into other schemes

Declaration
Task<List<string>> GetInlinedSchemeCodesAsync()
Returns
TypeDescription
Task<List<string>>The list of scheme codes

GetInlinedSchemeParametersAsync()

Returns the dictionary of inlined scheme parameters

Declaration
Task<Dictionary<string, ParameterDefinition[]>> GetInlinedSchemeParametersAsync()
Returns
TypeDescription
Task<Dictionary<string, ParameterDefinition[]>>The dictionary of inlined scheme parameters

GetRelatedByInliningSchemeCodesAsync(string)

Returns the list of scheme codes into which the scheme with the given code has been inlined

Declaration
Task<List<string>> GetRelatedByInliningSchemeCodesAsync(string schemeCode)
Parameters
TypeNameDescription
stringschemeCodeInlined scheme code
Returns
TypeDescription
Task<List<string>>The list of scheme codes into which the scheme with the given code has been inlined

RemoveSchemeTagsAsync(string, IEnumerable<string>)

Remove tags from scheme with the given schemeCode

Declaration
Task RemoveSchemeTagsAsync(string schemeCode, IEnumerable<string> tags)
Parameters
TypeNameDescription
stringschemeCode
IEnumerable<string>tags
Returns
TypeDescription
Task

SetSchemeTagsAsync(string, IEnumerable<string>)

Set tags to scheme with the given schemeCode

Declaration
Task SetSchemeTagsAsync(string schemeCode, IEnumerable<string> tags)
Parameters
TypeNameDescription
stringschemeCode
IEnumerable<string>tags
Returns
TypeDescription
Task

SearchSchemesByTagsAsync(IEnumerable<string>)

Returns the list of scheme codes into which the scheme with the given tags

Declaration
Task<List<string>> SearchSchemesByTagsAsync(IEnumerable<string> tags)
Parameters
TypeNameDescription
IEnumerable<string>tags
Returns
TypeDescription
Task<List<string>>

AddSchemeTagsAsync(string, IEnumerable<string>)

Add tags to scheme with the given schemeCode

Declaration
Task AddSchemeTagsAsync(string schemeCode, IEnumerable<string> tags)
Parameters
TypeNameDescription
stringschemeCode
IEnumerable<string>tags
Returns
TypeDescription
Task

GetInlineSchemesAsync(ProcessDefinition)

Get the list of inlined schemes for a given scheme

Declaration
Task<(List<string> codes, List<string> errors, string failedStep)> GetInlineSchemesAsync(ProcessDefinition pd)
Parameters
TypeNameDescription
ProcessDefinitionpdObject representation of the scheme
Returns
TypeDescription
Task<(List<string> codes, List<string> errors, string failedStep)>codes - list of inlined scheme codes,
errors - validation errors,
failedStep - the name of failed build step

UpsertProcessInstanceScheme(ProcessDefinition)

Saves scheme directly in WorkflowProcessScheme

Declaration
Task UpsertProcessInstanceScheme(ProcessDefinition processDefinition)
Parameters
TypeNameDescription
ProcessDefinitionprocessDefinitionProcess definition to save
Returns
TypeDescription
Task

RemoveSchemeFromCache(Guid)

Remove scheme from scheme cache if the cache is exists

Declaration
void RemoveSchemeFromCache(Guid schemeId)
Parameters
TypeNameDescription
GuidschemeId

Extension Methods