private void applyAllocationWithDateChangesNotification(
         IOnTransaction<?> allocationDoer) {
     if (context != null) {
         org.zkoss.ganttz.data.Task ganttTask = context.getTask();
         transactionService.runOnReadOnlyTransaction(allocationDoer);
         ganttTask.enforceDependenciesDueToPositionPotentiallyModified();
     } else {
         // Update hours of a Task from Limiting Resource view
         transactionService.runOnReadOnlyTransaction(allocationDoer);
     }
 }
Exemplo n.º 2
0
 PlanningState getPlanningState(final Order order, final Desktop desktop) {
     IAdHocTransactionService transactionService = Registry
             .getTransactionService();
     return transactionService
             .runOnReadOnlyTransaction(new IOnTransaction<PlanningState>() {
                 @Override
                 public PlanningState execute() {
                     return planningStateCreator.retrieveOrCreate(desktop,
                             order);
                 }
             });
 }
Exemplo n.º 3
0
  private Order createValidOrder() {
    Order order = Order.create();
    order.setDescription("description");
    order.setInitDate(year(2000));
    order.setName("name");
    order.setResponsible("responsible");
    order.setCode("code-" + UUID.randomUUID());
    BaseCalendar calendar =
        adHocTransaction.runOnReadOnlyTransaction(
            new IOnTransaction<BaseCalendar>() {

              @Override
              public BaseCalendar execute() {
                BaseCalendar result =
                    configurationDAO.getConfigurationWithReadOnlyTransaction().getDefaultCalendar();
                BaseCalendarModel.forceLoadBaseCalendar(result);
                return result;
              }
            });
    order.setCalendar(calendar);
    return order;
  }