use of com.uber.cadence.StartChildWorkflowExecutionFailedEventAttributes 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);
}
}
}
use of com.uber.cadence.StartChildWorkflowExecutionFailedEventAttributes in project cadence-client by uber-java.
the class DecisionsHelper method handleStartChildWorkflowExecutionFailed.
public boolean handleStartChildWorkflowExecutionFailed(HistoryEvent event) {
StartChildWorkflowExecutionFailedEventAttributes attributes = event.getStartChildWorkflowExecutionFailedEventAttributes();
String workflowId = attributes.getWorkflowId();
DecisionStateMachine decision = getDecision(new DecisionId(DecisionTarget.EXTERNAL_WORKFLOW, workflowId));
decision.handleInitiationFailedEvent(event);
return decision.isDone();
}
Aggregations