'How to cancel/reset workflow from Java Client?

Im seeing cadence cli supports the above commands from cli interface.How to do this through java sdk.Im seeing support only for starting the workflow.



Solution 1:[1]

Cancel

You can call this RequestCancelWorkflowExecution API to cancel a workflow

Reset

You can call this ResetWorkflowExecution API to reset a workflow

However, it only support resetting by a eventId as reset point. It doesn't allow resetting by resetTypes which are supported in the CLI, until this issue is implemented.

For now, if you want to reset by resetTypes, you have to copy the logic from this CLI implementation

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Long Quanzheng