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
Syntaxpublic interface IWorkflowBuilder
Methods
CreateNewProcessAsync(Guid, string, IDictionary<string, object>, string)
Create new instance of the process.
DeclarationTask<ProcessInstance> CreateNewProcessAsync(Guid processId, string schemeCode, IDictionary<string, object> parameters, string tenantId)
ParametersType | 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 |
ReturnsType | Description |
---|
Task<ProcessInstance> | ProcessInstance object |
CreateNewSubprocessAsync(Guid, ProcessInstance, TransitionDefinition)
DeclarationTask<ProcessInstance> CreateNewSubprocessAsync(Guid processId, ProcessInstance parentProcessInstance, TransitionDefinition startingTransition)
ParametersType | Name | Description |
---|
Guid | processId | |
ProcessInstance | parentProcessInstance | |
TransitionDefinition | startingTransition | |
ReturnsType | Description |
---|
Task<ProcessInstance> | |
CreateNewProcessSchemeAsync(string, IDictionary<string, object>)
Create new scheme for existing process
DeclarationTask<ProcessDefinition> CreateNewProcessSchemeAsync(string schemeCode, IDictionary<string, object> parameters)
ParametersType | Name | Description |
---|
string | schemeCode | Code of the scheme |
IDictionary<string, object> | parameters | The parameters for creating scheme of process |
ReturnsType | Description |
---|
Task<ProcessDefinition> | ProcessDefinition object |
CreateNewSubprocessSchemeAsync(ProcessDefinition, TransitionDefinition)
DeclarationTask<ProcessDefinition> CreateNewSubprocessSchemeAsync(ProcessDefinition parentProcessScheme, TransitionDefinition startingTransition)
ParametersType | Name | Description |
---|
ProcessDefinition | parentProcessScheme | |
TransitionDefinition | startingTransition | |
ReturnsType | Description |
---|
Task<ProcessDefinition> | |
GetProcessInstanceAsync(Guid)
Returns existing process instance
DeclarationTask<ProcessInstance> GetProcessInstanceAsync(Guid processId)
ParametersType | Name | Description |
---|
Guid | processId | Process id |
ReturnsType | Description |
---|
Task<ProcessInstance> | ProcessInstance object |
GetProcessSchemeAsync(Guid)
Returns process scheme by specific id, if scheme not exists creates it
DeclarationTask<ProcessDefinition> GetProcessSchemeAsync(Guid schemeId)
ParametersType | Name | Description |
---|
Guid | schemeId | Id of the scheme |
ReturnsType | Description |
---|
Task<ProcessDefinition> | ProcessDefinition object |
SetCache(IParsedProcessCache)
Sets the cache to store parsed ProcessDefinition objects ProcessDefinition
Declarationvoid SetCache(IParsedProcessCache cache)
ParametersType | Name | Description |
---|
IParsedProcessCache | cache | Instance of cache object |
RemoveCache()
Removes the cache to store parsed ProcessDefinition objects ProcessDefinition
DeclarationGetProcessSchemeAsync(string)
Returns process scheme by specific name, if scheme not exists creates it
DeclarationTask<ProcessDefinition> GetProcessSchemeAsync(string schemeCode)
ParametersType | Name | Description |
---|
string | schemeCode | Name of the scheme |
ReturnsType | 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
DeclarationTask<ProcessDefinition> GetProcessSchemeAsync(string schemeCode, IDictionary<string, object> parameters)
ParametersType | Name | Description |
---|
string | schemeCode | Name of the scheme |
IDictionary<string, object> | parameters | The parameters for creating the scheme of the process |
ReturnsType | 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
DeclarationTask SetSchemeIsObsoleteAsync(string schemeCode, Dictionary<string, object> parameters)
ParametersType | Name | Description |
---|
string | schemeCode | Name of the scheme |
Dictionary<string, object> | parameters | The parameters for creating the scheme of the process |
ReturnsSetSchemeIsObsoleteAsync(string)
Set IsObsolete sign to the scheme with specific name
DeclarationTask SetSchemeIsObsoleteAsync(string schemeCode)
ParametersType | Name | Description |
---|
string | schemeCode | Name of the scheme |
ReturnsGetProcessSchemeForDesignerAsync(string)
Returns existing process scheme directly from scheme persistence store
DeclarationTask<ProcessDefinition> GetProcessSchemeForDesignerAsync(string code)
ParametersType | Name | Description |
---|
string | code | Name of the scheme |
ReturnsType | Description |
---|
Task<ProcessDefinition> | ProcessDefinition object |
SaveProcessSchemeAsync(string, ProcessDefinition)
Saves process scheme to scheme persistence store
DeclarationTask<(bool success, List<string> errors, string failedStep)> SaveProcessSchemeAsync(string schemeCode, ProcessDefinition pd)
ParametersType | Name | Description |
---|
string | schemeCode | Code of the scheme |
ProcessDefinition | pd | Object representation of the scheme |
ReturnsType | 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
DeclarationProcessDefinition Parse(string scheme, SchemeParsingType schemeParsingType = SchemeParsingType.Strict)
ParametersType | 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 |
ReturnsType | Description |
---|
ProcessDefinition | ProcessDefinition object |
Serialize(ProcessDefinition)
Serialize process scheme to the string
Declarationstring Serialize(ProcessDefinition processDefinition)
ParametersType | Name | Description |
---|
ProcessDefinition | processDefinition | SProcessDefinition object |
ReturnsType | Description |
---|
string | String representation of not parsed scheme |
AddBuildStep(int, BuildStepPosition, BuildStep)
Adds a build step into workflow builder
Declarationvoid AddBuildStep(int order, BuildStepPosition buildStepPosition, BuildStep step)
ParametersType | 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
Declarationvoid AddSystemBuildStepAtTheEnd(BuildStep step, int startOrder = 0, int endOrder = 1000)
ParametersType | 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
Declarationvoid AddBuildStepAtTheEnd(BuildStep step)
ParametersType | 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
DeclarationTask<ProcessDefinition> GenerateProcessDefinitionAsync(string schemeCode, IDictionary<string, object> parameters)
ParametersType | Name | Description |
---|
string | schemeCode | Name of the scheme |
IDictionary<string, object> | parameters | The parameters for creating the scheme of the process |
ReturnsType | Description |
---|
Task<ProcessDefinition> | Generated process definition |
ContainsBuildStep(string)
Returns true if the builder contains a build step with the name
Declarationbool ContainsBuildStep(string name)
ParametersType | Name | Description |
---|
string | name | Name of build step |
ReturnsGetInlinedSchemeCodesAsync()
Returns the list of scheme codes that can be inlined into other schemes
DeclarationTask<List<string>> GetInlinedSchemeCodesAsync()
ReturnsType | Description |
---|
Task<List<string>> | The list of scheme codes |
Returns the list of scheme codes into which the scheme with the given code has been inlined
DeclarationTask<List<string>> GetRelatedByInliningSchemeCodesAsync(string schemeCode)
ParametersType | Name | Description |
---|
string | schemeCode | Inlined scheme code |
ReturnsType | 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
DeclarationTask RemoveSchemeTagsAsync(string schemeCode, IEnumerable<string> tags)
ParametersType | Name | Description |
---|
string | schemeCode | |
IEnumerable<string> | tags | |
ReturnsSet tags to scheme with the given schemeCode
DeclarationTask SetSchemeTagsAsync(string schemeCode, IEnumerable<string> tags)
ParametersType | Name | Description |
---|
string | schemeCode | |
IEnumerable<string> | tags | |
ReturnsReturns the list of scheme codes into which the scheme with the given tags
DeclarationTask<List<string>> SearchSchemesByTagsAsync(IEnumerable<string> tags)
ParametersType | Name | Description |
---|
IEnumerable<string> | tags | |
ReturnsType | Description |
---|
Task<List<string>> | |
Add tags to scheme with the given schemeCode
DeclarationTask AddSchemeTagsAsync(string schemeCode, IEnumerable<string> tags)
ParametersType | Name | Description |
---|
string | schemeCode | |
IEnumerable<string> | tags | |
ReturnsGetInlineSchemesAsync(ProcessDefinition)
Get the list of inlined schemes for a given scheme
DeclarationTask<(List<string> codes, List<string> errors, string failedStep)> GetInlineSchemesAsync(ProcessDefinition pd)
ParametersType | Name | Description |
---|
ProcessDefinition | pd | Object representation of the scheme |
ReturnsType | 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
DeclarationTask UpsertProcessInstanceScheme(ProcessDefinition processDefinition)
ParametersType | Name | Description |
---|
ProcessDefinition | processDefinition | Process definition to save |
ReturnsRemoveSchemeFromCache(Guid)
Remove scheme from scheme cache if the cache is exists
Declarationvoid RemoveSchemeFromCache(Guid schemeId)
ParametersType | Name | Description |
---|
Guid | schemeId | |
Extension Methods