|
|
@@ -1,4 +1,5 @@
|
|
|
using Quadarax.Foundation.Core.Business.Processor.Enums;
|
|
|
+using Quadarax.Foundation.Core.Business.Processor.Exceptons;
|
|
|
|
|
|
namespace Quadarax.Foundation.Core.Business.Processor.Task;
|
|
|
|
|
|
@@ -53,16 +54,36 @@ public interface ITaskItem : ITaskIdentifier, ITimeTracked
|
|
|
|
|
|
#region *** Operations ***
|
|
|
/// <summary>
|
|
|
- /// Schedules task to future and sets <see cref="Status"/> to <see cref="ProcessStatusEnum.Pending"/> (affects <see cref="ProcessingValidFrom"/> and <see cref="ProcessingValidTo"/>).
|
|
|
+ /// Re-Schedules inactive task to future and sets <see cref="Status"/> to <see cref="ProcessStatusEnum.Pending"/> (affects <see cref="ProcessingValidFrom"/> and <see cref="ProcessingValidTo"/>).
|
|
|
/// <list type="bullet">
|
|
|
/// <item><description>Allowed state: <see cref="ProcessStatusEnum.Pending"/>, <see cref="ProcessStatusEnum.Paused"/></description></item>
|
|
|
/// <item><description>Set state to: <see cref="ProcessStatusEnum.Pending"/></description></item>
|
|
|
/// </list>
|
|
|
+ /// <exception cref="InvalidTaskStateException">When task state is invalid for operation.</exception>
|
|
|
/// </summary>
|
|
|
/// <param name="postponeInterval">Interval to shift to future.</param>
|
|
|
/// <param name="reason">Reason message to postpone.</param>
|
|
|
void Postpone(TimeSpan postponeInterval, string reason);
|
|
|
- void Stop(string reason);
|
|
|
- void Reset(string reason);
|
|
|
+ /// <summary>
|
|
|
+ /// Stops running task and sets <see cref="Status"/> to <see cref="ProcessStatusEnum.Paused"/> or
|
|
|
+ /// <see cref="ProcessStatusEnum.ProcessedSucc"/> or <see cref="ProcessStatusEnum.ProcessedFail"/> (target status is depends on input arguments)..
|
|
|
+ /// <list type="bullet">
|
|
|
+ /// <item><description>Allowed state: <see cref="ProcessStatusEnum.Started"/></description></item>
|
|
|
+ /// <item><description>Set state to: <see cref="ProcessStatusEnum.Paused"/> or <see cref="ProcessStatusEnum.ProcessedSucc"/> or <see cref="ProcessStatusEnum.ProcessedFail"/></description></item>
|
|
|
+ /// </list>
|
|
|
+ /// <exception cref="InvalidTaskStateException">When task state is invalid for operation.</exception>
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="reason">Reason message to stop.</param>
|
|
|
+ /// <param name="willPause">If true, then <see cref="Status"/> will be set to <see cref="ProcessStatusEnum.Paused"/> otherwise to <see cref="ProcessStatusEnum.ProcessedSucc"/> or <see cref="ProcessStatusEnum.ProcessedFail"/>.</param>
|
|
|
+ /// <param name="willFail">If true, then <see cref="Status"/> will be set to <see cref="ProcessStatusEnum.ProcessedFail"/> otherwise to <see cref="ProcessStatusEnum.ProcessedSucc"/>.</param>
|
|
|
+ void Stop(string reason, bool willPause = true, bool willFail = false);
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Resets task to initial state and sets <see cref="Status"/> to <see cref="ProcessStatusEnum.Pending"/>.
|
|
|
+ /// Uses current validity to re-calculate <see cref="ProcessingValidFrom"/> and <see cref="ProcessingValidTo"/> to now + <see cref="postponeValid"/>.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="reason">Reason to reset task.</param>
|
|
|
+ /// <param name="postponeValid">Postpone current validity from now.</param>
|
|
|
+ void Reset(string reason, TimeSpan postponeValid);
|
|
|
#endregion
|
|
|
}
|