String workflowId = execution.getWorkflowId();
if (decisions.handleChildWorkflowExecutionCanceled(workflowId)) {
OpenRequestInfo<StartChildWorkflowReply, WorkflowType> scheduled = scheduledExternalWorkflows.remove(workflowId);
if (scheduled != null) {
CancellationException e = new CancellationException();
ExternalTaskCompletionHandle completionHandle = scheduled.getCompletionHandle();
// It is OK to fail with subclass of CancellationException when cancellation requested.
// It allows passing information about cancellation (details in this case) to the surrounding doCatch block
completionHandle.fail(e);
}
}
}