2 Replies Latest reply on Jun 23, 2015 12:54 PM by Francisco Amores

    Not able to trigger bat file from Jython FDMEE script

    user12509693

      Hi All,

       

      We have written below custom Juthon script in FDMEE which is calling some batch files. These batch files will call some maxl scripts and trigger data export. But when we are running this Jython script from FDMEE in seconds it is completed. But nothing happened at the backend. Data was not exported and those batch files were not triggered. Please look at the script and let me know if anything is wrong.

       

      # Log the beginning of the script, at the INFO level
      fdmAPI.logInfo("==========================================================================")
      fdmAPI.logInfo("Custom Script: Begin")
      fdmAPI.logInfo("==========================================================================")
      # Log the target application name from the context, at the DEBUG level
      fdmAPI.logDebug("Target App Name = " + fdmContext["TARGETAPPNAME"])

      import os
      import subprocess
      import shutil
      #Step 1 - Run MDX query
      os.chdir(r"\\c1atxhypprod\HyperionFileShare/Integration/Scripts/Batch")
      #myScriptName = r"\\c1atxhypprod/HyperionFileShare/Integration/Scripts/Batch/XXXXX.bat"
      #command = (myScriptName)
      #fdmAPI.logDebug("Launching MDX extract: " + command)
      #p = subprocess.Popen(command)
      #retcode = p.wait()
      #fdmAPI.logDebug("Extract completed")

      #Step 2 - clean output file and place in FDMEE inbox for loading
      myScriptName = r"\\c1atxhypprod\HyperionFileShare/Integration/Scripts/Batch/XXXXXX.bat"
      command = (myScriptName)
      fdmAPI.logDebug("Cleaning up file and place it in the inbox: " + command)
      p = subprocess.Popen(command)
      retcode = p.wait()
      fdmAPI.logDebug("Extract completed")

      #Step 3 - clear data in target before loading
      myScriptName = r"\\c1atxhypprod\HyperionFileShare/Integration/Scripts/Batch/XXXXX.bat"
      command = (myScriptName)
      fdmAPI.logDebug("Clearing data in target file before loading IntCLR calc script: " + command)
      p = subprocess.Popen(command)
      retcode = p.wait()
      fdmAPI.logDebug("Extract completed")


      # Close the connection and log the end of the script, at INFO level
      fdmAPI.closeConnection()
      fdmAPI.logInfo("==========================================================================")
      fdmAPI.logInfo("Custom Script: end")
      fdmAPI.logInfo("==========================================================================")