Package org.libreplan.business.planner.entities

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


        Order order = project.order;

        TaskSource taskSource = TaskSource.createForGroup(order
                .getCurrentSchedulingDataForVersion());

        TaskGroup taskGroup = taskSource
                .createTaskGroupWithoutDatesInitializedAndLinkItToTaskSource();

        BaseCalendar calendar = configurationDAO.getConfiguration()
                .getDefaultCalendar();

        taskGroup.setCalendar(calendar);

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

        for (OrderElementDTO importTask : project.tasks) {

            taskElements.add(createTask(importTask, importCalendar));

        }

        for (MilestoneDTO milestone : project.milestones) {

            taskElements.add(createTaskMilestone(milestone));

        }

        for (TaskElement taskElement : taskElements) {
            taskGroup.addTaskElement(taskElement);
        }

        return taskGroup;

    }
View Full Code Here


    @Transactional
    public void taskIsBlockedIfHasAnUnfinishedEndStartDependencyUsingGroup() {
         Task task1 = createValidTaskWithFullProgress();
         Task task2 = createValidTask();
         task2.setAdvancePercentage(new BigDecimal("0.0001", new MathContext(4)));
         TaskGroup taskGroup = new TaskGroup();
         taskGroup.addTaskElement(task1);
         taskGroup.addTaskElement(task2);
         mockDependency(taskGroup, this.task, Type.END_START);
         assertFalse(task.isFinished());
         assertFalse(task.isInProgress());
         assertTrue(task.getTaskStatus() == TaskStatusEnum.BLOCKED);
    }
View Full Code Here

    @Transactional
    public void taskDependenciesDontMatterIfProgressIsNotZero() {
         Task task1 = createValidTaskWithFullProgress();
         Task task2 = createValidTask();
         task2.setAdvancePercentage(new BigDecimal("0.0001", new MathContext(4)));
         TaskGroup taskGroup = new TaskGroup();
         taskGroup.addTaskElement(task1);
         taskGroup.addTaskElement(task2);
         mockDependency(taskGroup, this.task, Type.END_START);
         task.setAdvancePercentage(new BigDecimal("0.0001", new MathContext(4)));
         assertFalse(task.isFinished());
         assertTrue(task.getTaskStatus() == TaskStatusEnum.IN_PROGRESS);
         task.setAdvancePercentage(BigDecimal.ONE);
View Full Code Here

        }

        @Override
        protected TaskElement apply(List<TaskElement> children,
                IOptionalPersistence persistence) {
            TaskGroup result = TaskGroup.create(taskSource);
            for (TaskElement taskElement : children) {
                result.addTaskElement(taskElement);
            }
            taskSource.setTask(result);
            persistence.save(taskSource);
            return result;
        }
View Full Code Here

        }

        @Override
        protected TaskElement apply(List<TaskElement> children,
                IOptionalPersistence persistence) {
            TaskGroup taskGroup = (TaskGroup) taskSource.getTask();
            taskGroup.setTaskChildrenTo(children);
            updateTaskWithOrderElement(taskGroup, taskSource.getOrderElement());
            persistence.save(taskSource);
            return taskGroup;
        }
View Full Code Here

        return result;
    }

    public List<TaskElement> getAssociatedTasks() {
        ArrayList<TaskElement> result = new ArrayList<TaskElement>();
        TaskGroup taskGroup = getAssociatedTaskElement();
        if (taskGroup != null) {
            result.addAll(taskGroup.getChildren());
        }
        return result;
    }
View Full Code Here

        taskElementDAO.reattach(task);

        Position taskPosition = context.getMapper().findPositionFor(task);
        int insertAt = taskPosition.getInsertionPosition() + 1;

        TaskGroup parent = task.getParent();
        parent.addTaskElement(insertAt, milestone);
        context.add(taskPosition.sameLevelAt(insertAt), milestone);
    }
View Full Code Here

        OrderDTO importData = calendarImporterMPXJ.getOrderDTO(file);

        Order order = orderImporterMPXJ.convertImportDataToOrder(importData,
                true);

        TaskGroup taskGroup = orderImporterMPXJ.createTask(importData, true);

        List<Dependency> dependencies = orderImporterMPXJ
                .createDependencies(importData);

        orderImporterMPXJ.storeOrder(order, taskGroup, dependencies);
View Full Code Here

        OrderDTO importData = orderImporterMPXJ.getImportData(streamData, file);

        Order order = orderImporterMPXJ.convertImportDataToOrder(importData,
                false);

        TaskGroup taskGroup = orderImporterMPXJ.createTask(importData, false);

        List<Dependency> dependencies = orderImporterMPXJ
                .createDependencies(importData);

        orderImporterMPXJ.storeOrder(order, taskGroup, dependencies);
View Full Code Here

            }
            updateParentsPositions(task);
        }

        private void updateParentsPositions(TaskElement task) {
            TaskGroup current = task.getParent();
            while (current != null) {
                current.fitStartAndEndDatesToChildren();
                current = current.getParent();
            }
        }
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.