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

27 lines
885 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(taskIcon: "faFlagCheckered")]
public class MilestoneTask : TaskBase, IOutcome<DefaultOutcome>
{
public List<OutcomeAction<DefaultOutcome>> OutcomeActions { get; set; } = [];
public override async Task OnStartedAsync(ActivityTask activityTask)
{
await base.OnStartedAsync(activityTask);
activityTask.AddOutcome(DefaultOutcome.Complete);
activityTask.SetState(ActivityState.ReadyToComplete);
}
}