SAP HANA

Schedule an XS Job

The xsjob file enables you to run a service (for example, an XS JavaScript or an SQLScript) at a scheduled interval.
Create the XS job file using the wizard to define the details of the schedule at which the job runs.
The XS job file uses a cron-like syntax to define the schedule at which the XS JavaScript must run. This job file triggers the script yahoo.xsjs on the 59th second of every minute and provides the name "SAP.DE" as the parameter for the stock value to check.

Create a file called yahoo.xsjob and add the following  json within the xsjob file:

{
    "description": "Read stock value",
    "action": "yahoo:yahoo.xsjs::readStock",
    "schedules": [
       {
          "description": "Read current stock value",
          "xscron": "* * * * * * 59",
          "parameter": {
             "stock": "SAP.DE"
             }
       }
    ]
}


description: you can give any custom name to represent job
action: Packagename:xsjsfilename::functionname
schedules:for json object with following fileds
descprtion: you can give any custom name to represent function
xscorn: time interval means at what time difference xsjob will
trigger and call the xsjob file.
parameter: mention parameters names which you want use in the xsjs



 

1 comment:

  1. You can check the onlinetool http://www.xscodegen.codes for generating source code for xsjs

    ReplyDelete