How can I get strong-typed history of a workflow execution?
- Vorherrschende Sprache
- C#
- Sterne
- 1.7k
- Forks
- 335
- Ø Merge
- 2 T. 23 Std.
- Gemergte PRs (30 T.)
- 6
Beschreibung
I'm trying to build a UI to audit the status of in-progress and completed workflows. I'd like to display the full history of the workflow.
I see that `TaskHubClient` has a method `GetOrchestrationHistoryAsync` that is nearly what I want, except it returns a json string instead of a strong-typed list of history items:
https://github.com/Azure/durabletask/blob/657586bcfe9b0c68695ec6447ee9baca338c6cf7/src/DurableTask.Core/TaskHubClient.cs#L832-L849
Digging down through the call stack, `IOrchestrationServiceClient.GetOrchestrationHistoryAsync` also returns json:
https://github.com/Azure/durabletask/blob/657586bcfe9b0c68695ec6447ee9baca338c6cf7/src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs#L1749-L1762
The next level down (at least in the case of the Azure Storage backend) is `ITrackingStore`, which is unusable to me because it's not public.
https://github.com/Azure/durabletask/blob/657586bcfe9b0c68695ec6447ee9baca338c6cf7/src/DurableTask.AzureStorage/Tracking/ITrackingStore.cs#L26
I'm currently working around the issue by deserializing the returned json. It works, but the code needed to do so is nontrivial and brittle because `HistoryEvent` is an abstract class and requires custom type mapping to deserialize properly.
It seems like there should be a "Get Orchestration History" method that returns a list of `HistoryEvent` objects, or perhaps an `OrchestrationHistory` object. Am I missing something?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginnen Sie mit GetOrchestrationHistoryAsync in src/DurableTask.Core/TaskHubClient.cs und IOrchestrationServiceClient.GetOrchestrationHistoryAsync in src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs. Prüfen Sie ITrackingStore und die HistoryEvent-Hierarchie, um zu bestimmen, wie ein öffentliches typisiertes Verlaufsergebnis bereitgestellt werden könnte; abgeschlossen ist die Aufgabe, wenn Aufrufer den Verlauf ohne fragile benutzerdefinierte JSON-Deserialisierung abrufen können.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- api, backend
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100