Client
Retry Failed Workflow Task
When an error occured within the workflow definition itself, the corresponding instance is stalled. The worklow itself is executed in a special task called WorkflowTask. After having fixed the workflow definition, the instance can be resume by using:
// stub targeting a running HelloWorkflow workflow with a specific id
HelloWorkflow w =
client.getWorkflowById(HelloWorkflow.class, "05694902-5aa4-469f-824c-7015b0df906c");
// retry the workflow task for this instance
client.retryWorkflowTask(w);
// stub targeting a running HelloWorkflow workflow with a specific id
val w : HelloWorkflow =
client.getWorkflowById(HelloWorkflow::class.java, "05694902-5aa4-469f-824c-7015b0df906c")
// retry the workflow task for this instance
client.retryWorkflowTask(w)
We can also target workflows by tag:
// stub targeting a running HelloWorkflow workflow with a specific id
HelloWorkflow w =
client.getWorkflowByTag(HelloWorkflow.class, "foo");
// retry the workflow task for this instance
client.retryWorkflowTask(w);
// stub targeting a running HelloWorkflow workflow with a specific id
val w : HelloWorkflow =
client.getWorkflowByTag(HelloWorkflow::class.java, "foo")
// retry the workflow task for this instance
client.retryWorkflowTask(w)
The retryWorkflowTask
method returns when the adhoc message is sent to Pulsar. We can use the retryWorkflowTaskAsync
method if we want to send the adhoc message asynchronously.