-
Notifications
You must be signed in to change notification settings - Fork 0
/
serhSchedulable.apxc
31 lines (27 loc) · 1.19 KB
/
serhSchedulable.apxc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
global class serhSchedulable implements Schedulable{
global void execute(SchedulableContext sc){
list<string> codes = new list<string>();
codes.add('EnergyStarV3');
codes.add('IECC2009Performance');
codes.add('IECC2012Performance');
codes.add('DOEZeroEnergyReady');
codes.add('DukeNCHEROPerformance');
list<string> statusList = new list<string>();
if (Test.isRunningTest()){
system.debug('Need to write complicated test code or I can do this');
statusList.add('SUBMITTED_FOR_QA');
} else{
statusList.add('SUBMITTED_FOR_QA');
statusList.add('SUBMITTED_TO_REGISTRY');
}
SERH updateNewProjects = new SERH();
//updateNewProjects.setAuthorization(authorization);
updateNewProjects.setAuthorization();
updateNewProjects.setCodesToCheck(codes);
updateNewProjects.setVariables(statusList);
updateNewProjects.setSERHDataName('HERS');
updateNewProjects.setBuildingRun('EkotropeAsModeled', 'HERSReference', 'HERSRated');
System.debug('here');
Id newProjectBatchId = Database.executeBatch(updateNewProjects,15);
}
}