Sunday, August 6, 2017

REST Get Call inside coach view


var restUrl = '/rest/bpm/wle/v1/system/env/variable?processAppAcronym=TSAPP&name=documentType';


dojo.xhrGet({

// The URL to request


url: restUrl,


/ The method that handles the request's successful result

// Handle the response any way you'd like!

load: function(results) {

parser = new DOMParser();

xmlDoc = parser.parseFromString(results,"text/xml");

documentType=xmlDoc.getElementsByTagName("value")[0].childNodes[0].nodeValue ;


}

});

Result you will get as text. If you want json then handleAs : json
for xml handleAs : xml