Search in sources :

Example 1 with WorkflowExecutionSignaledEventAttributes

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

the class TestWorkflowMutableStateImpl method addExecutionSignaledByExternalEvent.

private void addExecutionSignaledByExternalEvent(RequestContext ctx, SignalExternalWorkflowExecutionDecisionAttributes d) {
    WorkflowExecutionSignaledEventAttributes a = new WorkflowExecutionSignaledEventAttributes().setInput(startRequest.getInput()).setInput(d.getInput()).setSignalName(d.getSignalName());
    HistoryEvent executionSignaled = new HistoryEvent().setEventType(EventType.WorkflowExecutionSignaled).setWorkflowExecutionSignaledEventAttributes(a);
    ctx.addEvent(executionSignaled);
}
Also used : WorkflowExecutionSignaledEventAttributes(com.uber.cadence.WorkflowExecutionSignaledEventAttributes) HistoryEvent(com.uber.cadence.HistoryEvent)

Example 2 with WorkflowExecutionSignaledEventAttributes

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

the class TestWorkflowMutableStateImpl method addExecutionSignaledEvent.

private void addExecutionSignaledEvent(RequestContext ctx, SignalWorkflowExecutionRequest signalRequest) {
    WorkflowExecutionSignaledEventAttributes a = new WorkflowExecutionSignaledEventAttributes().setInput(startRequest.getInput()).setIdentity(signalRequest.getIdentity()).setInput(signalRequest.getInput()).setSignalName(signalRequest.getSignalName());
    HistoryEvent executionSignaled = new HistoryEvent().setEventType(EventType.WorkflowExecutionSignaled).setWorkflowExecutionSignaledEventAttributes(a);
    ctx.addEvent(executionSignaled);
}
Also used : WorkflowExecutionSignaledEventAttributes(com.uber.cadence.WorkflowExecutionSignaledEventAttributes) HistoryEvent(com.uber.cadence.HistoryEvent)

Example 3 with WorkflowExecutionSignaledEventAttributes

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

the class ReplayDecider method handleWorkflowExecutionSignaled.

private void handleWorkflowExecutionSignaled(HistoryEvent event) {
    assert (event.getEventType() == EventType.WorkflowExecutionSignaled);
    final WorkflowExecutionSignaledEventAttributes signalAttributes = event.getWorkflowExecutionSignaledEventAttributes();
    if (completed) {
        throw new IllegalStateException("Signal received after workflow is closed.");
    }
    this.workflow.handleSignal(signalAttributes.getSignalName(), signalAttributes.getInput(), event.getEventId());
}
Also used : WorkflowExecutionSignaledEventAttributes(com.uber.cadence.WorkflowExecutionSignaledEventAttributes)

Aggregations

WorkflowExecutionSignaledEventAttributes (com.uber.cadence.WorkflowExecutionSignaledEventAttributes)3 HistoryEvent (com.uber.cadence.HistoryEvent)2