Search in sources :

Example 1 with SignalExternalWorkflowException

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

the class WorkflowDecisionContext method handleSignalExternalWorkflowExecutionFailed.

void handleSignalExternalWorkflowExecutionFailed(HistoryEvent event) {
    SignalExternalWorkflowExecutionFailedEventAttributes attributes = event.getSignalExternalWorkflowExecutionFailedEventAttributes();
    String signalId = new String(attributes.getControl(), StandardCharsets.UTF_8);
    if (decisions.handleSignalExternalWorkflowExecutionFailed(signalId)) {
        OpenRequestInfo<Void, Void> signalContextAndResult = scheduledSignals.remove(signalId);
        if (signalContextAndResult != null) {
            WorkflowExecution signaledExecution = new WorkflowExecution();
            signaledExecution.setWorkflowId(attributes.getWorkflowExecution().getWorkflowId());
            signaledExecution.setRunId(attributes.getWorkflowExecution().getRunId());
            RuntimeException failure = new SignalExternalWorkflowException(event.getEventId(), signaledExecution, attributes.getCause());
            signalContextAndResult.getCompletionCallback().accept(null, failure);
        }
    }
}
Also used : SignalExternalWorkflowException(com.uber.cadence.workflow.SignalExternalWorkflowException) SignalExternalWorkflowExecutionFailedEventAttributes(com.uber.cadence.SignalExternalWorkflowExecutionFailedEventAttributes) WorkflowExecution(com.uber.cadence.WorkflowExecution)

Aggregations

SignalExternalWorkflowExecutionFailedEventAttributes (com.uber.cadence.SignalExternalWorkflowExecutionFailedEventAttributes)1 WorkflowExecution (com.uber.cadence.WorkflowExecution)1 SignalExternalWorkflowException (com.uber.cadence.workflow.SignalExternalWorkflowException)1