forked from optimajet/WorkflowEngine.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessStatus.cs
More file actions
94 lines (87 loc) · 3.94 KB
/
ProcessStatus.cs
File metadata and controls
94 lines (87 loc) · 3.94 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System.Collections.Generic;
namespace OptimaJet.Workflow.Core.Persistence
{
/// <summary>
/// Represent a stage of a life cycle of a process
/// </summary>
public sealed class ProcessStatus
{
public byte Id { get; private set; }
public bool IsAllowedToChangeStatus { get; set; }
public bool IsAllowedToExecuteCommand { get; set; }
/// <summary>
/// Status of a processes which are not exists in persistence store
/// </summary>
public static readonly ProcessStatus NotFound = new ProcessStatus
{
Id = 255,
IsAllowedToChangeStatus = false,
IsAllowedToExecuteCommand = false
};
/// <summary>
/// Status of a processes which are exists in persistence store but theirs status is not defined
/// </summary>
public static readonly ProcessStatus Unknown = new ProcessStatus
{
Id = 254,
IsAllowedToChangeStatus = false,
IsAllowedToExecuteCommand = false
};
/// <summary>
/// Status of a processes which was created just now
/// </summary>
public static readonly ProcessStatus Initialized = new ProcessStatus
{
Id = 0,
IsAllowedToChangeStatus = false,
IsAllowedToExecuteCommand = false
};
/// <summary>
/// Status of a processes which are executing at current moment
/// </summary>
public static readonly ProcessStatus Running = new ProcessStatus
{
Id = 1,
IsAllowedToChangeStatus = false,
IsAllowedToExecuteCommand = false
};
/// <summary>
/// Status of a processes which are not executing at current moment and awaiting an external interaction
/// </summary>
public static readonly ProcessStatus Idled = new ProcessStatus
{
Id = 2,
IsAllowedToChangeStatus = true,
IsAllowedToExecuteCommand = true
};
/// <summary>
/// Status of a processes which was finalized
/// </summary>
public static readonly ProcessStatus Finalized = new ProcessStatus
{
Id = 3,
IsAllowedToChangeStatus = true,
IsAllowedToExecuteCommand = false
};
/// <summary>
/// Status of a processes which was terminated with an error
/// </summary>
public static readonly ProcessStatus Terminated = new ProcessStatus
{
Id = 4,
IsAllowedToChangeStatus = true,
IsAllowedToExecuteCommand = false
};
/// <summary>
/// Status of a processes which had an error but not terminated
/// </summary>
public static readonly ProcessStatus Error = new ProcessStatus
{
Id = 5,
IsAllowedToChangeStatus = true,
IsAllowedToExecuteCommand = true
};
public static readonly IEnumerable<ProcessStatus> All = new List<ProcessStatus>
{Initialized, Running, Idled, Finalized, Terminated, Error};
}
}