|
2 | 2 | // Licensed under the MIT License. |
3 | 3 |
|
4 | 4 | using System.ComponentModel; |
| 5 | +using DurableTask.Core.History; |
5 | 6 | using Microsoft.DurableTask.Client.Entities; |
6 | 7 | using Microsoft.DurableTask.Internal; |
7 | 8 |
|
@@ -456,15 +457,34 @@ public virtual Task<string> RestartAsync( |
456 | 457 | /// <exception cref="NotSupportedException">Thrown if this implementation of <see cref="DurableTaskClient"/> does not |
457 | 458 | /// support rewinding orchestrations.</exception> |
458 | 459 | /// <exception cref="NotImplementedException">Thrown if the backend storage provider does not support rewinding orchestrations.</exception> |
459 | | - /// <exception cref="ArgumentException">Thrown if an orchestration with the specified <paramref name="instanceId"/> does not exist.</exception> |
| 460 | + /// <exception cref="ArgumentException">Thrown if an orchestration with the specified <paramref name="instanceId"/> does not exist, |
| 461 | + /// or if <paramref name="instanceId"/> is the instance ID of an entity.</exception> |
460 | 462 | /// <exception cref="InvalidOperationException">Thrown if a precondition of the operation fails, for example if the specified |
461 | 463 | /// orchestration is not in a "Failed" state.</exception> |
462 | 464 | /// <exception cref="OperationCanceledException">Thrown if the operation is canceled via the <paramref name="cancellation"/> token.</exception> |
463 | 465 | public virtual Task RewindInstanceAsync( |
464 | 466 | string instanceId, |
465 | 467 | string reason, |
466 | 468 | CancellationToken cancellation = default) |
467 | | - => throw new NotSupportedException($"{this.GetType()} does not support orchestration rewind."); |
| 469 | + => throw new NotSupportedException($"{this.GetType()} does not support orchestration rewind."); |
| 470 | + |
| 471 | + /// <summary> |
| 472 | + /// Retrieves the history of the specified orchestration instance as a list of <see cref="HistoryEvent"/> objects. |
| 473 | + /// </summary> |
| 474 | + /// <param name="instanceId">The instance ID of the orchestration.</param> |
| 475 | + /// <param name="cancellation">The cancellation token.</param> |
| 476 | + /// <returns>The list of <see cref="HistoryEvent"/> objects representing the orchestration's history.</returns> |
| 477 | + /// <exception cref="NotSupportedException">Thrown if this implementation of <see cref="DurableTaskClient"/> does not |
| 478 | + /// support retrieving orchestration history.</exception> |
| 479 | + /// <exception cref="ArgumentNullException">Thrown if <paramref name="instanceId"/> is null.</exception> |
| 480 | + /// <exception cref="ArgumentException">Thrown if an orchestration with the specified <paramref name="instanceId"/> does not exist, |
| 481 | + /// or if <paramref name="instanceId"/> is the instance ID of an entity.</exception> |
| 482 | + /// <exception cref="OperationCanceledException">Thrown if the operation is canceled via the <paramref name="cancellation"/> token.</exception> |
| 483 | + /// <exception cref="InvalidOperationException">Thrown if an internal error occurs when attempting to retrieve the orchestration history.</exception> |
| 484 | + public virtual Task<IList<HistoryEvent>> GetOrchestrationHistoryAsync( |
| 485 | + string instanceId, |
| 486 | + CancellationToken cancellation = default) |
| 487 | + => throw new NotSupportedException($"{this.GetType()} does not support retrieving orchestration history."); |
468 | 488 |
|
469 | 489 | // TODO: Create task hub |
470 | 490 |
|
|
0 commit comments