public boolean terminateLoopTask(
     FlowAction action,
     InternalTask initiator,
     ChangedTasksInfo changesInfo,
     SchedulerStateUpdate frontend) {
   // find the target of the loop
   InternalTask target = null;
   if (action.getTarget().equals(initiator.getName())) {
     target = initiator;
   } else {
     target = internalJob.findTaskUp(action.getTarget(), initiator);
   }
   boolean replicateForNextLoopIteration =
       internalJob.replicateForNextLoopIteration(initiator, target, changesInfo, frontend, action);
   if (replicateForNextLoopIteration && action.getCronExpr() != null) {
     for (TaskId tid : changesInfo.getNewTasks()) {
       InternalTask newTask = internalJob.getIHMTasks().get(tid);
       try {
         Date startAt = (new Predictor(action.getCronExpr())).nextMatchingDate();
         newTask.addGenericInformation(
             InternalJob.GENERIC_INFO_START_AT_KEY, ISO8601DateUtil.parse(startAt));
         newTask.setScheduledTime(startAt.getTime());
       } catch (InvalidPatternException e) {
         // this will not happen as the cron expression is
         // already being validated in FlowScript class.
         LOGGER.debug(e.getMessage());
       }
     }
   }
   return replicateForNextLoopIteration;
 }