Skip to main content

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

Interface IWorkflowRuleProvider

Interface of a rule provider, which provide rule checking and getting of a list of users which satisfies a rule TransitionDefinition.Restrictions

Namespace: OptimaJet.Workflow.Core.Runtime

Assembly: OptimaJet.Workflow.Core.dll

Syntax
public interface IWorkflowRuleProvider

Methods

GetRules(string, NamesSearchType)

Return all rule names

Declaration
List<string> GetRules(string schemeCode, NamesSearchType namesSearchType)
Parameters
TypeNameDescription
stringschemeCode
NamesSearchTypenamesSearchType
Returns
TypeDescription
List<string>List of rule names

Check(ProcessInstance, WorkflowRuntime, string, string, string)

Check the rule

Declaration
bool Check(ProcessInstance processInstance, WorkflowRuntime runtime, string identityId, string ruleName, string parameter)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceReference to ProcessInstance for which rule is checked <xref href="OptimaJet.Workflow.Core.Model.ProcessInstance" data-throw-if-not-resolved="false"></xref>
WorkflowRuntimeruntimeReference to WorkflowRuntime object which managed specified process instance <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowRuntime" data-throw-if-not-resolved="false"></xref>
stringidentityIdUser id for which rule is checking
stringruleNameName of the rule to check
stringparameterAdditional rule parameter <xref href="OptimaJet.Workflow.Core.Model.RestrictionDefinition.Actor" data-throw-if-not-resolved="false"></xref> <xref href="OptimaJet.Workflow.Core.Model.ActorDefinition.Value" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
boolRule check result

CheckAsync(ProcessInstance, WorkflowRuntime, string, string, string, CancellationToken)

Check the rule asynchronously

Declaration
Task<bool> CheckAsync(ProcessInstance processInstance, WorkflowRuntime runtime, string identityId, string ruleName, string parameter, CancellationToken token)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceReference to ProcessInstance for which rule is checked <xref href="OptimaJet.Workflow.Core.Model.ProcessInstance" data-throw-if-not-resolved="false"></xref>
WorkflowRuntimeruntimeReference to WorkflowRuntime object which managed specified process instance <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowRuntime" data-throw-if-not-resolved="false"></xref>
stringidentityIdUser id for which rule is checking
stringruleNameName of the rule to check
stringparameterAdditional rule parameter <xref href="OptimaJet.Workflow.Core.Model.RestrictionDefinition.Actor" data-throw-if-not-resolved="false"></xref> <xref href="OptimaJet.Workflow.Core.Model.ActorDefinition.Value" data-throw-if-not-resolved="false"></xref>
CancellationTokentoken
Returns
TypeDescription
Task<bool>Rule check result

GetIdentities(ProcessInstance, WorkflowRuntime, string, string)

Get the list of users which satisfies the rule

Declaration
IEnumerable<string> GetIdentities(ProcessInstance processInstance, WorkflowRuntime runtime, string ruleName, string parameter)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceReference to ProcessInstance for which rule is checked <xref href="OptimaJet.Workflow.Core.Model.ProcessInstance" data-throw-if-not-resolved="false"></xref>
WorkflowRuntimeruntimeReference to WorkflowRuntime object which managed specified process instance <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowRuntime" data-throw-if-not-resolved="false"></xref>
stringruleNameName of the rule to get users list
stringparameterAdditional rule parameter <xref href="OptimaJet.Workflow.Core.Model.RestrictionDefinition.Actor" data-throw-if-not-resolved="false"></xref> <xref href="OptimaJet.Workflow.Core.Model.ActorDefinition.Value" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
IEnumerable<string>List of users which satisfies the rule

GetIdentitiesAsync(ProcessInstance, WorkflowRuntime, string, string, CancellationToken)

Get the list of users which satisfies the rule asynchronously

Declaration
Task<IEnumerable<string>> GetIdentitiesAsync(ProcessInstance processInstance, WorkflowRuntime runtime, string ruleName, string parameter, CancellationToken token)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceReference to ProcessInstance for which rule is checked <xref href="OptimaJet.Workflow.Core.Model.ProcessInstance" data-throw-if-not-resolved="false"></xref>
WorkflowRuntimeruntimeReference to WorkflowRuntime object which managed specified process instance <xref href="OptimaJet.Workflow.Core.Runtime.WorkflowRuntime" data-throw-if-not-resolved="false"></xref>
stringruleNameName of the rule to get users list
stringparameterAdditional rule parameter <xref href="OptimaJet.Workflow.Core.Model.RestrictionDefinition.Actor" data-throw-if-not-resolved="false"></xref> <xref href="OptimaJet.Workflow.Core.Model.ActorDefinition.Value" data-throw-if-not-resolved="false"></xref>
CancellationTokentoken
Returns
TypeDescription
Task<IEnumerable<string>>List of users which satisfies the rule

IsCheckAsync(string, string)

Checks whether Check the rule should be called asynchronously

Declaration
bool IsCheckAsync(string ruleName, string schemeCode)
Parameters
TypeNameDescription
stringruleNameName of the action
stringschemeCode
Returns
TypeDescription
bool

IsGetIdentitiesAsync(string, string)

Checks whether Get the list of users which satisfies the rule should be called asynchronously

Declaration
bool IsGetIdentitiesAsync(string ruleName, string schemeCode)
Parameters
TypeNameDescription
stringruleNameName of the condition
stringschemeCode
Returns
TypeDescription
bool

Extension Methods