Search in sources :

Example 1 with TimerCanceledEventAttributes

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

the class StateMachines method cancelTimer.

private static void cancelTimer(RequestContext ctx, TimerData data, CancelTimerDecisionAttributes d, long decisionTaskCompletedEventId) {
    TimerCanceledEventAttributes a = new TimerCanceledEventAttributes().setDecisionTaskCompletedEventId(decisionTaskCompletedEventId).setTimerId(d.getTimerId()).setStartedEventId(data.startedEventId);
    HistoryEvent event = new HistoryEvent().setEventType(EventType.TimerCanceled).setTimerCanceledEventAttributes(a);
    ctx.addEvent(event);
}
Also used : HistoryEvent(com.uber.cadence.HistoryEvent) TimerCanceledEventAttributes(com.uber.cadence.TimerCanceledEventAttributes)

Example 2 with TimerCanceledEventAttributes

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

the class DecisionsHelper method handleTimerCanceled.

boolean handleTimerCanceled(HistoryEvent event) {
    TimerCanceledEventAttributes attributes = event.getTimerCanceledEventAttributes();
    DecisionStateMachine decision = getDecision(new DecisionId(DecisionTarget.TIMER, attributes.getTimerId()));
    decision.handleCancellationEvent();
    return decision.isDone();
}
Also used : TimerCanceledEventAttributes(com.uber.cadence.TimerCanceledEventAttributes)

Example 3 with TimerCanceledEventAttributes

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

the class ClockDecisionContext method handleTimerCanceled.

void handleTimerCanceled(HistoryEvent event) {
    TimerCanceledEventAttributes attributes = event.getTimerCanceledEventAttributes();
    String timerId = attributes.getTimerId();
    if (decisions.handleTimerCanceled(event)) {
        timerCancelled(timerId, null);
    }
}
Also used : TimerCanceledEventAttributes(com.uber.cadence.TimerCanceledEventAttributes)

Aggregations

TimerCanceledEventAttributes (com.uber.cadence.TimerCanceledEventAttributes)3 HistoryEvent (com.uber.cadence.HistoryEvent)1