기록 시스템에서 원격 정보 조회
이 사용 사례는 REST API 호출을 사용하여 원격 뱅킹 시스템(기록 시스템)에서 고객의 모기지 계좌에 대한 금융 트랜잭션 상세 정보를 조회하는 방법을 보여줍니다.
콜 센터 에이전트가 고객 문의에 응답하고 양식을 사용하여 새 FSO 케이스를 ServiceNow 생성합니다. 이 양식에서 소비자, 금융 계좌, 범주, 간단한 설명 정보 및 관련 메모를 수동으로 입력합니다.
소비자 및 금융 계좌 정보를 이용하면 양식 내의 ServiceNow 스크립트가 원격 뱅킹 시스템(은행 애플리케이션)의 원격 REST 엔드포인트를 호출하여 금융 트랜잭션 상세 정보를 가져옵니다. 그런 다음 에이전트가 필요한 나머지 케이스 정보를 수동으로 입력하기 전에 정보를 확인할 수 있도록 이러한 상세 정보를 양식에 ServiceNow 표시합니다. 완료되면 FSO 케이스가 인스턴스에 캐시 ServiceNow 됩니다.
다음은 원격 은행 애플리케이션에서 받은 금융 거래 상세 정보가 FSO 케이스 양식에 나타날 때의 예입니다.
다음 다이어그램은 이 사용 사례 시나리오의 애플리케이션 플로우를 보여주며 필요한 처리에 대한 간략한 설명을 제공합니다. 이 구현에서는 원격 은행 애플리케이션에서 가져온 데이터가 원격 테이블에 저장됩니다. 원격 테이블은 메모리에만 캐시되며 데이터베이스 테이블에 저장되지 ServiceNow 않습니다. 원격 데이터를 해당 ServiceNow 데이터베이스 테이블에 기록하여 이 시나리오를 구현할 수도 있습니다. 시나리오는 GlideRecord API를 ServiceNow 사용하여 데이터베이스 테이블에 데이터를 저장하는 방법을 보여줍니다.
|
코드 예시
(function executeQuery (v_table, v_query) {
// Parameters needed in the request body of the REST endpoint
var requestBody = {
'financial_account':v_query.getParameter('financial_account')
};
// Instantiate the RESTMessageV2 object
var request = new sn_ws.RESTMessageV2();
// Set the HTTP method as "GET"
request.setHttpMethod('get');
// URL of the endpoint on the bank application
request.setEndpoint('https://<yourbankapphost>/api/getTransactionDetails');
// Request body as a string
request.setRequestBody(JSON.stringify(requestBody));
// Call the REST endpoint
var response = request.execute();
// Get the response body
var responseBody = response.getBody();
// Parse the response body into an object
var responseObj = JSON.parse(responseBody);
// Store the response body into a virtual table
v_table.addRow({
sys_id: gs.generateGUID(),
amount: responseObj.amount,
description: responseObj.description,
posting_date: responseObj.posting_date,
transaction_date: responseObj.transaction_date
});
}) (v_table, v_query);코드 예시
function getRequiredInfo() {
// Instantiate a GlideRecord object with the remote table containing the financial transaction details.
var now_GR = new GlideRecord('transaction_details_remote_table');
// Create a query to obtain the desired financial account
now_GR.addQuery('financial_account', g_form.getValue('financial_account'));
// Execute the query
var result = now_GR.query();
// Display the data in the FSO form
var data = [];
data ['amount'] = result.amount;
data ['description'] = result.description;
data ['posting_date'] = result.posting_date;
data ['transaction_date'] = result.transaction_date;
return data;
}
getRequiredInfo();