// Nobody listens on the specified task list. So in case of a real service it causes
// ScheduleToStart timeout.
//TODO: Activity heartbeats and passing details to the exception.
if (factory == null) {
String timeoutType = ActivityTaskTimeoutType.SCHEDULE_TO_START.toString();
throw new ActivityTaskTimedOutException(0, activityType, activityId, timeoutType, null);
}
final ActivityImplementation impl = factory.getActivityImplementation(activityType);
if (impl == null) {
String cause = ScheduleActivityTaskFailedCause.ACTIVITY_TYPE_DOES_NOT_EXIST.toString();
throw new ScheduleActivityTaskFailedException(0, activityType, activityId, cause);