public override bool Compensate(WorkLog item, RoutingSlip routingSlip) { object reservationId = item.Result["reservationId"]; Logger.Message($"Cancelled flight {reservationId}."); return(true); }
public bool UndoLast() { if (!IsInProgress) { throw new InvalidOperationException(); } WorkLog currentItem = _completedWorkLogs.Pop(); var activity = (Activity)Activator.CreateInstance(currentItem.ActivityType); try { return(activity.Compensate(currentItem, this)); } catch (Exception ex) { Logger.Exception(ex, "Exception occurred during undo last method."); throw; } }
public abstract bool Compensate(WorkLog item, RoutingSlip routingSlip);