首页 > 解决方案 > 从 v5.0.20.6 升级到 v5.0.21.6 后,方法名称将替换为 XML 文档中的标记

问题描述

版本 5.0.21.6 对规则 XML 内容进行了重大更改。

在 5.0.20.6 版本中,方法由它们在 XML 文件中的名称引用,如下所示:

<method name="AddReason"><value type="System.Int32">1</value></method>

但在 5.0.21.6 版本中,方法由“令牌”引用,如下所示:

<method name="1064B76D73CE9F304CA588DF55C65438"><value type="System.Int32">1</value></method>

我们确实使用 XML 文档来进一步验证用户提供的规则,并且 v5.0.21.6 由于这个问题而破坏了我们的功能。

完整的 v5.0.21.6 规则 XML:

<?xml version="1.0" encoding="utf-8"?>
<codeeffects xmlns="https://codeeffects.com/schemas/rule/41"
    xmlns:ui="https://codeeffects.com/schemas/ui/4">
    <rule id="c11fc9b9-f60b-4b50-ac65-f46fb5c21471" webrule="5.0.21.2" utc="2020-08-11T18:42:06.3444" type="RuleModel.PermissibilityRuleModel, Rules.CodeEffects, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" eval="false">
        <name>__rule_name__</name>
        <definition>
            <if>
                <clause>
                    <or>
                        <and ui:block="true">
                            <condition type="equal">
                                <property name="PortfolioType" />
                                <value type="numeric">1</value>
                            </condition>
                            <condition type="equal">
                                <property name="IndependenceRestrictionStandard" />
                                <value type="numeric">1</value>
                            </condition>
                        </and>
                        <condition type="equal">
                            <property name="IndependenceRestrictionStandard" />
                            <value type="numeric">1</value>
                        </condition>
                    </or>
                </clause>
                <then>
                    <set>
                        <property name="PermissibilityStatus" />
                        <value type="numeric">1</value>
                    </set>
                    <method name="1064B76D73CE9F304CA588DF55C65438">
                        <value type="System.Int32">1</value>
                    </method>
                </then>
                <else>
                    <if>
                        <clause>
                            <condition type="equal">
                                <property name="IndependenceRestrictionStandard" />
                                <value type="numeric">1</value>
                            </condition>
                        </clause>
                        <then>
                            <method name="23434FBDF0B4243BC14729C5D1539E7D">
                                <value type="System.Int32">1</value>
                            </method>
                        </then>
                        <else>
                            <set>
                                <property name="PermissibilityStatus" />
                                <value type="numeric">1</value>
                            </set>
                            <method name="1064B76D73CE9F304CA588DF55C65438">
                                <value type="System.Int32">1</value>
                            </method>
                        </else>
                    </if>
                </else>
            </if>
        </definition>
        <format>
            <lines>
                <line index="0" tabs="1" />
                <line index="3" tabs="2" />
                <line index="9" tabs="2" />
                <line index="16" tabs="1" />
                <line index="19" tabs="1" />
                <line index="25" tabs="1" />
                <line index="28" tabs="2" />
                <line index="35" tabs="2" />
                <line index="42" tabs="0" />
                <line index="44" tabs="1" />
                <line index="49" tabs="1" />
                <line index="52" tabs="2" />
                <line index="58" tabs="0" />
                <line index="60" tabs="1" />
                <line index="66" tabs="1" />
            </lines>
        </format>
    </rule>
</codeeffects>

标签: codeeffects

解决方案


推荐阅读