Package org.libreplan.business.planner.entities

Examples of org.libreplan.business.planner.entities.TaskElement


        return result;
    }

    private void allPossiblePaths(List<Task> path,
            Collection<List<Task>> allPaths) {
        TaskElement lastTask = getLastTask(path);
        List<Task> destinations = getDestinations(lastTask);
        if (!destinations.isEmpty()) {
            for (Task each : destinations) {
                allPossiblePaths(newPath(path, each), allPaths);
            }
View Full Code Here


            if (parent.getEndDate().equals(task.getEndDate())) {
                result.addAll(getDestinations((task.getParent())));
            }
        }
        for (Dependency each : dependencies) {
            TaskElement destination = each.getDestination();
            if (isTask(destination)) {
                result.add((Task) destination);
            }
            if (isTaskGroup(destination)) {
                result.addAll(taskGroupChildren((TaskGroup) destination));
View Full Code Here

            return false;
        }

        boolean result = true;
        for (Dependency each: dependencies) {
            final TaskElement taskElement = each.getOrigin();
            final BigDecimal measuredProgress = taskElement.getOrderElement()
                .getAdvancePercentage();

            final Type dependencyType = each.getType();
            if (Type.END_START.equals(dependencyType)) {
                result &= (!isFinished(measuredProgress));
View Full Code Here

            }
        }

        @Override
        public void addDependency(DomainDependency<TaskElement> dependency) {
            TaskElement source = dependency.getSource();
            TaskElement destination = dependency.getDestination();
            Type domainType = toDomainType(dependency.getType());
            Dependency.create(source, destination, domainType);
        }
View Full Code Here

            return true;
        }

        @Override
        public void removeDependency(DomainDependency<TaskElement> dependency) {
            TaskElement source = dependency.getSource();
            Type type = toDomainType(dependency.getType());
            source.removeDependencyWithDestination(dependency.getDestination(),
                    type);
        }
View Full Code Here

            initializeTask(each);
        }
    }

    private void initializeTask(OrderElement orderElement) {
        TaskElement task = orderElement.getAssociatedTaskElement();
        if (task != null) {
            taskDAO.reattach(task);
            task.getCalendar();
            initializeDependenciesFor(task);
        }
    }
View Full Code Here

    public Integer getAbsoluteMarginWithDeadLine() {
        return absoluteMarginWithDeadLine;
    }

    private void calculateAbsoluteMarginWithDeadLine() {
        TaskElement rootTask = getRootTask();
        Date deadline = currentOrder.getDeadline();

        if (rootTask == null) {
            throw new RuntimeException("Root task is null");
        }
        if (deadline == null) {
            this.absoluteMarginWithDeadLine = null;
            return;
        }
        absoluteMarginWithDeadLine = daysBetween(
                TaskElement.maxDate(rootTask.getChildren()).asExclusiveEnd(),
                LocalDate.fromDateFields(deadline).plusDays(1));
    }
View Full Code Here

    private List<Double> getTaskLagDeviations() {
        if (this.getRootTask() == null) {
            throw new RuntimeException("Root task is null");
        }
        CalculateFinishedTasksLagInCompletionVisitor visitor = new CalculateFinishedTasksLagInCompletionVisitor();
        TaskElement rootTask = getRootTask();
        rootTask.acceptVisitor(visitor);
        return visitor.getDeviations();
    }
View Full Code Here

    private List<Double> getEstimationAccuracyDeviations() {
        if (this.getRootTask() == null) {
            throw new RuntimeException("Root task is null");
        }
        CalculateFinishedTasksEstimationDeviationVisitor visitor = new CalculateFinishedTasksEstimationDeviationVisitor();
        TaskElement rootTask = getRootTask();
        rootTask.acceptVisitor(visitor);
        return visitor.getDeviations();
    }
View Full Code Here

    }

    @Override
    public Map<TaskStatusEnum, Integer> calculateTaskStatus() {
        AccumulateTasksStatusVisitor visitor = new AccumulateTasksStatusVisitor();
        TaskElement rootTask = getRootTask();
        if (this.getRootTask() == null) {
            throw new RuntimeException("Root task is null");
        }
        resetTasksStatusInGraph();
        rootTask.acceptVisitor(visitor);
        return visitor.getTaskStatusData();
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.planner.entities.TaskElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.