首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Sitecore 8(修订版150121),分析器(MongoDB),错误“在0位置没有行”。

Sitecore 8(修订版150121),分析器(MongoDB),错误“在0位置没有行”。
EN

Stack Overflow用户
提问于 2015-02-28 15:23:47
回答 1查看 924关注 0票数 4

你好。我在Sitecore 8分析器中的问题--当我在一个“体验配置文件”中查看非非独立用户的选项卡‘配置文件’和‘概述’时,错误‘在0位置没有行’。

此错误也存在于Sitecore 8的更新中。是什么导致了此错误?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-03-13 13:40:29

因此,这个问题是由开发人员的错误调用的。

在分析了"FindBestPatternMatchAndApplyToProfileInfo“类的代码及其方法之后,我可以从元素中找到空数组(属性"Rows”中的"dataTable“对象)。这会导致范围之外的异常。

通过添加"if"-statement来检查“行”字段,可以通过实现自己的类(FindBestPatternMatchAndApplyToProfileInfo的副本)来解决这个问题:

代码语言:javascript
复制
private bool ApplyPatternToOneProfile(ReportProcessorArgs args, DataRow profileRow)
    {
        bool flag = true;
        if (DataRowExtensions.Field<Guid>(profileRow, Sitecore.Cintel.Reporting.Contact.ProfileInfo.Schema.ProfileId.Name) == Guid.Empty)
            flag = false;
        ViewParameters retrievingBestPattern = CustomProcessorViewPatternProfile.GetParametersForRetrievingBestPattern(args, profileRow);
        DataTable dataTable = CustomerIntelligenceManager.ViewProvider.GenerateContactView(retrievingBestPattern).Data.Dataset[retrievingBestPattern.ViewName];
        if (dataTable.Rows != null && dataTable.Rows.Count != 0)
        {
            if (!this.TryFillData<Guid>(profileRow, Sitecore.Cintel.Reporting.Contact.ProfileInfo.Schema.BestMatchedPatternId, dataTable.Rows[0], Sitecore.Cintel.Reporting.Contact.ProfilePatternMatch.Schema.PatternId.Name) || !this.TryFillData<string>(profileRow, Sitecore.Cintel.Reporting.Contact.ProfileInfo.Schema.BestMatchedPatternDisplayName, dataTable.Rows[0], Sitecore.Cintel.Reporting.Contact.ProfilePatternMatch.Schema.PatternDisplayName.Name) || !this.TryFillData<double>(profileRow, Sitecore.Cintel.Reporting.Contact.ProfileInfo.Schema.BestMatchedPatternGravityShare, dataTable.Rows[0], Sitecore.Cintel.Reporting.Contact.ProfilePatternMatch.Schema.PatternGravityShare.Name))
                flag = false;
        }
        else
        {
            flag = false;
        }

        return flag;
    } 

更新:

或者,您可以通过添加至少一个模式卡来解决这个问题,在Sitecore营销控制面板中添加相应的配置文件。(https://developers.coveo.com/display/public/SC201503/Understanding+Profiles+and+Pattern+Cards;jsessionid=D03AC5B4F9F4B4E588538BC977BE2F6D)

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28783328

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档