Job Scheduler¶
Meaning of Job Scheduler¶
Job scheduler is the functionality that automatically executes a process unit which is called as “job”; by defining the execution schedule in it beforehand.It is executed automatically. It is used when a single task is to be periodically performed for multiple times or for the overnight execution of the business process that requires significant amount of time to fetch bulk data.In order to implement such requirements, job scheduler of intra-mart Accel Platform provides functionality that auto-executes the business processes which are organized by Java and Server Side JavaScript on server at a defined timing, and functions to monitor execution status and manage execution results.
Specifications¶
Refer to job scheduler specifications document for the specifications of job scheduler.
Sample Program¶
Sample Contents¶
Interlink the parameter value which is set to the “message” key with a fixed string “Hello” and output it.
Program Source¶
/** * @parameter message world! */ function execute() { let accountContext = Contexts.getAccountContext(); let jobSchedulerContext = Contexts.getJobSchedulerContext(); let message = jobSchedulerContext.getParameter('message'); if (null == message) { return { status : 'error' , message : "Message does not exist in parameter". }; } else if ('' == message) { return { status : 'warning' , message : "Empty message". }; } Debug.console('Hello. ' + message); return { status : 'success' , message : "Job executed normally". }; }Job program of Server Side JavaScript describes the execute function in any JS file.Job developer describes the program which is to be executed by job process in this execute function.
Note
Account context and job scheduler context can be acquired in job process.
Mention any business process by using these 2 contexts.
Account Context
The account information that shows items executed from the job scheduler is stored in account context.
Job Scheduler Context
Information defined about the job, jobnet, trigger and execution information like execution date and time, is stored in the job scheduler context.