表格 7-3 JAVA API 清單
| API | 描述 |
|---|---|
| BigDecimal getPOVLocation(BigDecimal pLoadId) | 根據 LoadID,傳回「分割區索引鍵」。 |
| BigDecimal getPOVCategory(BigDecimal pLoadId) | 根據 LoadID,傳回「類別索引鍵」。 |
| Date getPOVStartPeriod(BigDecimal pLoadId) | 根據 LoadID,傳回開始期間的「期間索引鍵」。 |
| Date getPOVEndPeriod(BigDecimal pLoadId) | 當載入單一期間而開始期間和結束期間期相同時,根據 LOADID 傳回結束期間的「期間索引鍵」。 |
| executePLSQL |
執行「程序語言/結構化查詢語言 (PL/SQL)」程式碼區塊。此 API 接受下列三個參數:
PL/SQL 的執行範例: fdmAPI.executePLSQL("BEGIN dbms_stats.gather_table_stats(user,?,estimate_percent=>dbms_stats.auto_sample_size,force=>TRUE); END;", ["tDataSeg_T"], True); |
| getBatchJobDetails |
getBatchJobDetails 會針對批次提交的每一項工作傳回以下的欄:
|
| int executeDML(String query,Object[] parameters) | 執行任何 DML 陳述式。提供查詢和參數。參數以清單方式提供。 |
| logDB(String pEntityType, String pEntityName, int pLogSequence, String pLogMessage) | 將訊息記錄至資料庫表格 AIF_PROCESS_LOGS。 |
| logFatal(String pLogMessage) | 在發生嚴重錯誤時記錄訊息。此訊息顯示在所有日誌層級。 |
| logError(String pLogMessage) | 在發生錯誤時記錄訊息。此訊息顯示於日誌層級 2 或更高層級。 |
| logWarn(String pLogMessage) | 在發生警告狀況錯誤時記錄訊息。此訊息顯示於日誌層級 3 或更高層級。 |
| logInfo(String pLogMessage) | 記錄資訊訊息。此訊息顯示於日誌層級 4 或更高層級。 |
| logDebug(String pLogMessage) | 記錄偵錯訊息。此訊息顯示於日誌層級 5。 |
| Map getProcessStates(BigDecimal pLoadId) |
傳回「工作流程」處理的狀態。 可用狀態:
|
| Map getPeriodDetail(Date pPeriodKey,String pApplicationName) //returns PERIODTARGET and YEARTARGET | 針對指定的「期間」索引鍵,傳回「目標」期間對映。 |
| Object getCustomScriptParameterValue(BigDecimal pLoadId,String pParameterName) | 傳回指定自訂指令碼參數名稱和 loadID 的值。 |
| Object getCustomScriptParameterValue(String pParameterName) | 針對指定自訂指令碼參數名稱與初始化載入的環境定義傳回值。 |
| ResultSet getBatchDetails() |
從 AIF_BATCHES 表格傳回批次定義資訊。 getBatchDetails() 傳回的欄位:
|
| ResultSet getBatchJobDetails(BigDecimal pLoadId) | 針對指定 loadID,擷取記錄至資料庫表格 AIF_PROCESS_LOGS 的錯誤訊息。 |
| ResultSet getCategoryList() |
以結果集傳回「分類」清單。 getCategoryList() 傳回的欄位:
|
| ResultSet getCheckEntityGroupList(BigDecimal pApplicationId) | 以結果集傳回「檢查群組」清單。 |
| ResultSet getCheckEntityForGroup(String pValGroupKey) | 以結果集傳回「檢查群組中的實體」清單。 |
| ResultSe tgetCheckEntityGroupList(BigDecimal pApplicationId) | 以結果集傳回「檢查規則群組」清單。 |
| ResultSet getCheckEntityForGroup | 以結果集傳回「檢查規則群組」規則清單。 |
| ResultSet getCustomDBLog() |
針對目前的處理,擷取記錄至資料庫表格 AIF_PROCESS_LOGS 中的錯誤訊息。 getCustomDBLog() 傳回的欄位:
|
| ResultSet getCustomDBLog(BigDecimal pLoadId) | 針對指定 loadID,從資料庫傳回日誌敘述。 |
| ResultSet getCustomScriptParameters() | 以結果集傳回環境定義的初始化 loadID 的自訂指令碼參數清單。 |
| ResultSet getCustomScriptParameters(BigDecimal pLoadId) | 以結果集傳回指定 loadID 的自訂指令碼參數清單。 |
| ResultSet getPeriodList() |
以結果集傳回「期間」清單。 getPeriodList() 傳回的欄位:
|
| ResultSet executeQuery(String query, Object[] parameters) | 執行任何 SQL 查詢陳述式。查詢結果以結果集傳回。提供查詢和參數。參數以清單方式提供。 |
| ResultSet getImportFormatDetails(String pImpGroupKey) |
根據「匯入格式」索引鍵,以結果集傳回「匯入格式」詳細資料。 getImportFormatDetails(String pImpGroupKey) 傳回的欄位:
|
| ResultSet getImportFormatMapDetails(String pImpGroupKey) |
以結果集傳回指定「匯入格式」索引鍵的「匯入格式對映」詳細資料。目前僅支援以檔案為基礎的匯入格式。 getImportFormatMapDetails(String pImpGroupKey) 傳回的欄位:
|
| ResultSet getLocationDetails(BigDecimal pPartitionKey) |
以記錄集傳回指定「位置」索引鍵的「位置」詳細資料。 getLocationDetails 傳回的欄位:
例如,如果您想知道 getLocationDetails API 傳回的欄位,請執行下列指令碼: rs = fdmAPI.getLocationDetails(fdmContext["LOCKEY"]) i = 1 metaData = rs.getMetaData() while i <= metaData.getColumnCount(): fdmAPI.logDebug(metaData.getColumnLabel(i)) i +=1 |
| ResultSet getRuleDetails(BigDecimal pRuleId) |
以記錄集傳回指定「資料規則 ID」的「資料規則」詳細資料。 getRuleDetails(BigDecimal pRuleId) 傳回的欄位:
|
| showCustomDBLog() | 在程序完成之後,於使用者介面上顯示自訂訊息清單。訊息可在資料載入工作流程步驟結束時顯示,例如,匯入、驗證、匯出、檢查或者自訂指令碼執行結束時。請注意,只有在線上模式下執行程序時才會顯示訊息。 |
| showCustomFile(String filePath) | 在程序完成之後,於使用者介面上顯示自訂檔案 (日誌檔、報表檔案)。訊息可在資料載入工作流程步驟結束時顯示,例如,匯入、驗證、匯出、檢查或者自訂指令碼執行結束時。請注意,只有在線上模式下執行程序時才會顯示訊息。 |
| showCustomMessage(String message) | 在程序完成之後,於使用者介面上顯示自訂訊息。訊息可在資料載入工作流程步驟結束時顯示,例如,匯入、驗證、匯出、檢查或者自訂指令碼執行結束時。請注意,只有在線上模式下執行程序時才會顯示訊息。 |
| String getCategoryMap(BigDecimal pCatKey,String pApplicationName) | 傳回指定「類別」與「應用程式名稱」的「案例」。 |
| String getCustomMessage() | 擷取針對目前程序所發出的最後一個自訂訊息。 |
| String getCustomMessage(BigDecimal pLoadId) | 擷取針對指定 loadID 所發出的最後一個自訂訊息。 |
| String getCustomFile() | 擷取針對目前程序建立的自訂檔案。 |
| String getCustomFile(BigDecimal pLoadId) | 擷取針對指定 loadID 建立的自訂檔案。 |
| String getPOVDataValue(BigDecimal pPartitionKey) | 傳回「位置」的資料值。 |
| String getDirTopLevel(BigDecimal pApplicationId) | 根據「應用程式」傳回頂層目錄。 |
| String getDirInbox(BigDecimal pApplicationId) | 根據「應用程式」,傳回 Inbox 目錄。 |
| String getDirOutbox(BigDecimal pApplicationId) | 根據「應用程式」,傳回 Outbox 目錄。 |
| String getDirScripts(BigDecimal pApplicationId) | 根據「應用程式」,傳回 Scripts 目錄。 |
| String getProfileOptionValue(String pProfileOptionName, BigDecimal pApplicationId, String pUserName) | 傳回對選項設定的值。可以在「系統設定」、「應用程式設定」和「使用者設定」層級設定選項。優先順序如下:「使用者」、「應用程式」和「系統」。此 API 可判斷適當可用的值並傳回該值。 |
| void writeToProcessLogsDB(BigDecimal pLoadId, String pEntityType, String pEntityName, int pLogSequence,String pLogMessage) | 將日誌資訊寫入至 AIF_PROCESS_LOGS 表格。使用「實體類型」和「實體名稱」分組所記錄的訊息。日誌只能夠從資料載入工作流程程序建立。 |
| void writeToProcessLogsFile(BigDecimal pLoadId, String pLogMessage) |
將日誌資訊寫入至「資料載入程序」日誌檔。日誌根據程序日誌層級撰寫。日誌只能夠從資料載入工作流程程序建立。 註: 建議您使用記錄 API (例如 logDebug 或 logInfo API) 而不是使用 writeToProcessLogsFile API。 |
| void closeConnection() | 用來關閉資料庫連線。 |
| void closeResultSet(ResultSet resultSet) | 用來關閉結果物件。 |
| void updateImportFormat(String pImpgroupKey,BigDecimal pLoadId) | 更新目前執行的匯入格式。這僅適用於以檔案為基礎的匯入格式。 |