Example #1
0
 public void removeSubTask(Task aTask) throws TaskException {
   if (periods.size() > 0)
     throw new TaskException(
         "Can not remove subtask because time has already been reported on this task");
   remove(aTask);
   ApplicationEventDispatcher.fireEvent(new TaskRemovedEvent(this));
 }
Example #2
0
 public void start() throws TaskException {
   if (getChildCount() > 0)
     throw new TaskException("If a task has subtasks you can only report on subtasks");
   if (currentPeriod == null || currentPeriod.getEndTime() < System.currentTimeMillis()) {
     currentPeriod = new Period();
     currentPeriod.setTask(this);
     addPeriod(currentPeriod);
     ApplicationEventDispatcher.fireEvent(new TaskStartedEvent(this));
   }
 }