use of com.uber.cadence.TimerStartedEventAttributes in project cadence-client by uber-java.
the class DecisionsHelper method handleTimerStarted.
boolean handleTimerStarted(HistoryEvent event) {
TimerStartedEventAttributes attributes = event.getTimerStartedEventAttributes();
DecisionStateMachine decision = getDecision(new DecisionId(DecisionTarget.TIMER, attributes.getTimerId()));
decision.handleInitiatedEvent(event);
return decision.isDone();
}
use of com.uber.cadence.TimerStartedEventAttributes in project cadence-client by uber-java.
the class StateMachines method startTimer.
private static void startTimer(RequestContext ctx, TimerData data, StartTimerDecisionAttributes d, long decisionTaskCompletedEventId) {
TimerStartedEventAttributes a = new TimerStartedEventAttributes().setDecisionTaskCompletedEventId(decisionTaskCompletedEventId).setStartToFireTimeoutSeconds(d.getStartToFireTimeoutSeconds()).setTimerId(d.getTimerId());
HistoryEvent event = new HistoryEvent().setEventType(EventType.TimerStarted).setTimerStartedEventAttributes(a);
long startedEventId = ctx.addEvent(event);
ctx.onCommit((historySize) -> {
data.startedEvent = a;
data.startedEventId = startedEventId;
});
}
use of com.uber.cadence.TimerStartedEventAttributes in project cadence-client by uber-java.
the class ReplayDecider method handleTimerStarted.
private void handleTimerStarted(HistoryEvent event) {
TimerStartedEventAttributes attributes = event.getTimerStartedEventAttributes();
String timerId = attributes.getTimerId();
if (timerId.equals(DecisionsHelper.FORCE_IMMEDIATE_DECISION_TIMER)) {
return;
}
decisionsHelper.handleTimerStarted(event);
}
Aggregations