function start_process($resource_id, $call_multiple_instance)
 {
     self::$TEMP_FILE_PATH = DOC_ROOT . "/update_resources/connectors/files/DiscoverLife/";
     self::$WORK_LIST = DOC_ROOT . "/update_resources/connectors/files/DiscoverLife/work_list.txt";
     self::$WORK_IN_PROGRESS_LIST = DOC_ROOT . "/update_resources/connectors/files/DiscoverLife/work_in_progress_list.txt";
     self::$INITIAL_PROCESS_STATUS = DOC_ROOT . "/update_resources/connectors/files/DiscoverLife/initial_process_status.txt";
     self::$TEXT_FILE_FOR_DL = DOC_ROOT . "/update_resources/connectors/files/DiscoverLife/names_without_pages_in_eol.txt";
     //report back to DiscoverLife
     if (!trim(Functions::get_a_task(self::$WORK_IN_PROGRESS_LIST))) {
         if (!trim(Functions::get_a_task(self::$INITIAL_PROCESS_STATUS))) {
             // Divide the big list of ids into small files
             Functions::add_a_task("Initial process start", self::$INITIAL_PROCESS_STATUS);
             self::divide_text_file(10000);
             //orig value 10000
             Functions::delete_a_task("Initial process start", self::$INITIAL_PROCESS_STATUS);
         }
     }
     // Run multiple instances, for DiscoverLife ideally a total of 2
     while (true) {
         $task = Functions::get_a_task(self::$WORK_LIST);
         //get a task to work on
         if ($task) {
             print "\n Process this: {$task}";
             Functions::delete_a_task($task, self::$WORK_LIST);
             Functions::add_a_task($task, self::$WORK_IN_PROGRESS_LIST);
             $task = str_ireplace("\n", "", $task);
             //remove carriage return got from text file
             if ($call_multiple_instance) {
                 Functions::run_another_connector_instance($resource_id, 1);
                 //call 1 other instance for a total of 2 instances running
                 $call_multiple_instance = 0;
             }
             self::get_all_taxa($task);
             print "\n Task {$task} is done. \n";
             Functions::delete_a_task("{$task}\n", self::$WORK_IN_PROGRESS_LIST);
             //remove a task from task list
         } else {
             print "\n\n [{$task}] Work list done --- " . date('Y-m-d h:i:s a', time()) . "\n";
             break;
         }
     }
     if (!($task = trim(Functions::get_a_task(self::$WORK_IN_PROGRESS_LIST)))) {
         // Combine all XML files.
         self::combine_all_xmls($resource_id);
         // Set to force harvest
         if (filesize(CONTENT_RESOURCE_LOCAL_PATH . $resource_id . ".xml")) {
             $GLOBALS['db_connection']->update("UPDATE resources SET resource_status_id=" . ResourceStatus::insert('Force Harvest') . " WHERE id=" . $resource_id);
         }
         // Delete temp files
         self::delete_temp_files(self::$TEMP_FILE_PATH . "batch_", "txt");
         self::delete_temp_files(CONTENT_RESOURCE_LOCAL_PATH . "DiscoverLife/temp_DiscoverLife_" . "batch_", "xml");
     }
 }