Search in sources :

Example 1 with ChildWorkflowTimedOutException

use of com.uber.cadence.workflow.ChildWorkflowTimedOutException in project cadence-client by uber-java.

the class WorkflowDecisionContext method handleChildWorkflowExecutionTimedOut.

void handleChildWorkflowExecutionTimedOut(HistoryEvent event) {
    ChildWorkflowExecutionTimedOutEventAttributes attributes = event.getChildWorkflowExecutionTimedOutEventAttributes();
    WorkflowExecution execution = attributes.getWorkflowExecution();
    String workflowId = execution.getWorkflowId();
    if (decisions.handleChildWorkflowExecutionClosed(workflowId)) {
        OpenChildWorkflowRequestInfo scheduled = scheduledExternalWorkflows.remove(workflowId);
        if (scheduled != null) {
            RuntimeException failure = new ChildWorkflowTimedOutException(event.getEventId(), execution, attributes.getWorkflowType());
            BiConsumer<byte[], Exception> completionCallback = scheduled.getCompletionCallback();
            completionCallback.accept(null, failure);
        }
    }
}
Also used : WorkflowExecution(com.uber.cadence.WorkflowExecution) ChildWorkflowTimedOutException(com.uber.cadence.workflow.ChildWorkflowTimedOutException) ChildWorkflowExecutionTimedOutEventAttributes(com.uber.cadence.ChildWorkflowExecutionTimedOutEventAttributes) 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)

Aggregations

ChildWorkflowExecutionTimedOutEventAttributes (com.uber.cadence.ChildWorkflowExecutionTimedOutEventAttributes)1 WorkflowExecution (com.uber.cadence.WorkflowExecution)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