Package org.libreplan.business.planner.entities

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


        List<TaskElement> result = new ArrayList<TaskElement>();

        List<Order> list = getOrders(predicate);
        for (Order order : list) {
            order.useSchedulingDataFor(currentScenario, false);
            TaskGroup associatedTaskElement = order.getAssociatedTaskElement();

            if (associatedTaskElement != null) {
                if (predicate != null) {
                    // If predicate includeChildren then we check if it accepts
                    // the element
                    if (!predicate.accepts(associatedTaskElement)) {
                        // If it doesn't accept the element we move on to the
                        // next order
                        continue;
                    }
                }
                // If predicate doesn't includeChildren then the orders where
                // already filtered in the DB query.
                // Otherwise they've been filtered with the predicate above, and
                // if they didn't pass the filter the execution doesn't reach
                // this point.
                associatedTaskElement.setSimplifiedAssignedStatusCalculationEnabled(true);
                result.add(associatedTaskElement);
            }
        }
        Collections.sort(result,new Comparator<TaskElement>(){
            @Override
View Full Code Here


            }
            List<Order> list = orderDAO.getOrdersByReadAuthorizationByScenario(
                    SecurityUtils.getSessionUserLoginName(), currentScenario);
            for (Order each : list) {
                each.useSchedulingDataFor(currentScenario, false);
                TaskGroup associatedTaskElement = each
                        .getAssociatedTaskElement();
                if (associatedTaskElement != null
                        && STATUS_VISUALIZED.contains(each.getState())) {
                    if (calculateStartDate) {
                        startDate = Collections.min(notNull(startDate,
                                each.getInitDate(),
                                associatedTaskElement.getStartDate()));
                    }
                    if (calculateEndDate) {
                        endDate = Collections.max(notNull(endDate,
                                each.getDeadline(),
                                associatedTaskElement.getEndDate()));
                    }
                }
            }
        }
        filterStartDate = startDate != null ? LocalDate
View Full Code Here

    }

    private List<Task> getDestinations(TaskElement task) {
        Set<Task> result = new HashSet<Task>();
        Set<Dependency> dependencies = getOutgoingDependencies(task);
        TaskGroup parent = task.getParent();
        if (parent != null) {
            if (parent.getEndDate().equals(task.getEndDate())) {
                result.addAll(getDestinations((task.getParent())));
            }
        }
        for (Dependency each : dependencies) {
            TaskElement destination = each.getDestination();
View Full Code Here

        }
        return result;
    }

    private boolean noneParentHasIncomingDependencies(Task each) {
        TaskGroup parent = each.getParent();
        while (parent != null && getIncomingDependencies(parent).isEmpty()) {
            parent = parent.getParent();
        }
        return (parent == null);
    }
View Full Code Here

        }

        @Override
        public void doRemovalOf(TaskElement taskElement) {
            taskElement.detach();
            TaskGroup parent = taskElement.getParent();
            if (parent != null) {
                parent.remove(taskElement);
            }
        }
View Full Code Here

                .get(TaskDeadlineViolationStatusEnum.NO_DEADLINE);
    }

    /* Progress KPI: "Global Progress of the Project" */
    private void calculateGlobalProgress() {
        TaskGroup rootTask = getRootTask();
        if (rootTask == null) {
            throw new RuntimeException("Root task is null");
        }
        rootTask.updateCriticalPathProgress(criticalPath);
    }
View Full Code Here

        }
        if (this.currentOrder.getDeadline() == null) {
            this.marginWithDeadLine = null;
            return;
        }
        TaskGroup rootTask = getRootTask();
        LocalDate endDate = TaskElement.maxDate(rootTask.getChildren())
                .asExclusiveEnd();
        Days orderDuration = Days.daysBetween(
                TaskElement.minDate(rootTask.getChildren()).getDate(), endDate);

        LocalDate deadLineAsLocalDate = LocalDate.fromDateFields(currentOrder
                .getDeadline());
        Days deadlineOffset = Days.daysBetween(endDate,
                deadLineAsLocalDate.plusDays(1));
View Full Code Here

        this.name = name;
    }

    @Override
    public boolean accepts(Object object) {
        final TaskGroup taskGroup = (TaskGroup) object;
        return accepts(taskGroup);
    }
View Full Code Here

        }

        private void removeChildTask(OrderElement removedChild) {
            TaskSource taskSource = removedChild.getTaskSource();
            TaskElement childTask = taskSource.getTask();
            TaskGroup group = (TaskGroup) getThis().getTaskSource()
                    .getTask();
            group.remove(childTask);
            childTask.detachDependencies();
        }
View Full Code Here

        LocalDate start = new LocalDate(2000, 10, 20);
        child1.setIntraDayStartDate(IntraDayDate.startOfDay(start));
        child1.setIntraDayEndDate(IntraDayDate.startOfDay(start.plusDays(10)));
        taskGroup.addTaskElement(child1);

        TaskGroup child2 = createValidTaskGroup();
        taskGroup.addTaskElement(child2);

        List<TaskElement> taskElements = taskGroup.getChildren();
        assertThat(taskElements.size(), equalTo(2));
        assertThat(taskGroup.getChildren(), equalTo(Arrays.asList(child1,
View Full Code Here

TOP

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

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.