public PersistentVariableInstance createVariableInstanceFromSerialized(String variableName, Object value, String variableTypeName,
Map<String, Object> configuration, CoreVariableScope<PersistentVariableInstance> sourceActivityExecution) {
VariableType type = getVariableTypeByName(variableTypeName);
if (!type.isAbleToStoreSerializedValue(value, configuration)) {
throw new BadUserRequestException("Variable type " + variableTypeName + " cannot store provided serialized value and "
+ "configuration");
}
VariableInstanceEntity variableInstance = VariableInstanceEntity.createFromSerializedValue(variableName, type, value, configuration);
VariableInstanceEntity.insert(variableInstance);