| | | 1 | | using Elsa.Alterations.Core.Models; |
| | | 2 | | using Microsoft.Extensions.Logging; |
| | | 3 | | |
| | | 4 | | namespace Elsa.Alterations.Core.Results; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// The result of running a series of alterations. |
| | | 8 | | /// </summary> |
| | | 9 | | public class RunAlterationsResult |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// Initializes a new instance of the <see cref="RunAlterationsResult"/> class. |
| | | 13 | | /// </summary> |
| | 0 | 14 | | public RunAlterationsResult(string workflowInstanceId, AlterationLog log) |
| | | 15 | | { |
| | 0 | 16 | | WorkflowInstanceId = workflowInstanceId; |
| | 0 | 17 | | Log = log; |
| | 0 | 18 | | } |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// The ID of the workflow instance that was altered. |
| | | 22 | | /// </summary> |
| | 0 | 23 | | public string WorkflowInstanceId { get; } |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// A log of the alterations that were run. |
| | | 27 | | /// </summary> |
| | 0 | 28 | | public AlterationLog Log { get; set; } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// A flag indicating whether the workflow has scheduled work. |
| | | 32 | | /// </summary> |
| | 0 | 33 | | public bool WorkflowHasScheduledWork { get; set; } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// A flag indicating whether the alterations have succeeded. |
| | | 37 | | /// </summary> |
| | 0 | 38 | | public bool IsSuccessful => Log.LogEntries.Any(x => x.LogLevel <= LogLevel.Warning); |
| | | 39 | | } |