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);
}
}
}
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);
}
Aggregations