기록 시스템에서 원격 정보 업데이트
이 통합 시나리오는 은행 애플리케이션 내에서 기록 시스템을 업데이트하는 방법을 보여줍니다.
이 시나리오에서 워크플로우의 ServiceNow 스크립트는 원격 은행 애플리케이션에 고객의 신용 카드 한도를 업데이트하도록 요청합니다. 새 한도가 승인되면 은행 애플리케이션(기록 시스템)에서 고객 한도가 업데이트됩니다.
주:
고객의 신용 카드 한도와 같은 동일한 정보가 원격 시스템의 ServiceNow 기록 시스템과 데이터베이스에 모두 있는 경우가 있습니다. 이러한 유형의 정보를 쿼리할 때마다 데이터베이스의 정보가 ServiceNow 최신이 아닐 수 있으므로 항상 기록 시스템의 정보를 사용해야 합니다. 두 데이터 저장소에서 이 정보를 업데이트할지 여부는 신중하게 판단해야 합니다. 이 사용 사례는 신용 카드 계좌 [sn_bom_cred_card] 테이블의 정보를 업데이트하지 않습니다.
주:
이 시나리오에서는 은행 애플리케이션이 워크플로의 업데이트 요청을 ServiceNow 처리하는 REST 엔드포인트 POST /api/card/updateLimit를 노출한다고 가정합니다.
이 시나리오에서 액세스하는 테이블은 B2C 기록이 포함된 소비자 [csm_consumer] 테이블입니다.
다음 다이어그램은 이 사용 사례에 대한 REST API 호출의 플로우를 보여주며 필요한 처리에 대한 간략한 설명을 제공합니다. 여기서는 설명된 기록 시스템에서 원격 정보 조회 단계를 사용하여 고객 계정 정보를 얻었다고 가정합니다.
|
코드 예시
다음은 위에서 설명한 단계를 수행하는 JavaScript 예제입니다.
// Shows how to request the increase the credit limit for a specified card
// This code assumes there is a REST endpoint 'api/card/updateLimit' on the bank application system
// REST call to the /api/card/updateLimit endpoint to request
// an update to the customer's credit card limit
function updateCreditLimit(requestBody) {
var request = new sn_ws.RESTMessageV2();
request.setHttpMethod('post');
request.setEndpoint('/api/card/updateLimit');
request.setRequestBody(JSON.stringify(requestBody));
var response = request.execute();
var responseBody = response.getBody();
var responseObj = JSON.parse(responseBody);
return responseObj;
}
// The following is the data object sent to the /api/card/updateLimit endpoint
// to increase the credit limit for the card
var requestBody = {
'cardNumber': 'xxxx-xxxx-xxxx-5896',
'accountNumber': 'xxxxxxxxxxxx9590',
'oldLimit': 'USD 5000',
'newLimit': 'USD 10000',
'requestType': 'Increase_limit',
};
updateCreditLimit (requestBody);