Question : How to submit an asynchronous request to server to run a business service from a Business component script?

Hi,

Please provide me details on how to submit an ansynchronous request to the server to run a specific business service from BC server script.

Thanks & Regards,
Sarat

Answer : How to submit an asynchronous request to server to run a business service from a Business component script?

Here is an example of using the Asynchronous Server Requests business service from oracle document Doc ID 511826.1

    var oPsIn = TheApplication().NewPropertySet();
    var oPsOut = TheApplication().NewPropertySet();
    var oService = TheApplication().GetService("Asynchronous Server Requests");

    oPsIn.SetProperty("Component", "BusIntMgr");

    var iSec = 1;

    var dStart = new Date();
    var iMilli = dStart.getTime();
    iMilli = iMilli + (iSec * 1000);
    dStart.setTime(iMilli);
    var iYear = dStart.getFullYear();
    var iMonth = dStart.getMonth() + 1;
    var iDay = dStart.getDate();
    var iHour = dStart.getHours();
    var iMin = dStart.getMinutes();
    var iSeconds = dStart.getSeconds();
    dStart = iMonth + "/" + iDay + "/" + iYear + " " + iHour + ":" + iMin + ":" + iSeconds;            
    oPsIn.SetProperty("StartDate", dStart);        

    oService.InvokeMethod("SubmitRequest", oPsIn, oPsOut);

You could also possibly just call a workflow using "Workflow Process Manager (Server Request)"

var svc = TheApplication().GetService("Workflow Process Manager (Server Request)");
var Input = TheApplication().NewPropertySet();
var Output = TheApplication().NewPropertySet();
svc.InvokeMethod("RunProcess", Input, Output);      
Random Solutions  
 
programming4us programming4us