forked from optimajet/WorkflowEngine.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIWorkflowRuleProvider.cs
More file actions
75 lines (67 loc) · 4.47 KB
/
IWorkflowRuleProvider.cs
File metadata and controls
75 lines (67 loc) · 4.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using OptimaJet.Workflow.Core.Model;
namespace OptimaJet.Workflow.Core.Runtime
{
/// <summary>
/// Interface of a rule provider, which provide rule checking and getting of a list of users which satisfies a rule <see cref="TransitionDefinition.Restrictions"/>
/// </summary>
public interface IWorkflowRuleProvider
{
/// <summary>
/// Return all rule names
/// </summary>
/// <returns>List of rule names</returns>
List<string> GetRules(string schemeCode);
/// <summary>
/// Check the rule
/// </summary>
/// <param name="processInstance">Reference to ProcessInstance for which rule is checked <see cref="ProcessInstance"/></param>
/// <param name="runtime">Reference to WorkflowRuntime object which managed specified process instance <see cref="WorkflowRuntime"/></param>
/// <param name="identityId">User id for which rule is checking </param>
/// <param name="ruleName">Name of the rule to check</param>
/// <param name="parameter">Additional rule parameter <see cref="RestrictionDefinition.Actor"/> <see cref="ActorDefinition.Value"/></param>
/// <returns>Rule check result</returns>
bool Check(ProcessInstance processInstance, WorkflowRuntime runtime, string identityId, string ruleName, string parameter);
/// <summary>
/// Check the rule asynchronously
/// </summary>
/// <param name="processInstance">Reference to ProcessInstance for which rule is checked <see cref="ProcessInstance"/></param>
/// <param name="runtime">Reference to WorkflowRuntime object which managed specified process instance <see cref="WorkflowRuntime"/></param>
/// <param name="identityId">User id for which rule is checking </param>
/// <param name="ruleName">Name of the rule to check</param>
/// <param name="parameter">Additional rule parameter <see cref="RestrictionDefinition.Actor"/> <see cref="ActorDefinition.Value"/></param>
/// <returns>Rule check result</returns>
Task<bool> CheckAsync(ProcessInstance processInstance, WorkflowRuntime runtime, string identityId, string ruleName, string parameter, CancellationToken token);
/// <summary>
/// Get the list of users which satisfies the rule
/// </summary>
/// <param name="processInstance">Reference to ProcessInstance for which rule is checked <see cref="ProcessInstance"/></param>
/// <param name="runtime">Reference to WorkflowRuntime object which managed specified process instance <see cref="WorkflowRuntime"/></param>
/// <param name="ruleName">Name of the rule to get users list</param>
/// <param name="parameter">Additional rule parameter <see cref="RestrictionDefinition.Actor"/> <see cref="ActorDefinition.Value"/></param>
/// <returns>List of users which satisfies the rule</returns>
IEnumerable<string> GetIdentities(ProcessInstance processInstance, WorkflowRuntime runtime, string ruleName, string parameter);
/// <summary>
/// Get the list of users which satisfies the rule asynchronously
/// </summary>
/// <param name="processInstance">Reference to ProcessInstance for which rule is checked <see cref="ProcessInstance"/></param>
/// <param name="runtime">Reference to WorkflowRuntime object which managed specified process instance <see cref="WorkflowRuntime"/></param>
/// <param name="ruleName">Name of the rule to get users list</param>
/// <param name="parameter">Additional rule parameter <see cref="RestrictionDefinition.Actor"/> <see cref="ActorDefinition.Value"/></param>
/// <returns>List of users which satisfies the rule</returns>
Task<IEnumerable<string>> GetIdentitiesAsync(ProcessInstance processInstance, WorkflowRuntime runtime, string ruleName, string parameter, CancellationToken token);
/// <summary>
/// Checks whether Check the rule should be called asynchronously
/// </summary>
/// <param name="ruleName">Name of the action</param>
bool IsCheckAsync(string ruleName, string schemeCode);
/// <summary>
/// Checks whether Get the list of users which satisfies the rule should be called asynchronously
/// </summary>
/// <param name="ruleName">Name of the condition</param>
bool IsGetIdentitiesAsync(string ruleName, string schemeCode);
}
}