Skip to content

Commit

Permalink
Add pending activities to show workflow result
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng authored Oct 12, 2020
1 parent 7f96a69 commit 6592234
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tools/cli/workflowCommands.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,28 @@ func showHistoryHelper(c *cli.Context, wid, rid string) {
ErrorAndExit("Failed to export history data file.", err)
}
}

// finally append activities with retry
frontendClient := cFactory.ServerFrontendClient(c)
domain := getRequiredGlobalOption(c, FlagDomain)
resp, err := frontendClient.DescribeWorkflowExecution(ctx, &shared.DescribeWorkflowExecutionRequest{
Domain: common.StringPtr(domain),
Execution: &shared.WorkflowExecution{
WorkflowId: common.StringPtr(wid),
RunId: common.StringPtr(rid),
},
})
if err != nil {
ErrorAndExit("Describe workflow execution failed, cannot get information of pending activities", err)
}

descOutput := convertDescribeWorkflowExecutionResponse(resp, frontendClient, c)
if len(descOutput.PendingActivities) > 0 {
fmt.Println("============Pending activities============")
prettyPrintJSONObject(descOutput.PendingActivities)
fmt.Println("NOTE: ActivityStartedEvent with retry policy will be written into history when the activity is finished.")
}

}

// StartWorkflow starts a new workflow execution
Expand Down

0 comments on commit 6592234

Please sign in to comment.