logInfo()
|
將資訊訊息記錄到代理程式的程序日誌中。此項目會記錄在 EPM_APP_DATA_HOME\logs 資料夾的程序日誌中和 Oracle Fusion Cloud Enterprise Performance Management 的工作日誌中,但不會記錄到本機的 epmagent.log 中。這個日誌項目是建立在 INFO 日誌層級。
|
agentAPI.logInfo("SAMPLE: INFO log message from script")
|
logError()
|
將錯誤訊息記錄到代理程式的程序日誌中。此項目會記錄在 EPM_APP_DATA_HOME\logs 資料夾的程序日誌中、Cloud EPM 的工作日誌中,以及 epmagent.log 中。這個日誌項目是建立在 SEVER 日誌層級。
|
agentAPI.logError("SAMPLE: SEVER log message from script")
|
setBindVariables()
|
您可以使用 setBindVariables() 方法來更新擷取查詢的繫結變數。這個方法只適用於 befExtract 指令碼。
針對含變數 NAME 為索引鍵和 VALUE 的每個變數,繫結變數必須當作 Java 對映來傳遞。
|
newBindVar = dict({'PERIOD':'Feb-05', 'LEDGER':'Vision Operations (USA)'})
jmap = java.util.HashMap()
針對 newBindVar.keys(): jmap[key] = newBindVar[key] 中的索引鍵
agentAPI.setBindVariables(jmap)
|
getBindVariables()
|
您可以使用 getBindVariables() 方法來提取擷取查詢的繫結變數。每個繫結變數都儲存在對映中,而該對映會使用索引鍵 NAME 和 VALUE 來定義繫結變數。
|
bindVariables = agentAPI.getBindVariables()
針對 bindVariables.entrySet(): print entry.key, entry.value 中的項目
|
updateQuery()
|
您可以使用 updateQuery() 方法來更新擷取查詢。這個方法只適用於 befExtract 指令碼。
|
agentAPI.updateQuery("SELECT * FROM TDATASEG")
|
getQuery()
|
使用 getQuery() 方法,擷取在擷取執行呼叫期間從 Cloud EPM 傳遞到 EPM 整合代理程式的查詢。
|
print "Printing Query: " + agentAPI.getQuery()
|
skipAction()
|
您可以使用 skipAction() 方法,在 EPM 整合代理程式使用自訂擷取常式時,略過擷取資料的步驟。
請注意,您只能在 befExtract 指令碼執行期間略過擷取的執行。
如果您想提供要上傳至 Cloud EPM 的資料檔案,而不是執行已儲存的查詢,就必須要在將該檔案上傳至 Cloud EPM 之前,先把名為 <process ID>.dat 的檔案儲存在 MyData/data 資料夾中。這代表該檔案必須在 befExtract 、aftExtract 或 befUpload 指令碼執行期間儲存到這個資料夾。
|
agentAPI.skipAction('true')
|
getConnectionDetails()
|
使用 getConnectionDetails() 方法,在擷取執行呼叫期間,從雲端擷取從 Cloud EPM 傳遞至 EPM 整合代理程式的連線憑證資料物件。
|
cred = agentAPI.getConnectionDetails()
url = cred.getJDBCUrl()
user = cred.getUserName()
password = cred.getPassword()
agentAPI.logInfo ("Connection Details: ")
agentAPI.logInfo("URL: " + url)
agentAPI.logInfo('User: ' + user)
|
setCustomConnection(conn)
|
在擷取執行呼叫期間,使用 setCustomConnection(conn) 方法,將自訂建立的連線設定至 EPM 整合代理程式。代理程式使用此連線執行。conn 物件必須是類型 4 JDBC 連線,並且是 java.sql.Connection 介面的實作。
這個方法只適用於 befExtract 和 befExport 指令碼。請參閱範例指令碼 BefExtract.py 以及 java CustomEventSample 和 CustomWribackEvent ,以取得用法的詳細資料。
|
若要建立與 Oracle 資料庫的自訂連線,請執行下列動作:
java.lang.Class.forName("oracle.jdbc.driver.OracleDriver")
conn = java.sql.DriverManager.getConnection('jdbc:oracle:thin:@<host>:<port>:<sid>', '<user/schema name>', '<password>')
agentAPI.setCustomConnection(conn)
|