Examples of useSchedulingDataFor()


Examples of org.libreplan.business.orders.entities.OrderElement.useSchedulingDataFor()

    @Test
    @Transactional
    public void ifAnOrderLineIsScheduledItsTypeChanges() {
        Order order = givenOrderFromPrepareForCreate();
        OrderElement line = OrderLine.createOrderLineWithUnfixedPercentage(20);
        line.useSchedulingDataFor(order.getCurrentOrderVersion());
        line.getSchedulingState().unschedule();
        order.add(line);
        assertFalse(order.getSchedulingState().isSomewhatScheduled());
        line.getSchedulingState().schedule();
        assertTrue(order.getSchedulingState().isSomewhatScheduled());
View Full Code Here

Examples of org.libreplan.business.orders.entities.OrderElement.useSchedulingDataFor()

            } else { // orderElementDTO instanceof OrderLineGroupDTO
                checkOrderElementDTOCode(orderElementDTO, "OrderLineGroupDTO");
                orderElement = OrderLineGroup
                        .createUnvalidated(orderElementDTO.code);
            }
            orderElement.useSchedulingDataFor(parentOrderVersion);
            List<OrderElement> children = new ArrayList<OrderElement>();
            for (OrderElementDTO element : ((OrderLineGroupDTO) orderElementDTO).children) {
                children.add(toEntity(parentOrderVersion, element,
                        configuration));
            }
View Full Code Here

Examples of org.libreplan.business.orders.entities.OrderElement.useSchedulingDataFor()

    private void updateAdvancePercentage(OrderVersion orderVersion, OrderElement orderElement) {
        orderElement.useSchedulingDataFor(orderVersion);
        OrderElement parent = orderElement.getParent();
        while (parent != null) {
            parent.useSchedulingDataFor(orderVersion);
            parent = parent.getParent();
        }
        orderElement.updateAdvancePercentageTaskElement();
    }
}
View Full Code Here

Examples of org.libreplan.business.orders.entities.OrderLine.useSchedulingDataFor()

        order.setCalendar(configurationDAO.getConfiguration().getDefaultCalendar());
        OrderVersion version = OrderModelTest.setupVersionUsing(scenarioManager, order);
        order.useSchedulingDataFor(version);

        OrderLine orderLine = OrderLine.createOrderLineWithUnfixedPercentage(1000);
        orderLine.useSchedulingDataFor(version);
        order.add(orderLine);
        orderLine.setCode(UUID.randomUUID().toString());
        orderLine.setName("Order line name" + UUID.randomUUID().toString());

        orderDAO.save(order);
View Full Code Here

Examples of org.libreplan.business.orders.entities.OrderLine.useSchedulingDataFor()

        order.add(container1);
        OrderLineGroup container2 = OrderLineGroup.create();
        container2.useSchedulingDataFor(mockedOrderVersion);
        container1.add(container2);
        OrderLine line = OrderLine.createOrderLineWithUnfixedPercentage(100);
        line.useSchedulingDataFor(mockedOrderVersion);
        container2.add(line);

        CriterionType type = CriterionType.create("", "");
        type.setResource(ResourceEnum.WORKER);
        CriterionRequirement requirement = DirectCriterionRequirement
View Full Code Here

Examples of org.libreplan.business.orders.entities.OrderLine.useSchedulingDataFor()

            ResourceAllocationType type) {
        OrderLine orderLine = createValidOrderLine();
        Order order = orderLine.getOrder();
        OrderVersion orderVersion = setupVersionUsing(scenarioManager,
                order);
        orderLine.useSchedulingDataFor(orderVersion);
        assert orderLine.getSchedulingStateType().isSomewhatScheduled();

        orderElementDAO.save(orderLine);

        HoursGroup hoursGroup = HoursGroup.create(orderLine);
View Full Code Here

Examples of org.libreplan.business.orders.entities.OrderLine.useSchedulingDataFor()

        OrderLine orderLine = createOrderLine();
        orderLine.addHoursGroup(associatedHoursGroup);
        OrderVersion orderVersion = ResourceAllocationDAOTest
                .setupVersionUsing(scenarioManager,
                orderLine.getOrder());
        orderLine.useSchedulingDataFor(orderVersion);
        SchedulingDataForVersion schedulingDataForVersion = orderLine
                .getCurrentSchedulingDataForVersion();
        TaskSource taskSource = TaskSource.create(schedulingDataForVersion,
                Arrays.asList(associatedHoursGroup));
        TaskSourceSynchronization mustAdd = TaskSource.mustAdd(taskSource);
View Full Code Here

Examples of org.libreplan.business.orders.entities.OrderLine.useSchedulingDataFor()

        OrderLine orderLine = createOrderLine();
        orderLine.addHoursGroup(associatedHoursGroup);
        OrderVersion orderVersion = ResourceAllocationDAOTest
                .setupVersionUsing(scenarioManager,
                orderLine.getOrder());
        orderLine.useSchedulingDataFor(orderVersion);
        SchedulingDataForVersion schedulingDataForVersion = orderLine
                .getCurrentSchedulingDataForVersion();
        TaskSource taskSource = TaskSource.create(schedulingDataForVersion,
                Arrays.asList(associatedHoursGroup));
        TaskSourceSynchronization mustAdd = TaskSource.mustAdd(taskSource);
View Full Code Here

Examples of org.libreplan.business.orders.entities.OrderLine.useSchedulingDataFor()

    private TaskGroup createValidTaskGroup() {
        OrderLine orderLine = createOrderLine();
        OrderVersion orderVersion = ResourceAllocationDAOTest
                .setupVersionUsing(scenarioManager, orderLine
                        .getOrder());
        orderLine.useSchedulingDataFor(orderVersion);
        SchedulingDataForVersion schedulingDataForVersion = orderLine
                .getCurrentSchedulingDataForVersion();
        TaskSource taskSource = TaskSource
                .createForGroup(schedulingDataForVersion);
        TaskGroupSynchronization synchronization = new TaskGroupSynchronization(
View Full Code Here

Examples of org.libreplan.business.orders.entities.OrderLineGroup.useSchedulingDataFor()

    @Test
    @Transactional
    public void parentPropertyMustBeSetWhenAddingOrderLineToContainer() {
        OrderLineGroup orderLineGroup = OrderLineGroup.create();
        orderLineGroup.useSchedulingDataFor(TaskTest.mockOrderVersion());
        OrderLine orderLine = OrderLine.create();
        orderLineGroup.add(orderLine);
        assertThat(orderLine.getParent(), equalTo(orderLineGroup));
    }
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.