ETL load "not executable" after first fail from within a Groovy loop

      ETL load "not executable" after first fail from within a Groovy loop

      Hi there,

      i´ve built a script that does the following:

      - loop through all files in a given import directory
      - for each file call a load job
      - if load job was successful -> move file to directory ´archive´
      else move file to directory 'fail'
      - go on with next file

      This works fine so far. The problems begin in case of a first non successful load.

      Though the flawed file is moved to the ´fail´ directory, but instead of going on with the next file the job log returns:

      "INFO: load strLoadStage is not executable"

      Here´s the script:

      new File(strImportDir).eachFileMatch(~/.*.xlsx/) { file->
      //set variables import dir and file related to load task
      API.setProperty("vImportFile",
      file.getName());
      // start Import from Excel
      state1 = API.executeLoad("strLoadStage");
      if (state1.isOK()){
      //call consecutive job
      state2 = API.executeLoad("strLoadCore");
      //move file to archive
      boolean fileMoved = file.renameTo(new File(ArchiveDir, file.getName()));
      } else {
      //or to fail dir, in case of error
      boolean fileMoved = file.renameTo(new File(FailDir, file.getName()));
      }
      }


      Any suggestions?