Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions choice-exclusive/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ func ExclusiveChoiceWorkflow(ctx workflow.Context) error {
// choose next activity based on order result
switch orderChoice {
case OrderChoiceApple:
workflow.ExecuteActivity(ctx, orderActivities.OrderApple, orderChoice)
workflow.ExecuteActivity(ctx, orderActivities.OrderApple, orderChoice).Get(ctx, nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good change, but we need to handle the errors coming back from these

case OrderChoiceBanana:
workflow.ExecuteActivity(ctx, orderActivities.OrderBanana, orderChoice)
workflow.ExecuteActivity(ctx, orderActivities.OrderBanana, orderChoice).Get(ctx, nil)
case OrderChoiceCherry:
workflow.ExecuteActivity(ctx, orderActivities.OrderCherry, orderChoice)
workflow.ExecuteActivity(ctx, orderActivities.OrderCherry, orderChoice).Get(ctx, nil)
case OrderChoiceOrange:
// Activity can be also called by its name
workflow.ExecuteActivity(ctx, "OrderOrange", orderChoice)
workflow.ExecuteActivity(ctx, "OrderOrange", orderChoice).Get(ctx, nil)
default:
logger.Error("Unexpected order", "Choice", orderChoice)
}
Expand Down