}
}
}
void handleActivityTaskTimedOut(HistoryEvent event) {
ActivityTaskTimedOutEventAttributes attributes = event.getActivityTaskTimedOutEventAttributes();
String activityId = decisions.getActivityId(attributes);
if (decisions.handleActivityTaskClosed(activityId)) {
OpenRequestInfo<String, ActivityType> scheduled = scheduledActivities.remove(activityId);
if (scheduled != null) {
String timeoutType = attributes.getTimeoutType();
String details = attributes.getDetails();
ActivityTaskTimedOutException failure = new ActivityTaskTimedOutException(event.getEventId(),
scheduled.getUserContext(), activityId, timeoutType, details);
ExternalTaskCompletionHandle completionHandle = scheduled.getCompletionHandle();
completionHandle.fail(failure);
}