Download of variables for openhab variables

Does anyone know of a way to download the values for global openhab variables (when openhab starts) in my example i.e

import org.eclipse.xtext.xbase.lib.*
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
import java.math.BigDecimal.*
import java.lang.Integer
import java.lang.Double
import java.lang.String
import java.lang.Number
import org.joda.time.*

import java.util.Date

var Number brightnessBeforePause
var Number PauseBrightness
var String Source
var Number wakeUpDimmer
var Number VolumeStep
var Number temperatureIn = 0
var String feedingsensor_reading
var int sensor_state = 0

As you can see I am hard coding values here. I am looking for a way of pulling values from some source or database maybe.

Any suggestions?

The easiest way would be to define Items for the variables and persist them with mapDB (or whatever), then you can make use of restoreOnStartup in the persistence-configuration.

Thank you i’ll try that, I may look into mysql db located on my website so that I can change the values externally.