Backend/e-suite.Workflow.Core/Tasks/MilestoneTask.cs

25 lines
845 B
C#

using e_suite.Database.Core.Tables.Activity;
using e_suite.Workflow.Core.Attributes;
using e_suite.Workflow.Core.Enums;
using e_suite.Workflow.Core.Extensions;
using e_suite.Workflow.Core.Interfaces;
using eSuite.Core.Enums;
namespace e_suite.Workflow.Core.Tasks;
/// <summary>
/// A Milestone task does not have any specific processing, so is ready to complete as soon at it starts.
/// </summary>
[GeneralTask]
public class MilestoneTask : TaskBase, IOutcome<DefaultOutcome>
{
public Dictionary<DefaultOutcome, Guid> OutcomeActions { get; set; } = [];
public override async Task OnStartedAsync(ActivityTask activityTask)
{
await base.OnStartedAsync(activityTask);
activityTask.AddOutcome(DefaultOutcome.Complete);
activityTask.SetState(ActivityState.ReadyToComplete);
}
}