Search in sources :

Example 1 with ExternalWorkflowExecutionSignaledEventAttributes

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

the class WorkflowDecisionContext method handleExternalWorkflowExecutionSignaled.

void handleExternalWorkflowExecutionSignaled(HistoryEvent event) {
    ExternalWorkflowExecutionSignaledEventAttributes attributes = event.getExternalWorkflowExecutionSignaledEventAttributes();
    String signalId = decisions.getSignalIdFromExternalWorkflowExecutionSignaled(attributes.getInitiatedEventId());
    if (decisions.handleExternalWorkflowExecutionSignaled(signalId)) {
        OpenRequestInfo<Void, Void> signalContextAndResult = scheduledSignals.remove(signalId);
        if (signalContextAndResult != null) {
            signalContextAndResult.getCompletionCallback().accept(null, null);
        }
    }
}
Also used : ExternalWorkflowExecutionSignaledEventAttributes(com.uber.cadence.ExternalWorkflowExecutionSignaledEventAttributes)

Example 2 with ExternalWorkflowExecutionSignaledEventAttributes

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

the class StateMachines method completeExternalSignal.

private static void completeExternalSignal(RequestContext ctx, SignalExternalData data, String runId, long notUsed) {
    SignalExternalWorkflowExecutionInitiatedEventAttributes initiatedEvent = data.initiatedEvent;
    WorkflowExecution signaledExecution = initiatedEvent.getWorkflowExecution().deepCopy().setRunId(runId);
    ExternalWorkflowExecutionSignaledEventAttributes a = new ExternalWorkflowExecutionSignaledEventAttributes().setInitiatedEventId(data.initiatedEventId).setWorkflowExecution(signaledExecution).setControl(initiatedEvent.getControl()).setDomain(initiatedEvent.getDomain());
    HistoryEvent event = new HistoryEvent().setEventType(EventType.ExternalWorkflowExecutionSignaled).setExternalWorkflowExecutionSignaledEventAttributes(a);
    ctx.addEvent(event);
}
Also used : ExternalWorkflowExecutionSignaledEventAttributes(com.uber.cadence.ExternalWorkflowExecutionSignaledEventAttributes) WorkflowExecution(com.uber.cadence.WorkflowExecution) HistoryEvent(com.uber.cadence.HistoryEvent) SignalExternalWorkflowExecutionInitiatedEventAttributes(com.uber.cadence.SignalExternalWorkflowExecutionInitiatedEventAttributes)

Aggregations

ExternalWorkflowExecutionSignaledEventAttributes (com.uber.cadence.ExternalWorkflowExecutionSignaledEventAttributes)2 HistoryEvent (com.uber.cadence.HistoryEvent)1 SignalExternalWorkflowExecutionInitiatedEventAttributes (com.uber.cadence.SignalExternalWorkflowExecutionInitiatedEventAttributes)1 WorkflowExecution (com.uber.cadence.WorkflowExecution)1