// internal methods /////////////////////////////////////////////////////////
protected Variable createVariable(String key, Object value) {
Variable variable = null;
if (value==null) {
log.finest("creating null variable for "+key);
variable = new NullVariable();
} else {
Environment environment = Environment.getCurrent();
if (environment!=null) {
VariableTypeResolver variableTypeResolver = environment.get(VariableTypeResolver.class);
if (variableTypeResolver!=null) {
variable = variableTypeResolver.createVariable(key, value, this);
}
}
if (variable==null) {
log.finest("creating new unpersistable variable for "+key);
variable = new UnpersistableVariable();
}
}
variable.setName(key);
variable.setExecution(execution);
variable.setProcessInstance(processInstance);
variable.setValue(value);
// TODO add create-variable-log
return variable;
}