/// <summary> /// Faults the <see cref="V1WorkflowActivity"/> /// </summary> /// <param name="error">The unhandled <see cref="Error"/> that caused the <see cref="V1WorkflowActivity"/> to end prematurily</param> public virtual void Fault(Neuroglia.Error error) { if (error == null) { throw DomainException.ArgumentNull(nameof(error)); } if (this.Status >= V1WorkflowActivityStatus.Faulted) { throw DomainException.UnexpectedState(typeof(V1WorkflowActivity), this.Id, this.Status); } this.On(this.RegisterEvent(new V1WorkflowActivityFaultedDomainEvent(this.Id, error))); }
/// <summary> /// Initializes a new <see cref="V1WorkflowActivityFaultedDomainEvent"/> /// </summary> /// <param name="id">The id of the <see cref="V1WorkflowActivity"/> which's execution has faulted</param> /// <param name="error">The <see cref="Neuroglia.Error"/> due to which the <see cref="V1WorkflowActivity"/> has faulted</param> public V1WorkflowActivityFaultedDomainEvent(string id, Neuroglia.Error error) : base(id) { this.Error = error; }
/// <summary> /// Initializes a new <see cref="V1FaultWorkflowActivityCommand"/> /// </summary> /// <param name="id">The id of the <see cref="Domain.Models.V1WorkflowActivity"/> to fault</param> /// <param name="error">The <see cref="Neuroglia.Error"/> that cause the <see cref="Domain.Models.V1WorkflowActivity"/> to fault</param> public V1FaultWorkflowActivityCommand(string id, Neuroglia.Error error) { this.Id = id; this.Error = error; }