Expose version information in the orchestration context
- Dominant language
- C#
- Stars
- 1.7k
- Forks
- 335
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 6
Description
It would be convenient if orchestration instances could know their versions so that developers could write inline branch logic when versioning their orchestrations rather than mapping new versions to new classes, which is a bit more heavy-handed.
This is something supported by Temporal: https://docs.temporal.io/docs/go-versioning/. I think it would be useful to have in DTFx as well, though developers would need to use it carefully.
Example:
```csharp
class LongRunningOrchestration : TaskOrchestration
{
public override async Task RunTask(OrchestrationContext context, string input)
{
await context.ScheduleTask(typeof(ActivityA), input);
// At this point in the orchestration, a change may have been deployed
if (context.Version == Version1)
{
await context.ScheduleTask(typeof(ActivityB1), input);
}
else if (context.Version == Version2)
{
await context.ScheduleTask(typeof(ActivityB2), input);
}
return $"Completed as version '{context.Version}'";
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.