@@ -368,7 +368,7 @@ const DefaultVersion Version = internal.DefaultVersion
368368// Following the steps below, your changes will be forward and backward compatible, keeping possible a safe rollback
369369// to the previous version of the workflow code:
370370//
371- // 1. Keep execution of foo activity, add a support of bar activity
371+ // 1. Keep execution of foo activity, add support for bar activity
372372//
373373// v := GetVersion(ctx, "fooChange", DefaultVersion, 1, ExecuteWithVersion(DefaultVersion))
374374// if v == DefaultVersion {
@@ -378,8 +378,9 @@ const DefaultVersion Version = internal.DefaultVersion
378378// }
379379//
380380// The code above supports replaying of workflow execution with both versions DefaultVersion and 1.
381- // All new workflow executions will execute foo activity, because GetVersion with ExecuteWithMinVersion option
382- // returns DefaultVersion, that will be recorded into the workflow history.
381+ // All new workflow executions will execute foo activity, because ExecuteWithVersion(DefaultVersion)
382+ // causes GetVersion to return DefaultVersion rather than 1.
383+ // In this example, this is also exactly the same as using ExecuteWithMinVersion().
383384//
384385// 2. Enable execution of bar activity
385386//
@@ -392,16 +393,14 @@ const DefaultVersion Version = internal.DefaultVersion
392393//
393394// The code above supports replaying of workflow execution with both versions DefaultVersion and 1.
394395// All new workflow executions will execute bar activity, because
395- // GetVersion returns the maximum supported version - 1, that will be recorded into the workflow history.
396+ // GetVersion returns the maximum supported version (1), which will be recorded into the workflow history.
396397//
397398// 3. Remove a support of foo activity:
398399//
399400// GetVersion(ctx, "fooChange", 1, 1)
400401// err = workflow.ExecuteActivity(ctx, bar).Get(ctx, nil)
401402//
402403// When there are no workflow executions running DefaultVersion the support of foo activity can be removed.
403- //
404- // ExecuteWithVersion option is useful when you want to ensure that your changes can be safely rolled back if needed.
405404func ExecuteWithVersion (version Version ) internal.GetVersionOptions {
406405 return internal .ExecuteWithVersion (version )
407406}
0 commit comments