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
Type | Name | Description |
---|
Guid | processId | Process id |
string | schemeCode | Code of the scheme |
IDictionary<string, object> | parameters | The parameters for creating the scheme of the process |
string | tenantId | Tenant id |
Returns
Type | Description |
---|
Task<ProcessInstance> | ProcessInstance object |
CreateNewSubprocessAsync(Guid, ProcessInstance, TransitionDefinition)
Declaration
Task<ProcessInstance> CreateNewSubprocessAsync(Guid processId, ProcessInstance parentProcessInstance, TransitionDefinition startingTransition)
Parameters
Type | Name | Description |
---|
Guid | processId | |
ProcessInstance | parentProcessInstance | |
TransitionDefinition | startingTransition | |
Returns
Type | Description |
---|
Task<ProcessInstance> | |
CreateNewProcessSchemeAsync(string, IDictionary<string, object>)
Create new scheme for existing process
Declaration
Task<ProcessDefinition> CreateNewProcessSchemeAsync(string schemeCode, IDictionary<string, object> parameters)
Parameters
Type | Name | Description |
---|
string | schemeCode | Code of the scheme |
IDictionary<string, object> | parameters | The parameters for creating scheme of process |
Returns
Type | Description |
---|
Task<ProcessDefinition> | ProcessDefinition object |
CreateNewSubprocessSchemeAsync(ProcessDefinition, TransitionDefinition)
Declaration
Task<ProcessDefinition> CreateNewSubprocessSchemeAsync(ProcessDefinition parentProcessScheme, TransitionDefinition startingTransition)
Parameters
Type | Name | Description |
---|
ProcessDefinition | parentProcessScheme | |
TransitionDefinition | startingTransition | |
Returns
Type | Description |
---|
Task<ProcessDefinition> | |
GetProcessInstanceAsync(Guid)
Returns existing process instance
Declaration
Task<ProcessInstance> GetProcessInstanceAsync(Guid processId)
Parameters
Type | Name | Description |
---|
Guid | processId | Process id |
Returns
Type | Description |
---|
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
Type | Name | Description |
---|
Guid | schemeId | Id of the scheme |
Returns
Type | Description |
---|
Task<ProcessDefinition> | ProcessDefinition object |
SetCache(IParsedProcessCache)
Sets the cache to store parsed ProcessDefinition objects ProcessDefinition
Declaration
void SetCache(IParsedProcessCache cache)
Parameters
Type | Name | Description |
---|
IParsedProcessCache | cache | Instance of cache object |
RemoveCache()
Removes the cache to store parsed ProcessDefinition objects ProcessDefinition
Declaration
GetProcessSchemeAsync(string)
Returns process scheme by specific name, if scheme not exists creates it
Declaration
Task<ProcessDefinition> GetProcessSchemeAsync(string schemeCode)
Parameters
Type | Name | Description |
---|
string | schemeCode | Name of the scheme |
Returns
Type | Description |
---|
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
Type | Name | Description |
---|
string | schemeCode | Name of the scheme |
IDictionary<string, object> | parameters | The parameters for creating the scheme of the process |
Returns
Type | Description |
---|
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
Type | Name | Description |
---|
string | schemeCode | Name of the scheme |
Dictionary<string, object> | parameters | The parameters for creating the scheme of the process |
Returns
SetSchemeIsObsoleteAsync(string)
Set IsObsolete sign to the scheme with specific name
Declaration
Task SetSchemeIsObsoleteAsync(string schemeCode)
Parameters
Type | Name | Description |
---|
string | schemeCode | Name of the scheme |
Returns
GetProcessSchemeForDesignerAsync(string)
Returns existing process scheme directly from scheme persistence store
Declaration
Task<ProcessDefinition> GetProcessSchemeForDesignerAsync(string code)
Parameters
Type | Name | Description |
---|
string | code | Name of the scheme |
Returns
Type | Description |
---|
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
Type | Name | Description |
---|
string | schemeCode | Code of the scheme |
ProcessDefinition | pd | Object representation of the scheme |
Returns
Type | Description |
---|
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
Type | Name | Description |
---|
string | scheme | 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 |
Serialize(ProcessDefinition)
Serialize process scheme to the string
Declaration
string Serialize(ProcessDefinition processDefinition)
Parameters
Type | Name | Description |
---|
ProcessDefinition | processDefinition | SProcessDefinition object |
Returns
Type | Description |
---|
string | String 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
Type | Name | Description |
---|
int | order | Order in position |
BuildStepPosition | buildStepPosition | Indicates whether the build step is added after the system steps or before the system steps. |
BuildStep | step | Build step |
AddSystemBuildStepAtTheEnd(BuildStep, int, int)
Adds a build step into workflow builder
Declaration
void AddSystemBuildStepAtTheEnd(BuildStep step, int startOrder = 0, int endOrder = 1000)
Parameters
Type | Name | Description |
---|
BuildStep | step | Build step |
int | startOrder | The order from which the ordering begins |
int | endOrder | The 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
Type | Name | Description |
---|
BuildStep | step | Build 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
Type | Name | Description |
---|
string | schemeCode | Name of the scheme |
IDictionary<string, object> | parameters | The parameters for creating the scheme of the process |
Returns
Type | Description |
---|
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
Type | Name | Description |
---|
string | name | Name of build step |
Returns
GetInlinedSchemeCodesAsync()
Returns the list of scheme codes that can be inlined into other schemes
Declaration
Task<List<string>> GetInlinedSchemeCodesAsync()
Returns
Type | Description |
---|
Task<List<string>> | The list of scheme codes |
GetInlinedSchemeParametersAsync()
Returns the dictionary of inlined scheme parameters
Declaration
Task<Dictionary<string, ParameterDefinition[]>> GetInlinedSchemeParametersAsync()
Returns
Type | Description |
---|
Task<Dictionary<string, ParameterDefinition[]>> | The dictionary of inlined scheme parameters |
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
Type | Name | Description |
---|
string | schemeCode | Inlined scheme code |
Returns
Type | Description |
---|
Task<List<string>> | The list of scheme codes into which the scheme with the given code has been inlined |
Remove tags from scheme with the given schemeCode
Declaration
Task RemoveSchemeTagsAsync(string schemeCode, IEnumerable<string> tags)
Parameters
Type | Name | Description |
---|
string | schemeCode | |
IEnumerable<string> | tags | |
Returns
Set tags to scheme with the given schemeCode
Declaration
Task SetSchemeTagsAsync(string schemeCode, IEnumerable<string> tags)
Parameters
Type | Name | Description |
---|
string | schemeCode | |
IEnumerable<string> | tags | |
Returns
Returns the list of scheme codes into which the scheme with the given tags
Declaration
Task<List<string>> SearchSchemesByTagsAsync(IEnumerable<string> tags)
Parameters
Type | Name | Description |
---|
IEnumerable<string> | tags | |
Returns
Type | Description |
---|
Task<List<string>> | |
Add tags to scheme with the given schemeCode
Declaration
Task AddSchemeTagsAsync(string schemeCode, IEnumerable<string> tags)
Parameters
Type | Name | Description |
---|
string | schemeCode | |
IEnumerable<string> | tags | |
Returns
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
Type | Name | Description |
---|
ProcessDefinition | pd | Object representation of the scheme |
Returns
Type | Description |
---|
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
Type | Name | Description |
---|
ProcessDefinition | processDefinition | Process definition to save |
Returns
RemoveSchemeFromCache(Guid)
Remove scheme from scheme cache if the cache is exists
Declaration
void RemoveSchemeFromCache(Guid schemeId)
Parameters
Type | Name | Description |
---|
Guid | schemeId | |
Extension Methods