Search in sources :

Example 1 with StartChildWorkflowExecutionFailedEventAttributes

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);
        }
    }
}
Also used : WorkflowType(com.uber.cadence.WorkflowType) StartChildWorkflowFailedException(com.uber.cadence.workflow.StartChildWorkflowFailedException) WorkflowExecution(com.uber.cadence.WorkflowExecution) ChildWorkflowExecutionFailedCause(com.uber.cadence.ChildWorkflowExecutionFailedCause) StartChildWorkflowExecutionFailedEventAttributes(com.uber.cadence.StartChildWorkflowExecutionFailedEventAttributes) StartChildWorkflowFailedException(com.uber.cadence.workflow.StartChildWorkflowFailedException) ChildWorkflowTerminatedException(com.uber.cadence.workflow.ChildWorkflowTerminatedException) CancellationException(java.util.concurrent.CancellationException) ChildWorkflowTimedOutException(com.uber.cadence.workflow.ChildWorkflowTimedOutException) SignalExternalWorkflowException(com.uber.cadence.workflow.SignalExternalWorkflowException)

Example 2 with StartChildWorkflowExecutionFailedEventAttributes

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();
}
Also used : StartChildWorkflowExecutionFailedEventAttributes(com.uber.cadence.StartChildWorkflowExecutionFailedEventAttributes)

Aggregations

StartChildWorkflowExecutionFailedEventAttributes (com.uber.cadence.StartChildWorkflowExecutionFailedEventAttributes)2 ChildWorkflowExecutionFailedCause (com.uber.cadence.ChildWorkflowExecutionFailedCause)1 WorkflowExecution (com.uber.cadence.WorkflowExecution)1 WorkflowType (com.uber.cadence.WorkflowType)1 ChildWorkflowTerminatedException (com.uber.cadence.workflow.ChildWorkflowTerminatedException)1 ChildWorkflowTimedOutException (com.uber.cadence.workflow.ChildWorkflowTimedOutException)1 SignalExternalWorkflowException (com.uber.cadence.workflow.SignalExternalWorkflowException)1 StartChildWorkflowFailedException (com.uber.cadence.workflow.StartChildWorkflowFailedException)1 CancellationException (java.util.concurrent.CancellationException)1