Aras Innovator 存取外部資料庫或系統的方式,大致分成資料匯入系統和透過第三方API兩種:
- 建置資料對應的ItemType,並透過引用.dll檔開發的外部程式,將目標資料同步到該ItemType。
- 開發能存取目標資料的Web API,透過Server or Client Method等方式查詢。
另外,執行 SQL command command 的 applySQL function,因使用資料庫帳號 aras_innovator 只有存取自身資料庫的權限 ,故無法使用 DBLink 的方式跨資料庫存取。
關於 call Web API 部分,以下為 Client Method (java script) sample code:
//Synchronize GET Web API data
var xmlHttpReq = new XMLHttpRequest();
var param = "brassai";
var webApiUrl = "http://webapi.brassaikao.idv.tw/samplecode/" + param;
xmlHttpReq.open("GET", webApiUrl, false); // synchronize
xmlHttpReq.send(null);
var msTimeout = new Date().getTime() + 1000; // 1 second timeout
do{
if(xmlHttpReq.readyState === 4 && xmlHttpReq.status === 200) {
alert("Get Web API data: " + xmlHttpReq.responseText);
break;
}
}while(msTimeout > new Date().getTime());
Note: Ver. 11.0 SP5 not support JQuery, 11.0 SP12 start use RESTful

Leave a comment