I’m using Workflow and ChildWorkflow like this:
I want to get the Terminate Reason when I catch the Exception.
Thanks for your response!
I’m using Workflow and ChildWorkflow like this:
I want to get the Terminate Reason when I catch the Exception.
Thanks for your response!
Terminate is like a “kill -9” and you will not be able to catch it inside your child workflow that you are terminating.
You can catch child termination inside your workflow code. Child invocations always throw ChildWorkflowFailure, so in your workflow code you could do for example:
try {
promise.get(); // wait for child workflow to complete
} catch (ChildWorkflowFailure e) {
// ChildWorkflowFailure would contain TerminateFailure as its cause
TerminatedFailure t = (TerminatedFailure) e.getCause();
// ...
}