レポートの送信

次の例では、レポートを送信する方法を示します。スクリプト内にパラメータを直接含めるかわりに、必要なパラメータを含むバッチ・ファイルをスクリプトで呼び出します。パラメータ内で等号(=)を使用してレポート・スクリプトを送信しようとすると、スクリプトが失敗します。

#
This sample Jython script provides code related to custom scripts. All the messages being logged (meaning printed) are visible in the process log file as per Log Level profile.
#
# Log the beginning of the script, at the INFO level
fdmAPI.logInfo("======================================================================")
fdmAPI.logInfo("Custom Script: Begin")
fdmAPI.logInfo("======================================================================")
# Execute the subprocess to call and run the batch file
import os
import subprocess
os.chdir("D:/ORCL/MW/EPMSystem11R1/products/FinancialDataQuality/bin")
myScriptName = "D:/ORCL/MW/EPMSystem11R1/products/FinancialDataQuality/bin/myreport.bat"
retcode = subprocess.Popen(myScriptName) 
fdmAPI.logDebug("The return code = " + retcode)

前述のmyreport.batファイルには、次のように等号をパラメータとして含むことができます。

runreport.bat <username> <password> "TB All Columns (Per,Cat,Loc)" "Period=Jan 15" "Category=Actual" "Location=AAA" "Rule Name=AAA" "Report Output Format=PDF"