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