} else if (planningEntityDescriptor.isInitialized(planningEntity)) {
if (resetInitializedPlanningEntities) { // TODO this should be extracted to a custom solver phase before this phase
ScoreDirector scoreDirector = phaseScope.getScoreDirector();
scoreDirector.beforeEntityRemoved(planningEntity);
planningEntityDescriptor.uninitialize(planningEntity);
scoreDirector.afterEntityRemoved(planningEntity);
} else {
// Do not plan the initialized planning entity
it.remove();
}
}