Hi David ,
please use this script below
var url = "http://<ODM_SERVER>/decisionservice/rest/decision/{decision-service-name}"; var requestBody = { "inputParameter1": "value1", "inputParameter2": "value2" }; var headers = { "Content-Type": "application/json", "Authorization": "Basic <base64-encoded-credentials>" }; function callDecisionService() { var http = new XMLHttpRequest(); http.open("POST", url, true); for (var key in headers) { if (headers.hasOwnProperty(key)) { http.setRequestHeader(key, headers[key]); } } http.onreadystatechange = function() { if (http.readyState == 4 && http.status == 200) { var response = JSON.parse(http.responseText); console.log("Decision response: ", response); task.setVariable("decisionResult", response); } else if (http.readyState == 4) { console.log("Error calling decision service: ", http.status, http.statusText); } }; http.send(JSON.stringify(requestBody)); } callDecisionService();
------------------------------
Mohammed Ghazali
------------------------------
Original Message:
Sent: Fri November 08, 2024 03:18 PM
From: David Salgado
Subject: Call an ADS decision through a Script in BAW.
Hello everyone, could you help me with the information on how I could call an ADS decision through a Script in BAW.
Thanks a lot.
------------------------------
David Salgado
------------------------------