use of com.uber.cadence.workflow.StartChildWorkflowFailedException in project cadence-client by uber-java.
the class WorkflowDecisionContext method handleStartChildWorkflowExecutionFailed.
void handleStartChildWorkflowExecutionFailed(HistoryEvent event) {
StartChildWorkflowExecutionFailedEventAttributes attributes = event.getStartChildWorkflowExecutionFailedEventAttributes();
String workflowId = attributes.getWorkflowId();
if (decisions.handleStartChildWorkflowExecutionFailed(event)) {
OpenChildWorkflowRequestInfo scheduled = scheduledExternalWorkflows.remove(workflowId);
if (scheduled != null) {
WorkflowExecution workflowExecution = new WorkflowExecution();
workflowExecution.setWorkflowId(workflowId);
WorkflowType workflowType = attributes.getWorkflowType();
ChildWorkflowExecutionFailedCause cause = attributes.getCause();
RuntimeException failure = new StartChildWorkflowFailedException(event.getEventId(), workflowExecution, workflowType, cause);
BiConsumer<byte[], Exception> completionCallback = scheduled.getCompletionCallback();
completionCallback.accept(null, failure);
}
}
}
Aggregations