});
}
private List<TaskElement> criticalPathFor(PlanningState state,
IResourcesSearcher resourcesSearcher) {
final Order order = state.getOrder();
final Scenario currentScenario = state.getCurrentScenario();
IAdapter<TaskElement, DependencyWithVisibility> adapter = TemplateModelAdapter
.create(currentScenario, asLocalDate(order.getInitDate()),
asLocalDate(order.getDeadline()), resourcesSearcher);
GanttDiagramGraph<TaskElement, DependencyWithVisibility> graph = GanttDiagramBuilder
.createForcingDependencies(order, adapter);
CriticalPathCalculator<TaskElement, DependencyWithVisibility> criticalPathCalculator = CriticalPathCalculator
.create(order.getDependenciesConstraintsHavePriority());
return criticalPathCalculator.calculateCriticalPath(graph);
}