28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
namespace e_suite.Workflow.Core;
|
|
|
|
public abstract class TaskBase : ITask
|
|
{
|
|
public Guid Guid { get; set; } = Guid.CreateVersion7();
|
|
public required ITask Parent { get; set; }
|
|
public TaskState TaskState { get; set; } = TaskState.Pending;
|
|
public required string Name { get; set; }
|
|
public string Description { get; set; } = string.Empty;
|
|
public IList<ITask> Predecessors { get; set; } = new List<ITask>();
|
|
public decimal UnitsOfWork { get; set; } = 1;
|
|
public required Cost Cost { get; set; }
|
|
public BudgetOption BudgetOption { get; set; } = BudgetOption.DoNotShow;
|
|
public bool AllowTimeTracking { get; set; } = true;
|
|
public Priority Priority { get; set; } = Priority.Normal;
|
|
public required TimeSpan Duration { get; set; }
|
|
public IList<string> Tags { get; set; } = new List<string>();
|
|
|
|
public virtual Task OnActivateAsync()
|
|
{
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public virtual Task<bool> OnCompleteAsync()
|
|
{
|
|
return Task.FromResult(true);
|
|
}
|
|
} |