How to move processed import files to archive folder by ETL task

      How to move processed import files to archive folder by ETL task

      Hi there,

      i plan to set up a folder structure consisting of elements like IMPORT, FAIL, ARCHIVE. Processed import files shall be moved from IMPORT to either ARCHIVE or FAIL in case of any import errors. I guess I have to do this with a Groovy script or something like that, right?

      So, the procedure would probably look something like this:

      1. start ETL load task
      2. check result
      3. If result=ok then move import file to ARCHIVE else move to FAIL

      Has anyone done this before with Groovy or Javascript and can provide me the script? Or is there another, maybe better way to do it?
      Hi OMartin,

      Check this out: groovy-almanac.org/moving-a-file-to-a-directory/

      I have not tested yet but i guess we have to find out which directory is the open base directory. the files are stored in /tomcat/webapps/etlserver/data/files

      with the ETL API you can query the state of your job (if I remember well the function stateOK does the trick)

      hope this helps !
      laloune

      Post hoc, non est propter hoc