-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
WorkflowInstance.cs
45 lines (32 loc) · 1.03 KB
/
WorkflowInstance.cs
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
using System;
using System.Linq;
namespace WorkflowCore.Models
{
public class WorkflowInstance
{
public string Id { get; set; }
public string WorkflowDefinitionId { get; set; }
public int Version { get; set; }
public string Description { get; set; }
public string Reference { get; set; }
public ExecutionPointerCollection ExecutionPointers { get; set; } = new ExecutionPointerCollection();
public long? NextExecution { get; set; }
public WorkflowStatus Status { get; set; }
public object Data { get; set; }
public DateTime CreateTime { get; set; }
public DateTime? CompleteTime { get; set; }
public bool IsBranchComplete(string parentId)
{
return ExecutionPointers
.FindByScope(parentId)
.All(x => x.EndTime != null);
}
}
public enum WorkflowStatus
{
Runnable = 0,
Suspended = 1,
Complete = 2,
Terminated = 3,
}
}