use of com.uber.cadence.CancelTimerFailedEventAttributes 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);
}
use of com.uber.cadence.CancelTimerFailedEventAttributes in project cadence-client by uber-java.
the class DecisionsHelper method handleCancelTimerFailed.
boolean handleCancelTimerFailed(HistoryEvent event) {
CancelTimerFailedEventAttributes attributes = event.getCancelTimerFailedEventAttributes();
DecisionStateMachine decision = getDecision(new DecisionId(DecisionTarget.TIMER, attributes.getTimerId()));
decision.handleCancellationFailureEvent(event);
return decision.isDone();
}
Aggregations