Invoking Business Entity Methods through the JSDO

This is a sample for calling into an Invokable Method in a Business Entity through the JSDO and the Generic Service Interface for JSDO with Kendo UI dialect (Service Interface Class). The feature further relies on the Business Entity Descriptor and annotations defined for Invokable Methods.

The example assumes, that dataSource is a reference to the JSDO Kendo UI data source. TestMethodMobile42 is an invokable method in the Business Entity.

function TestFunction ()
{

    // A call parameter that is compatible to an Consultingwerk.CharacterHolder 
    var oParameter = { plcParameter: { Value: "Test" } }

    // Perform the asynchronous call
    // true = asynchronously
    var call = dataSource.transport.jsdo.TestMethodMobile42 (oParameter, true).deferred;

    // done handler
    call.done (function (method, jsdo, success, request) {
        console.log ("done");
        console.log ("method", method);
        console.log ("jsdo", jsdo);
        console.log ("success", success);
        console.log ("request", request);

        // Retrieve JavaScript object from ABL serializable parameter 
        var oOutput = request.response.plcParameter;
        console.log ("Output Object Value Property", oOutput.Value); 
  
        // Access return ProDataset values
        var customer = request.response.plcDataset.dsCustomer.eCustomer[0];
        console.log ("Customer Data:", customer.Name) ;
    });
}