cancel
Showing results for 
Search instead for 
Did you mean: 

HANA SPS12 HRF xsjslib issue

Former Member
218

Hi experts,

I'm currently developing a XSJS service that uses HRF standard xsjslib to execute a RuleService.

Here my snippet:

function runScheduledJob(input) {
    var ruleServiceID = input.rule_service_id;
    var ruleServiceName = input.rule_service_name;
    
    // Prepare connection
    var oConnection = $.hdb.getConnection();
    var ruleServiceLib = $.sap.hrf.api.lib.ruleService.lib;
    var fnCalcTimeframe = oConnection.loadProcedure("_SYS_BIC", "my.package/CP_MY_PROCEDURE");
    var oTimeframeResult = fnCalcTimeframe(ruleServiceID);
    oConnection.commit();
    oConnection.close();
    
    var oTimeframe = oTimeframeResult.TIMEFRAME["0"];
    var oConsumptionBody = {
        "parameters": {
            "RULE_TIMESTAMP_FROM": a_timestamp,
            "RULE_TIMESTAMP_TO": another_timestamp
        }
    };
    
    var ruleServiceResult = null;
    
    ruleServiceResult = ruleServiceLib.execute(
        $.db.getConnection(), 
        ruleServiceName, 
        oConsumptionBody
    );


    /*
        SEND RESPONSE AND DO OTHER THINGS...
     */
}

Running this service return following error:

File '/sap/hrf/resources/rule/lib/ruleUtils.xsjslib'
Message: 'runtimeServicesRef is undefined'

and I'm not able to understand what's wrong with it.

To build my service I've followed tutorial delivered within SAP_HRF1_09_DevImpGuide_v1.pdf standard SAP guide.

Can anyone help me? I've debugged both mine and standard code but didn't find cause/solution to this issue.

If you need more infos don't hesitate to ask.

Thanks in advance.

Regards,

Marco

Accepted Solutions (0)

Answers (0)