Package org.libreplan.business.planner.entities

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


                .asList(hoursGroup));
        return Task.createTask(taskSource);
    }

    public static Task createValidTaskWithFullProgress(){
        Task task = createValidTask();
        task.setAdvancePercentage(BigDecimal.ONE);
        return task;
    }
View Full Code Here


    @Test
    @Transactional
    public void testIsLimiting() {
        LimitingResourceQueueElement element = LimitingResourceQueueElement.create();
        Task task = createValidTask();
        SpecificResourceAllocation resourceAllocation = SpecificResourceAllocation.create(task);
        resourceAllocation.setLimitingResourceQueueElement(element);
        task.addResourceAllocation(resourceAllocation);
        assertTrue(task.getLimitingResourceAllocations().size() == 1);
    }
View Full Code Here

    }

    @Test
    @Transactional
    public void testIsNonLimiting() {
        Task task = createValidTask();
        SpecificResourceAllocation resourceAllocation = SpecificResourceAllocation.create(task);
        task.addResourceAllocation(resourceAllocation);
        assertTrue(task.getNonLimitingResourceAllocations().size() == 1);
    }
View Full Code Here

    }

    @Test
    @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());
View Full Code Here

    }

    @Test
    @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)));
View Full Code Here

        return result;
    }

    private LimitingResourceQueueElementDTO toLimitingResourceQueueElementDTO(
            LimitingResourceQueueElement element) {
        final Task task = element.getResourceAllocation().getTask();
        final Order order = limitingResourceQueueModel.getOrderByTask(task);
        return new LimitingResourceQueueElementDTO(element, order
                .getName(), task.getName(), element
                .getEarliestStartDateBecauseOfGantt());
    }
View Full Code Here

    public void editResourceAllocation(
            LimitingResourceQueueElement oldElement) {

        try {
            Task task = oldElement.getTask();

            EditTaskController editTaskController = getEditController(editTaskWindow);
            editTaskController.showEditFormResourceAllocationFromLimitingResources(task);

            // New resource allocation or resource allocation modified ?
View Full Code Here

            this.taskSource = taskSource;
        }

        @Override
        public TaskElement apply(IOptionalPersistence persistence) {
            Task result = Task.createTask(taskSource);
            taskSource.setTask(result);
            persistence.save(taskSource);
            return result;
        }
View Full Code Here

        element.setStartHour(startTime.getHour());
        element.setEndDate(endTime.getDate());
        element.setEndHour(endTime.getHour());

        // Update starting and ending dates for associated Task
        Task task = element.getResourceAllocation().getTask();
        updateStartingAndEndingDate(task, convert(startTime), convert(endTime));
    }
View Full Code Here

        }
        toBeRemoved.clear();
    }

    private void removeQueueElement(LimitingResourceQueueElement element) {
        Task task = getAssociatedTask(element);
        removeQueueDependenciesIfAny(task);
        removeQueueElementById(element.getId());
    }
View Full Code Here

TOP

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

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.