Package org.libreplan.business.planner.entities

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


    @Transactional
    public void ifNoParentWithStartDateThePositionConstraintIsSoonAsPossible() {
        OrderLine orderLine = OrderLine.create();
        addOrderTo(orderLine);
        TaskSource taskSource = asTaskSource(orderLine);
        Task task = Task.createTask(taskSource);
        assertThat(task.getPositionConstraint(),
                isOfType(PositionConstraintType.AS_SOON_AS_POSSIBLE));
    }
View Full Code Here


        addOrderTo(group);
        group.setInitDate(asDate(initDate));
        OrderLine orderLine = OrderLine.create();
        group.add(orderLine);
        TaskSource taskSource = asTaskSource(orderLine);
        Task task = Task.createTask(taskSource);
        assertThat(task.getPositionConstraint(), allOf(
                isOfType(PositionConstraintType.START_NOT_EARLIER_THAN),
                hasValue(initDate)));
    }
View Full Code Here

        addOrderTo(orderLine);
        Order order = orderLine.getOrder();
        Date initDate = asDate(new LocalDate(2005, 10, 5));
        order.setInitDate(initDate);
        TaskSource taskSource = asTaskSource(orderLine);
        Task task = Task.createTask(taskSource);
        assertThat(task.getPositionConstraint(),
                isOfType(PositionConstraintType.AS_SOON_AS_POSSIBLE));
    }
View Full Code Here

    public void doAction(IContextWithPlannerTask<TaskElement> context,
            TaskElement taskElement) {
        editTaskUtilities.reattach(taskElement);

        if (isApplicableTo(taskElement)) {
            Task task = (Task) taskElement;
            if (task.isSubcontracted()) {
                editTaskController.showEditFormSubcontract(context, task,
                        planningState);
            } else {
                editTaskController.showEditFormResourceAllocation(context,
                        task, planningState);
View Full Code Here

            Util.ensureUniqueListeners(taskWorkableDays, Events.ON_CHANGE,
                    new EventListener() {

                        @Override
                        public void onEvent(Event event) {
                            Task task = getTask();
                            Integer workableDays = taskWorkableDays.getValue();
                            if (allocationRowsHandler.isForwardsAllocation()) {
                                IntraDayDate newEnd = ensureItIsAfterConsolidation(task
                                        .calculateEndGivenWorkableDays(workableDays));
                                updateWorkableDaysIfNecessary(workableDays,
                                        getTask().getIntraDayStartDate(),
                                        newEnd);
                                taskPropertiesController
                                        .updateTaskEndDate(newEnd.getDate());
                                showValueOfDateOn(labelTaskEnd,
                                        newEnd.getDate());
                            } else {
                                IntraDayDate newStart = ensureItIsAfterConsolidation(task
                                        .calculateStartGivenWorkableDays(workableDays));
                                updateWorkableDaysIfNecessary(workableDays,
                                        newStart, task.getIntraDayEndDate());
                                taskPropertiesController
                                        .updateTaskStartDate(newStart.getDate());
                                showValueOfDateOn(labelTaskStart,
                                        newStart.getDate());
                            }
View Full Code Here

                    .getCalculatedValue() == CalculatedValue.END_DATE
                    || isAnyManual() || isTaskUpdatedFromTimesheets());
        }

        private void initializeDateAndDurationFieldsFromTaskOriginalValues() {
            Task task = getTask();
            showValueOfDateOn(labelTaskStart, task.getStartAsLocalDate());
            showValueOfDateOn(labelTaskEnd, task.getEndAsLocalDate());

            taskWorkableDays.setConstraint(positiveValueRequired());
            taskWorkableDays.setValue(task.getWorkableDays());
        }
View Full Code Here

        private void initializeDateAndDurationFieldsFromLastValues() {
            if (lastSpecifiedWorkableDays == null) {
                initializeDateAndDurationFieldsFromTaskOriginalValues();
            } else {
                Task task = getTask();
                taskWorkableDays.setConstraint(positiveValueRequired());
                taskWorkableDays.setValue(lastSpecifiedWorkableDays);
                showValueOfDateOn(
                        labelTaskEnd,
                        task.calculateEndGivenWorkableDays(
                                lastSpecifiedWorkableDays).getDate());
                lastSpecifiedWorkableDays = null;
            }
        }
View Full Code Here

     * @param element
     * @return
     */
    private DateAndHour calculateLatestPlanningDate(LimitingResourceQueueElement element) {
        IntraDayDate result = null;
        Task task = element.getTask();

        for (Dependency each : task.getDependenciesWithThisOrigin()) {
            TaskElement destination = each.getDestination();
            result = (result == null) ? destination.getIntraDayStartDate()
                    : IntraDayDate.min(result,
                            destination.getIntraDayStartDate());
        }
View Full Code Here

    }

    private void setStartInFixedDateConstarint(TaskElement taskElement,
            Date startDate) {
        if (taskElement.isTask()) {
            Task task = (Task) taskElement;
            task.getPositionConstraint()
                    .update(PositionConstraintType.START_IN_FIXED_DATE,
                            IntraDayDate.startOfDay(LocalDate
                                    .fromDateFields(startDate)));
        }
    }
View Full Code Here

    public void createSubcontractorCommunicationWithNewProgress(OrderElement orderElement,
            Set<AdvanceMeasurementDTO> advanceMeasurementDTOs) throws InstanceNotFoundException {
        if (orderElement != null && orderElement.getTaskSource() != null
                && orderElement.getTaskSource().getTask().isSubcontracted()) {
            Task task = (Task) orderElement.getTaskSource().getTask();
            SubcontractedTaskData subcontractedTaskData = task.getSubcontractedTaskData();
            if (subcontractedTaskData != null) {
                SubcontractorCommunication subcontractorCommunication = SubcontractorCommunication
                        .create(subcontractedTaskData, CommunicationType.PROGRESS_UPDATE,
                                new Date(), false);
View Full Code Here

TOP

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

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.