use of com.uber.cadence.internal.testservice.StateMachines.TimerData in project cadence-client by uber-java.
the class TestWorkflowMutableStateImpl method processCancelTimer.
private void processCancelTimer(RequestContext ctx, CancelTimerDecisionAttributes d, long decisionTaskCompletedId) throws InternalServiceError {
String timerId = d.getTimerId();
StateMachine<TimerData> timer = timers.get(timerId);
if (timer == null) {
CancelTimerFailedEventAttributes failedAttr = new CancelTimerFailedEventAttributes().setTimerId(timerId).setCause("TIMER_ID_UNKNOWN").setDecisionTaskCompletedEventId(decisionTaskCompletedId);
HistoryEvent cancellationFailed = new HistoryEvent().setEventType(EventType.CancelTimerFailed).setCancelTimerFailedEventAttributes(failedAttr);
ctx.addEvent(cancellationFailed);
return;
}
timer.action(StateMachines.Action.CANCEL, ctx, d, decisionTaskCompletedId);
timers.remove(timerId);
}
Aggregations