Пример #1
0
 /**
  * Invoked when a task completes or is cancelled.
  *
  * @param event the event
  */
 private void onTaskEvent(TaskEvent event) {
   switch (event.getType()) {
     case SKIPPED:
       notifySkipped();
       break;
     case CANCELLED:
       notifyCancelled();
       break;
     case COMPLETED:
       notifyCompleted();
       break;
   }
 }
Пример #2
0
 /**
  * Invoked when the condition task completes or is cancelled.
  *
  * @param event the event
  */
 private void onConditionEvent(TaskEvent event) {
   switch (event.getType()) {
     case SKIPPED:
       notifySkipped();
       break;
     case CANCELLED:
       notifyCancelled();
       break;
     case COMPLETED:
       if (condition.getValue()) {
         start(task, context);
       } else if (elseTask != null) {
         start(elseTask, context);
       } else {
         notifyCompleted();
       }
       break;
   }
 }