Li Jun
2022-04-24 dd10019315aa7e0b26432bb48716da308cc11d82
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
global class NFM624Batch implements Database.Batchable<sObject>, Database.AllowsCallouts {
    public String query;
    List<BatchIF_Log__c> updateprocessingList = new List<BatchIF_Log__c>();
 
    global NFM624Batch() {
        this.query = query;
    }
 
    global Database.QueryLocator start(Database.BatchableContext bc) {
        
        return Database.getQueryLocator([select Id,    NFM624_Secondary_processing__c from BatchIF_Log__c where NFM624_Secondary_processing__c = false AND Type__C = 'NFM624' AND RowDataFlg__c = true AND retry_cnt__c < 3 AND Is_Error__c != 1]);
    }
 
    global void execute(Database.BatchableContext BC, list<BatchIF_Log__c> scope) {
       
        for(BatchIF_Log__c temp :scope){
            //temp.NFM624_Secondary_processing__c = false;
            NFM624Rest.main(temp.id);
            //updateprocessingList.add(temp);
        }
    }
 
    global void finish(Database.BatchableContext BC) {
        // if(updateprocessingList.size()>0){
        //     update updateprocessingList;
        // }
    }
}