/** * 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; } }
/** * 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; } }