}
}
}
void handleChildWorkflowExecutionTerminated(HistoryEvent event) {
ChildWorkflowExecutionTerminatedEventAttributes attributes = event.getChildWorkflowExecutionTerminatedEventAttributes();
WorkflowExecution execution = attributes.getWorkflowExecution();
String workflowId = execution.getWorkflowId();
if (decisions.handleChildWorkflowExecutionClosed(workflowId)) {
OpenRequestInfo<StartChildWorkflowReply, WorkflowType> scheduled = scheduledExternalWorkflows.remove(workflowId);
if (scheduled != null) {
Exception failure = new ChildWorkflowTerminatedException(event.getEventId(), execution,
attributes.getWorkflowType());
ExternalTaskCompletionHandle context = scheduled.getCompletionHandle();
context.fail(failure);
}
}
}