How to process xml response when integration rest api in IBM BPM Automation Workflow 1. Common functions for process xml response function getErrorMessageInSystem(o) { if (o && isNOTNullEmpty()) { var value = o.error.xpath(o.path); if (isNOTNullEmpty(value) && isNOTNullEmpty(value.item(0))) { return value.item(0).getText(); } } return null; }; function getRESTInfo(o) { var info = {}; if (o && isNOTNullEmpty(o.error)) { var pathRest = isNOTNullEmpty(o.path) ? o.path : '/error'; try { var restResponse = o.error.xpath(pathRest + "/HTTPStatusCode"); if (isNOTNullEmptyCustom(restResponse)) { info.errorCode = getErrorMessageInSystem({ error : o.error, path : pathRest + "/HTTPStatusCode" }); info.errorMessage = getErrorMessageInSystem({ error : o.error, path : pathRest + "/HTTPStatusMessage" }); info.errorContent = getErrorMessageInSystem(...
Nhận xét
Đăng nhận xét