/// <summary> /// Creates a new instance /// </summary> /// <param name="processId">The process id</param> /// <param name="state">The status of the process</param> public TransformationProcessStatus(Guid processId, TransformationExecutionState state) { ProcessId = processId; State = state; }
/// <summary> /// Sets the state of the process /// </summary> /// <param name="status">The process status</param> /// <param name="token">Cancellation token to use, if any</param> /// <returns>The updated process status</returns> protected virtual async Task <TransformationProcessStatus> ChangeProcessStatusAsync(TransformationExecutionState status, CancellationToken token) { // NOTE: This one returns the TransformationProcessStatus, while the next one doesn't (for the task) // Evaluate a different and more consistent approach var newStatus = new TransformationProcessStatus(Id, status); await TransformationStateManager .WriteProcessStatusAsync(newStatus, token) .ConfigureAwait(false); await RaiseProgressAsync(newStatus).ConfigureAwait(false); return(newStatus); }
private Task ChangeProcessStateAsync(TransformationExecutionState state) { status = new TransformationProcessStatus(Id, state); return(RaiseProgressAsync(status)); }