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]);
    }

    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;
        // }
        if(!Test.isRunningTest()){
            Id execBTId = Database.executeBatch(new NFM601Batch(), 200);
        }
    }
}