Examples of TaskGroup


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

            }});
    }

    @Test
    public void aTaskGroupCanBeRemovedFromItsTaskSourceIfBelowTasksSourcesAreRemovedFirst() {
        final TaskGroup taskGroupWithOneChild = transactionService
                .runOnTransaction(new IOnTransaction<TaskGroup>() {

                    @Override
                    public TaskGroup execute() {
                        TaskGroup taskGroup = createValidTaskGroup();
                        Task task = createValidTask();
                        taskGroup.addTaskElement(task);
                        return taskGroup;
                    }
                });
        transactionService.runOnTransaction(new IOnTransaction<Void>() {
View Full Code Here

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

            new IOnTransaction<Long>() {

            @Override
            public Long execute() {
                Task task = createValidTask();
                TaskGroup taskGroup = createValidTaskGroup();
                taskGroup.addTaskElement(task);

                SpecificResourceAllocation allocation =
                    SpecificResourceAllocation.create(task);
                allocation.setResource(createValidWorker());
                LocalDate start = task.getStartAsLocalDate();
View Full Code Here

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

    }

    @Test
    @Transactional
    public void detachRemovesTaskFromParent() {
        TaskGroup parent = TaskGroupTest.createValidTaskGroup();
        Task child = (Task) TaskTest.createValidTask();
        Task anotherChild = (Task) TaskTest.createValidTask();
        parent.addTaskElement(child);
        parent.addTaskElement(anotherChild);
        child.detach();
        assertThat(parent.getChildren().size(), equalTo(1));
    }
View Full Code Here

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

    @Test
    public void taskGroupIsInProgressIifAnyTaskisInProgress() {
        Task task1 = TaskTest.createValidTaskWithFullProgress();
        Task task2 = TaskTest.createValidTaskWithFullProgress();
        TaskGroup taskGroup = new TaskGroup();
        taskGroup.addTaskElement(task1);
        taskGroup.addTaskElement(task2);
        assertFalse(taskGroup.isInProgress());
        task2.setAdvancePercentage(new BigDecimal("0.0001", new MathContext(4)));
        task2.resetStatus();
        taskGroup.resetStatus();
        assertTrue(taskGroup.isInProgress());
    }
View Full Code Here

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

        order.add(orderLine);
        SchedulingDataForVersion version = TaskElementTest
                .mockSchedulingDataForVersion(orderLine);
        TaskSource taskSource = TaskSource.create(version, Arrays
                .asList(hoursGroup));
        TaskGroup result = TaskGroup.create(taskSource);
        result.setIntraDayEndDate(IntraDayDate.startOfDay(result
                .getIntraDayStartDate().getDate().plusDays(10)));
        return result;
    }
View Full Code Here

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

            order.calculateAndSetTotalHours();
            checkConstraintOrderUniqueCode(order);
            checkConstraintHoursGroupUniqueCode(order);
            state.synchronizeTrees();

            TaskGroup rootTask = state.getRootTask();

            if (rootTask != null) {
                // This reattachment is needed to ensure that the root task in
                // the state is the one associated to the transaction's session.
                // Otherwise if some order element has been removed, when doing
View Full Code Here

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

            List<TaskElement> parentsWithChangesToSave = new ArrayList<TaskElement>();
            for (TaskElement taskElement : toRemove) {
                try {
                    taskElementDAO.remove(taskElement.getId());

                    TaskGroup parent = taskElement.getParent();
                    if (parent != null && !toRemove.contains(parent)) {
                        parent.remove(taskElement);
                        parentsWithChangesToSave.add(parent);
                    }

                    LOG.info("TaskElement removed because of TaskSource was null. "
                            + taskElement);
View Full Code Here

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

                }
            }
        }

        private void updateTasksRelatedData() {
            TaskGroup rootTask = state.getRootTask();
            if (rootTask == null) {
                return;
            }
            for (TaskElement taskElement : rootTask.getChildren()) {
                removeEmptyConsolidation(taskElement);
                updateLimitingResourceQueueElementDates(taskElement);
                if (taskElement.getTaskSource() != null
                        && taskElement.getTaskSource().isNewObject()) {
                    saveTaskSources(taskElement);
View Full Code Here

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

            }
            saveRootTask();
        }

        private void saveRootTask() {
            TaskGroup rootTask = state.getRootTask();
            updateRootTaskPosition(rootTask);
            taskElementDAO.save(rootTask);
        }
View Full Code Here

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

        Scenario currentScenario = scenarioManager.getCurrent();
        final List<Resource> allResources = resourceDAO.list(Resource.class);
        criterionDAO.list(Criterion.class);

        forceLoadOfOrderAssociatedData(orderReloaded);
        TaskGroup rootTask = orderReloaded.getAssociatedTaskElement();
        if (rootTask != null) {
            forceLoadOf(rootTask);
            forceLoadDayAssignments(orderReloaded
                    .getResources(FilterType.KEEP_ALL));
            forceLoadOfDepedenciesCollections(rootTask);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.