About this Document
This document is about how to use Job Scheduler in SuccessFactors. Pay attention that we only talk about jobs extending ScheduledReport (one of the Job Types) to export data. So if you want to learn more about Job Scheduler or related knowledge, please refer to Confluence.
Start the Service of Job Scheduler
Before programming on Job Scheduler, we should start the service of Job Scheduler in local JBoss. Now we have 2 kinds of Job Schedulers: S2 and QUARTZ. In this document we are using the second one.
Detailed steps of starting the service could be found in Confluence (2 and 3). Pay attention that even we are using QUARTZ, we should also follow the steps in 2. So my suggestion is executing all the commands in 2 and 3 in ordered.
Afterwards we can test the function of Job Scheduler by running some Scheduled Jobs. E.g. we can try the Business Goals Export function in VarPay:
1. Go into Admin Center –> Compensation –> Compensation Home
2. Select a plan on the left side, pay attention that the Plan Type of the selected plan should be Variable Pay.
3. Select Plan Setup –> Manage Plan Details –> Business Goals
4. Click on the export icon on the right side. Notice that the Export as scheduled job should be picked and then Export.
5. Then we go to Reports and click on Scheduled Reports on the left side.
6. In the list we can find the Business Goal that we just exported. This indicates that the Job Scheduler service is opened.
Job Scheduler Development
1. Create a new JobType with AO Ticket. Detailed description could be found in Confluence. Since we are extendingScheduledReport, this step could be ignored.
2. Create a new class extending ScheduledReport. The execute() method in this class contains the code that we expect to run in a Job Scheduler. We can temporarily copy all the code in CompExportMultipleXlsJob.java and change the class name, pay attention that：
a. Name of the class should specifically indicates the function of it;
b. Extends ScheduledReport;
c. The return value of execute() is a byte array, which is the exported data.
3. Add a new String in DocSearchSpecsBean.java which indicates the new job.
4. Create a method in the corresponding ScheduledReportFactory.java (I’m working on Compensation and I chooseCompScheduledReportFactory) like the followed image:
5. Add the just created ReportType in ExportReportType.java. There are two parts of code need to be added. And we should set the correct category for the job. We can refer to other similar ReportTypes to set the category.
6. Add a new test in SchedluedReportFactoryTest.java. I’ve no idea if this is a necessary step.
7. Add the followed code where the Scheduled Job need to be invoked. We can pass parameters inDocSearchSpecsBean specsBean.
8. In execute() method we merge the code that want to run in the Job Scheduler.
9. So far all the coding task has been finished. But pay attention that after ant package the new job may be not created in JBoss, so we need to restart JBoss.
10. Now we can check if the function is ok. But you may find that even the expected data is exported, we could also see errors in the log:
The reason of the error is after successfully running a scheduled job, the server will send an email to the user. But this function is block in local system, so there is an error. We can just ignore it. If a testing of email function is necessary, we can print it in log.
Others about Job Scheduler
1. If you want to see the information about the job’s status:
a. Log in provision
b. Choose the Company
c. Click on “Monitor Jobs”
d. Choose “Report Export” in “Job Type”.
e. Find out the job，click on “Detail” on the right side to see the detailed information
2. If you met any problem with Job Scheduler，you can create a Jira Ticket，choose “Analytics” as the Project name，and “Classic Reporting” as the Component Name.