use of com.uber.cadence.workflow.ChildWorkflowTerminatedException in project cadence-client by uber-java.
the class WorkflowDecisionContext method handleChildWorkflowExecutionTerminated.
void handleChildWorkflowExecutionTerminated(HistoryEvent event) {
ChildWorkflowExecutionTerminatedEventAttributes attributes = event.getChildWorkflowExecutionTerminatedEventAttributes();
WorkflowExecution execution = attributes.getWorkflowExecution();
String workflowId = execution.getWorkflowId();
if (decisions.handleChildWorkflowExecutionClosed(workflowId)) {
OpenChildWorkflowRequestInfo scheduled = scheduledExternalWorkflows.remove(workflowId);
if (scheduled != null) {
RuntimeException failure = new ChildWorkflowTerminatedException(event.getEventId(), execution, attributes.getWorkflowType());
BiConsumer<byte[], Exception> completionCallback = scheduled.getCompletionCallback();
completionCallback.accept(null, failure);
}
}
}
Aggregations