rule-enginebusiness-rulescodeeffects

CodeEffects - Existing rules error after upgrade


After upgrading codeeffects from 4.3.2.6 to 4.3.6.7 existing rules that have any coded actions or methods fail to load with the error:

"The highlighted rule elements could not be located in the current source object. Please update this rule or roll back all changes made to the source object."

Followed by the following in the rules editor

Rule Editor Error

How can this be overcome?

Prior to the upgrade the rules threw no errors and acted against the data as expected. The errors and the XML below come from the downloaded demo. After updating the demo I encountered the same issues.

The XML for the rule:

<?xml version="1.0" encoding="utf-8"?>
<codeeffects xmlns="http://codeeffects.com/schemas/rule/41" xmlns:ui="http://codeeffects.com/schemas/ui/4">
  <rule id="2eb43e80-320c-496f-bf50-7ead12bae886" webrule="4.1.6.4" utc="2014-08-05T15:29:26.3909" type="CodeEffects.Rule.Demo.Bre.Mvc.Models.Patient, CodeEffects.Rule.Demo.Bre.Mvc.2013, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" eval="true">
    <name>Check Date</name>
    <definition>
      <condition type="equal">
        <method name="IsToday" type="CodeEffects.Rule.Demo.Bre.Mvc.Services.PatientService, CodeEffects.Rule.Demo.Bre.Mvc.2013, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
          <value type="System.Nullable`1[[System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">2014-08-06T00:00:00.0000</value>
        </method>
        <value type="System.Boolean">true</value>
      </condition>
    </definition>
    <format>
      <lines />
    </format>
  </rule>
</codeeffects>

I've tried updating the webrule="4.1.6.4" value in the XML to match the new version without success.


Solution

  • First, please check that your project actually declares the "missing" method. Then post your rule XML here, at least its portion that uses that method if the entire rule is too large.