public function process_stage_queueorwait() {
        global $DB;

        $wait = $this->instance->get_export_config('wait');
        if (empty($wait)) {
            $DB->set_field('portfolio_tempdata', 'queued', 1, array('id' => $this->id));
            $this->queued = true;
            return $this->process_stage_finished(true);
        }
        return true;
    }