Search in sources :

Example 1 with TimerStartedEventAttributes

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();
}
Also used : TimerStartedEventAttributes(com.uber.cadence.TimerStartedEventAttributes)

Example 2 with TimerStartedEventAttributes

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;
    });
}
Also used : TimerStartedEventAttributes(com.uber.cadence.TimerStartedEventAttributes) HistoryEvent(com.uber.cadence.HistoryEvent)

Example 3 with TimerStartedEventAttributes

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);
}
Also used : TimerStartedEventAttributes(com.uber.cadence.TimerStartedEventAttributes)

Aggregations

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