function paramValue = getVariableFromWorkspace(sourceType, source, paramName, dataAccessor)
    if strcmp(sourceType, 'base workspace') || strcmp(sourceType, 'data dictionary') || strcmp(sourceType, 'external source')
        varId = dataAccessor.identifyByName(paramName);
        paramValue =  dataAccessor.getVariable(varId);
    else
        modelH = get_param(source, 'Handle');
        paramValue = getVariableFromModel(modelH, paramName);
    end
end