}
}
}
void handleScheduleActivityTaskFailed(HistoryEvent event) {
ScheduleActivityTaskFailedEventAttributes attributes = event.getScheduleActivityTaskFailedEventAttributes();
String activityId = attributes.getActivityId();
OpenRequestInfo<String, ActivityType> scheduled = scheduledActivities.remove(activityId);
if (decisions.handleScheduleActivityTaskFailed(event)) {
String cause = attributes.getCause();
ScheduleActivityTaskFailedException failure = new ScheduleActivityTaskFailedException(event.getEventId(),
attributes.getActivityType(), activityId, cause);
ExternalTaskCompletionHandle completionHandle = scheduled.getCompletionHandle();
completionHandle.fail(failure);
}
}