Skip to Content
1

HANA SPS12 HRF xsjslib issue

Dec 21, 2016 at 12:08 PM

72

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers