Navigation

Categories
Show Navigation Next Topic  »

Code Effects Basics

Code Effects business rules engine allows creation, modification, validation, and evaluation of complex business rules - as well as creation and execution of complex rule-based data filters for virtually all established LINQ providers. Using its web interface, business users can create rules or filters by selecting options from a series of context-sensitive drop-down menus. This IntelliSense-like approach is unique to web-based business rule management. With Code Effects integrated into your project, the most complex business rules can be authored without any knowledge of programming languages.

The concept of Code Effects is quite simple: create a business rule online using the Rule Editor, save it anywhere as an XML document, and evaluate any number of instances of your source object against that rule in any .NET code using one of the Evaluator classes.

Code Effects engine can also be used to run very powerful data filters. It uses a simple notion that with the right user interface any evaluation type business rule such as this:

Check if Product SKU starts with A123 or Shipping ZIP is 30022

... can also be interpreted as a where clause in a select statement against a database:

Get all records where Product SKU starts with A123 or Shipping ZIP is 30022

This feature is called Rule-Based Data Filtering. It's implemented as a LINQ extension method and available in all versions of Code Effects. Details can be found here.

Code Effects engine is not an environment. It simply provides a way to create and evaluate rules and data filters. Contrary to most traditional business rule management systems that run as independently installed processes, Code Effects solution is designed to be an internal part of your new or existing .NET web application, or at least the rule authoring part of it. As such, it does not include rule debugging, versioning, rule access authorization mechanisms or any other functionality to help manage your rules. Your web application is your environment. If needed, all of that functionality can be implemented by using standard APIs and tools that are built into the .NET framework and Code Effects.

While the above is true for rule authoring, rule evaluation is a bit different. Once rules are created and are ready to be used, Code Effects engine provides an extremely easy way to evaluate your rules against source objects by any .NET process, service or program, not just web applications. You can have any number of Windows, WCF or any other types of services, running in different parts of the world, all receiving data from different sources. Those services can retrieve XML rules from your common storage and evaluate them against incoming objects, inspecting the result of each execution and acting accordingly, or let actions inside of each execution type rule determine the further processing of the object.

More details on this matter are provided in this topic.

Another unique feature of the Code Effects engine is its use of parentheses to prioritize evaluation of each condition in the rule. This dramatically simplifies the rule creation and modification process.

Below is the list of elements behind Code Effects technology that you need to understand in order to successfully author and evaluate business rules:

  • Business Rule. Code Effects engine supports two types of rules:

    • Evaluation type:

      Check if ( A is equal to 10 or B has any value ) and C is greater than A
    • Execution type:

      If

         ( A is equal to {2 + B} and C is less than A )

            or B is greater than Get Some Value (parameter)

               then set C to 10 and Invoke Action One

      Else if

         D contains xyz or C has no value

               then set D to abc and Invoke Action Three and Invoke Action Four

      else

         Invoke Action Two

    Supporting multiple rule types gives applications and rule authors much greater flexibility in fine-tuning business processes. Make sure to read their respective topics here and here.

    Each rule consists of rule elements which we will refer to throughout this website:

    • Flow: Elements if, else if and else are flow elements. The if element is required in any rule, while the others are optional. Flow elements divide each rule into sections. Obviously, evaluation type rules can have only one if flow element, and therefore rules of this type always have only one section. Execution type rules can be divided into multiple sections, with each section having one or more actions (.NET methods) or value setters. Actions and setters will be invoked only if the entire section evaluates to True. There can be only one if, one else, and any number of else if flow elements per each execution type rule. To complicate things a bit more, each rule section can be divided into levels by using parentheses. See the definition of Clauses below to find out why all these definitions are important. The default English display names of all flow elements can be changed by using custom Help XML files.
    • Fields: Elements A, B, and C in the examples above are rule fields. They represent public fields and properties of the source object. By default, each field displays its name as it's declared in the source object. This can be changed by decorating fields and in-rule methods (explained later in this document) with the FieldAttribute or MethodAttribute respectively and setting their DisplayName properties to any label in any language. You can also reuse previously saved evaluation type rules in other rules as if they were fields or properties. It's a very cool feature, read more about it here.
    • In-Rule Methods: Element Get Some Value in the executable rule example above is an in-rule method. In-rule methods play the same role as rule fields except they are actually methods of source objects or any other .NET public class. In-rule methods are invoked by Rule Engine during rule evaluation. Rules of both evaluation and execution type can use in-rule methods. The .NET methods they represent must return a value type. They can be instance or static methods, have overloads and be parameterless, or have any number of parameters of value types or parameters of the source object's type. As with rule actions, if a method has multiple overloads you need to set a unique value of the DisplayName property of MethodAttribute for each overload if you'd like to use that overload in your rules as a separate in-rule method. Decorate unwanted overloads with ExcludeFromEvaluation attribute. Parameterless in-rule methods display no signatures (no parentheses), so they appear as regular rule fields to the rule author. All aspects of in-rule methods can be controlled by MethodAttribute, ExternalMethodAttribute, ParameterAttribute, and ReturnAttribute classes.
    • Values: Elements 10, { 2 + B } and xyz are field values. Rule authors can use calculations, input or even other fields to set field values in rules. Values do not have their own attribute class. Their settings, such as minimum or maximum allowed value, case sensitivity, date format, and so on, are normally controlled by the FieldAttribute or ReturnAttribute.
    • Operators: Elements is equal to, has any value, and so on are rule operators. They represent equation operators =, <, > and others. By default, operators are displayed as English phrases such as is greater or equal to instead of which makes them easier for non-technical users to work with. The default display names of all operators can be changed by using custom Help XML files.
    • Conditions: Condition is a combination of field-operator-value elements. Each rule section must contain at least one condition, otherwise the rule is considered invalid.
    • Actions: Shown in the executable rule example above, elements Invoke Action One, Invoke Action Two and so on are rule actions. Rule actions are used only in execution type rules. A single rule section can have any number of actions, which are public methods declared in the source object or any other .NET public class. Action methods must return System.Void; they can be instance or static methods, have overloads and be parameterless, or take any number of parameters of value or source object types. By default they are displayed using the declared names of methods they represent. As with in-rule methods, if an action method has multiple overloads you need to set a unique value of the DisplayName property of ActionAttribute for each overload if you'd like to use that overload in your rules as a separate action. Decorate unwanted overloads with ExcludeFromEvaluation attribute. Parameterless actions display no signatures (no parentheses.) All aspects of rule actions can be controlled by ActionAttribute, ExternalActionAttribute and ParameterAttribute classes.
    • Setters: As shown in the execution type rule example above, a value setter is a combination of set-field-to-value. A single rule section can have any number of setters as well as any number of actions. Rule authors can use setters to set properties of the source object to certain values if the entire section evaluates to True.
    • Clauses: Evaluation type rules use only two clauses - and and or. These correspond to the && and || operators of most programming languages. A single level of a rule section can contain only and or or clauses but never both of them. To illustrate the last phrase, imagine the following rule:
      Check if
      	A is equal to B or B contains abc and C is not equal to A or
      		( C has no value and A starts with xyz or A doesn't end with opq )
      A level is a collection of one or more conditions that gets evaluated as a whole unit (see the definition of Flow above for details). Typically, each part of a section separated with parentheses is a single level. The entire section is a single level if that section doesn't have parentheses. In this rule, there is only one section (because it's an evaluation type rule) that contains two levels - the "main" level, and the "child" level separated from the main level with parentheses. As currently written, the rule above would not pass Code Effects' automatic validation because there are clauses of different types on each level. Try to "evaluate" this rule in your head and you'll see that it returns the worst thing in business rules - an unpredictable result. Unpredictable for the rule author, that is. The author either has to add some parentheses or change clauses to make this rule valid. Let's do all that so you can see the difference:
      // Changing clauses...
      
      Check if
      	A is equal to B or B contains abc or C is not equal to A or
      		( C has no value and A starts with xyz and A doesn't end with opq )
      
      // ... or adding proper level separation
      
      Check if
      	A is equal to B or ( B contains abc and C is not equal to A ) or
      		( C has no value and ( A starts with xyz or A doesn't end with opq ))
      It is obviously illogical to use clauses of different types on the same level. The Rule Editor automatically validates all clauses in all levels when a rule author tries to save or update a rule.

      The execution type rules also include a then clause. It "attaches" one or more rule action to a single flow section. The default English display names of all clause elements can be changed by using custom Help XML files.
    • Collections: Code Effects engine natively supports properties of IEnumerable and IQueryable interfaces. The UI that implements this support is unique in the IT industry and explained in detail in this topic.

    Most of the traditional BRMS systems treat each condition as a single rule, combining those rules into rulesets. One of the goals of a ruleset is to handle the evaluation priority of each rule. So, a typical ruleset would look like this:

    ruleset:
    	// rule # 1
    	priority: 10
    	when: color = "red"
    	then: action 2
    
    	// rule # 2
    	priority: 1
    	when: color = "green"
    	then: action 1
    
    	// rule # 3
    	priority: 100
    	then: action 3
    end
    

    Because Code Effects business rules engine handles the evaluation priority of each condition automatically by using parentheses and/or flow elements, there is no need to combine conditions in rulesets (you can store multiple rules in a single XML file called ruleset, but that's a subject of a different topic.) In Code Effects, everything inside the rule area is a rule. This simplifies rule authoring and makes it much easier to use for non-programmers. The above rule would look very different in the Rule Editor:

    if color is equal to green then action 1
    else if color is equal to red then action 2
    else action 3
    
  • Source Object. Source objects are .NET classes your rules are evaluated against. In the BRE community these objects are also known as fact sources, fact objects, or just facts. Any .NET public class can serve as a Code Effects source object, provided that the source object itself, its base class, or any of its public members declares at least one public property of value type or a public method that returns a value type. Code Effects component "scans" the source object for those properties and methods and uses them as rule fields and in-rule methods.

    Although perfectly acceptable, you would rarely use a plain .NET class as a source object for your rules. Almost all its members can be greatly customized by using attributes included in the CodeEffects.Rule.Attributes namespace. Please read the topics on source objects and attributes for details.

  • RuleEditor and RuleModel classes. Code Effects rules engine provides implementation of Rule Editor for all modern .NET web platforms including ASP.NET Core 2.0. Read the Code Effects Implementation Examples for details and NuGet links for each platform.

  • Evaluation classes are declared in the CodeEffects.Rule.Core namespace. Those classes provide the rule evaluation functionality. The extremely simple implementation of rule evaluation hides its truly remarkable capabilities:

    string rule = ruleEditor.GetRuleXml();
    Evaluator<SourceObjectType> evaluator = new Evaluator<SourceObjectType>(rule);
    bool success = evaluator.Evaluate(sourceObjectInstance);

Post your questions on Stackoverflow and become a part of our growing community
Add Comment

Comments: 78
April 25, 2023 08:22 PM by  Alex
@Anonymous. It is a dependency for the Engine's and all Editor's dlls on all web platforms. It'll be loaded and updated automatically when you reference (or update) the CodeEffects.Rule.Web.Core assembly from NuGet.
April 25, 2023 07:58 PM by  Anonymous
CodeEffects.Rule.Common is unlisted but it is a dependency for CodeEffects.Rule.Web.Core.. any issues with the common package?
February 08, 2023 04:35 AM by  Alex
@Hanne. Yes, we do support custom styles. Please read the following article: https://codeeffects....
February 08, 2023 03:52 AM by  Hanne
Is there support for custom styles?
December 23, 2022 05:18 AM by  Alex
@Wolf. Thank you for letting us know!
December 22, 2022 03:48 PM by  Wolf
@Alex

We found out our security content policy was blocking the eval function which caused the error.
December 21, 2022 04:46 PM by  Wolf
@Alex

I've tried this but no success (now i get the CL41 error locally too).
It seems strange to me that a json error would only appear on our dev site but not locally as the settings we receive from our server are the same.

It crashes on this line:
this.editor = this.window.CodeEffects.Rule.init(response.editorData);

This is the response of our server:

{
"editorData": "{id:'PromotionRuleEditor',z:false,e:{e101:&#x 27;Your browser does not allow access to clipboard. Use Internet Explorer version 7 and up.',e102:'This rule is invalid. Hover over each highlighted element for details.',e103:'Name of the rule cannot be blank.',e104:'Required field',e105:'You are about to delete this rule. All other rules that may reference it will be affected. This action cannot be undone. Continue?',e106:'You cannot submit an empty rule.',e107:'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.',e108:'The input value is greater than the maximum value set for this field',e109:'The input value is less than the minimum value set for this field',e110:'This field does not allow decimal values',e111:'This field does not allow negative values',e112:'This field accepts numeric value only',e113:'The input value already has a decimal point',e114:'The value input has not been completed. Click anywhere outside of the Rule Area and try again.'},h:{i101:'Click inside of the Rule Area to begin a new rule',i102:'Click anywhere inside of the Rule Area to modify the rule',i103:'Select a field or parenthesis from the menu; hit Space Bar if it&#39;s hidden',i104:'Select an operator from the menu; hit Space Bar if it&#39;s hidden',i105:'Type the value; use Backspace to delete, Enter or arrow keys to complete',i106:'Select calculation elements from the menu; hit Space Bar if it&#39;s hidden',i107:'Click to edit the value; hit Space Bar and select a clause to continue',i108:'Build calculation by selecting elements; hit Space Bar if the menu is hidden',i109:'Use your mouse to pick a date',i110:'Select an action from the menu; hit Space Bar if it&#39;s hidden',i111:'Select a clause or parenthesis from the menu; hit Space Bar if it&#39;s hidden',i112:'Use Arrows, Home, End, Tab, Backspace, or Delete keys to edit this rule',i113:'Hit Space Bar to insert a new value; use Right Arrow to edit existing value',i114:'Hit Space Bar to bring up the date picker',i115:'Delete the date or select a clause from the menu; hit Space Bar if it&#39;s hidden',i116:'Use your mouse to pick the time; click OK to select it',i117:'Hit Space Bar to bring up the time picker',i118:'Delete the time or select a clause from the menu; hit Space Bar if it&#39;s hidden',i119:'Select a value from the menu; hit Space Bar if it&#39;s hidden',i120:'Delete the value or select a clause from the menu; hit Space Bar if it&#39;s hidden',i121:'Use Left Arrow to edit, Backspace to delete; hit Space Bar to continue',i122:'Make your selection; hit Space Bar if the menu is hidden',i123:'Type or select the parameter&#39;s value; hit Space Bar if selection is hidden',i124:'Use arrows to navigate the rule or Delete, Backspace and Space bar to edit it',i125:'Select a flow element from the menu; hit Space Bar if it&#39;s hidden',i126:'Create a new rule or select an existing one for editing',i127:'Select a new field from the menu to replace the current one',i128:'Select a new action from the menu to replace the current one',i129:'Select a new operator from the menu to replace the current one',i130:'Select a new clause from the menu to replace the current one',i132:'Pick a new date or select a field from the menu to replace the current one',i133:'Pick a new time or select a field from the menu to replace the current one',i134:'Select a new value from the menu to replace the current one',i135:'Select a collection field from the menu; hit Space Bar if it&#39;s hidden',i136:'Select a new type from the menu to replace the current one',i137:'Press Ctrl-X to cut, Ctrl-C to copy, Ctrl-V to paste',i138:'Copied {0} rule elements',i139:'Stored {0} rule elements'}}",
"sourceData": "{ui:[true,true,\"Check if\",\"\",true,null,false,true,true,true,1,null,null,nul l,null],s:{lbl:{c:\"Add a calculation...\",s:\"Enter a string...\",b:\"Select a value...\",e:\"Select a value...\",m:\"Enter a number...\",v:\"Pick a date...\",j:\"Pick a time...\",g:\"- click here to begin a new rule -\",em:\"-empty-\",eg:\"OTHER\",h:\"Exists...\",l:\"Does not exist...\",pb:\"(\",pe:\")\",cb:\"{\",ce:\"}\",ub:\"(\", ue:\")\",n:\"NAME\",d:\"DESCRIPTION\",a:\"Save\",u:\"Del ete\",r:\"Rules\",y:\"New rule...\",t:\"True\",f:\"False\"},fls:[{n:\"\",v:\"if\", t:0}],cls:[{n:\"and\",v:\"and\",t:6},{n:\"or\",v:\"or\", t:6}],dsc:[],str:[],ops:[{n:\"is\",v:\"equal\",o:4,t:3,a i:4},{n:\"is equal to\",v:\"equal\",o:1,t:3,ai:4},{n:\"is not equal to\",v:\"notEqual\",o:1,t:3,ai:4},{n:\"is greater than\",v:\"greater\",o:1,t:3,ai:4},{n:\"is greater than or equal to\",v:\"greaterOrEqual\",o:1,t:3,ai:4},{n:\"is less than\",v:\"less\",o:1,t:3,ai:4},{n:\"is less than or equal to\",v:\"lessOrEqual\",o:1,t:3,ai:4}],src:[{n:\"54B2A3B4 454509E68B7A838428EB7ED1\",fds:[{n:\"Basket Subtotal\",v:\"BasketSubtotal\",d:\"The total price of the basket, excluding discounts & fees. Expressed in your currency\",o:1,t:1,ai:4,max:9007199254740992,min:-900719 9254740992,dec:true,i:true,cal:true,l:false}]}]}}"
}

December 21, 2022 05:19 AM by  Alex
@Wolf. The error CL41 is thrown when the json parser cannot deserialize certain object that is being transferred from the server to the client. That json could be either a rule or editor's settings (including your source object). It's hard to debug these types of errors. Try to eliminate / and " chars from your values to see if that helps. The editor fully supports special chars in values but sometimes they can be used improperly. Let us know if you still get this error.
December 20, 2022 08:57 PM by  Wolf
Hello we have issues implementing the editor in our Angular project. It works fine locally but once we push it to our dev environment we get the following error code "CL41". I can't seem to find documentation about the error codes, so we don't know how to fix this.
November 15, 2022 02:01 AM by  Alex
@Chris. The Code Effects native component for Blazor 6 will be introduced in the next major version. For now you need to follow the standard way of using legacy components with Blazor 6: register the main editor's script (available at https://codeeffects....) and supply it all the source data it needs from the server by calling the API methods like it's done in any of our demo projects (https://codeeffects....). We don't have a Blazor 6 demo at the moment but the process of integrating the current version of the editor is not really that complicated.
November 13, 2022 12:50 PM by  Chris
@Alex the latest version of Blazor.
November 13, 2022 12:59 AM by  Alex
@Chris. Which version of the Blazor does you project use?
November 12, 2022 05:18 AM by  Chris
Is there a way to integrate this rule editor in my blazor app?
April 04, 2022 08:40 PM by  Alex
@Anonymous. We have a feature called Reusable Rules. See if that addresses your requirement: https://codeeffects....
April 04, 2022 02:55 PM by  Anonymous
Hi, how I can use other rule in Evaluation rules?

For example: I have rule1 and rule2. rule1 and rule2 - this is a Source class with method and one by one they work.

And I want to create a new rule where I will use these two rules.

Check if
(
rule1 is True
and
rule2 is True
)

I can't understand, how I need to configuration Source class to display this in rule editor.
August 25, 2021 05:49 AM by  Alex
@Dirk. You can use any public method as a rule action provided that it returns System.Void and takes either no parameters or value-typed params. Details on rule actions can be found at https://codeeffects.... and https://codeeffects....
August 24, 2021 02:19 PM by  Dirk
Hi, what different types of actions are possible with this tool? Are these coded separately or do they come out of the box? Thinking of Hide/Select/Show, etc etc
June 28, 2021 10:53 PM by  Alex
@Andy You need to use in-rule methods and rule actions to achieve the results you mentioned. Please read their documentation at https://codeeffects...., https://codeeffects...., https://codeeffects.... and https://codeeffects....
June 28, 2021 07:56 AM by  Andy

a) is there any provision to use the result of the conditions in THEN part of the rule
i.e.
IF Exists Accounts Where Amount < 1000 THEN Set (Accounts<1000).Description = ''Low"
here Accounts is the collection

b) any way to set property on nested collection?
i.e.
IF True is equals to True THEN Accounts(Amount<1000).AccountHolders.IsCreditAllowed = False
August 10, 2020 11:59 PM by  Anonymous
Just what I've been looking for. Great component! thanks guys
July 06, 2020 09:56 PM by  jesica
@Alex, thank u !
July 06, 2020 09:00 PM by  Alex
@Jesica. The max value of the string input is 256.
July 06, 2020 08:37 PM by  Jesica
I've just made a test, and the Max is working with ie. 40
Is there any Max value for the MAX attr?
July 06, 2020 08:31 PM by  Jesica
Hi, im trying to set a Max value to a ValeInputType.User param, but it's not working.
[Parameter(ValueInputType.User, Max= 512, Description = "paramTest")] string message

But when I debug your js file, I see description is good, but Max is still on 256 limit.
The Max param used in a Field declaration (for an Int value) works ok.

Is there anything am I doing wrong? or it's just doesn't work?
February 12, 2020 07:56 PM by  Alex
@Anonymous. Each of our demo projects has the main script that handles the site's logic. Typically, we call it either site.js or main.js. I'm going to use the site.js script from our Asp.Net Core demo project; the script is located in /wwwroot/js/ folder. You can get demo projects at https://codeeffects....

Line 103 of that script declares the ruleEvaluated method that you need to alter in order to build in your use case. I'm pasting the version of that method as a sample of how you could handle your case. Please let us know here if you have further questions:

function ruleEvaluated(data)
{
  if (data.isRuleEmpty) $("#Info").text("The rule is empty");
  else if (!data.isRuleValid)
  {
    codeeffects.loadInvalids(data.clientInvalidData);
    $("#Info").text("The rule is not valid");
  }
  else
  {
    // You can display your popup here and get the user's input from it
    // I'm just displaying the system confirmation for the simplicity sake
    var question = confirm("This is the question we want to ask the user");

    // Here is your method call that does whatever needs to be done;
    // we pass it the evaluation result and the user's answer to popup's question
    DoYourThing(data.output, question);
  }
};
February 12, 2020 01:36 PM by  Anonymous
I have a requirement where in after I click the "test" button on the "rule form", a new pop up window appears wherein I want to ask the user some questions and based on the answers (which will be a Yes/No) of the user I want to display the final result of the test. Which means there are two levels of testing; first level in which Code effects checks the parameters in the Rule Test Form and compares it with that of the rule entered and the second level wherein the user answers the questions in my new pop up window and Code effects checks those answers. After these two levels of testing, it finally displays the result as to whether the evaluation is true or false.
Can you give me an idea as to how we can achieve this?
November 19, 2019 04:26 AM by  Alex
@Anonymous. Those are public properties and methods of the class that you specify as your source object. Code Effects editor extracts them from your class during its initialization. They become rule elements, in-rule methods and rule actions. Rule authors can select them from context-sensitive menu options as they create or edit rules. Details can be found at https://codeeffects....
You can decorate your properties and methods with tons of attributes provided by Code Effects to make lives of your end users easier. Using these attributes you can set different display names for your properties, set their descriptions, even things such as evaluation params, min and max values, date/time formats and much more. For instance, you can exclude any of your properties or methods from being displayed in menus by using the ExcludeFromEvaluation attribute. Take a look at attributes at https://codeeffects.... Let me know if you have further questions.
November 18, 2019 03:39 PM by  Anonymous
In the demo file, the parameters that are in the dropdown of the rule editor (say age, patient's name) are those hard coded or they are fetched from somewhere. Please elaborate.
November 11, 2019 10:54 PM by  Alex
@Abhishek. The method that is invoked on the server when you press the Test button is called EvaluateRule(...). Depending on the type of demo you are using it can be declared either in HomeController class or in Default.aspx.cs code-behind file.
November 11, 2019 04:32 PM by  Abhishek
While using the code effects demo solution file, which function/method gets triggered when we press the "TEST" button while evaluation of a rule?
July 01, 2019 07:48 AM by  Alex
@Anonymous Corrected. Thank you!
July 01, 2019 06:46 AM by  Anonymous
further correction:

The ruleset examples do not correspond 1:1 with one another.
one explicitly checks if the color is undefined whereas the other is true for any values not equal to red or green
July 01, 2019 05:59 AM by  Anonymous
Minor correction but i guess it's worth fixing as documentation is a learning resource:
In the "Execution Type" example it has "Invoke Action Tree" rather than "Invoke Action Three"
February 27, 2019 07:08 PM by  Alex
@Ramesh

1. Calculations work only for numeric types. So, if your field is a string you won't even see the "curly brackets". Please provide details on your use case.

2. Your in-rule method should take care of all parameter and return types if you are trying to use them (like in your string(Seventy) example.) Again, we need details on your use case in order to help you.
February 26, 2019 04:38 PM by  Ramesh
IF First Name is equal to John set pulse to {pulse + 100 }
Is the PULSE is a string(Seventy) it throwing error ,there is no validation for data type while applying rule ..
July 14, 2018 05:29 AM by  Alex
@Eduardo. The Global Variables feature is planned for the next major version. No ETA on that one yet.
July 13, 2018 08:58 PM by  Eduardo
Hi, is it possible for the business user to create new variables that would help him in some kind of more complex calculations, and use those variables also in "if" sentences for intermediate rule decisions?

Tx
April 12, 2018 05:40 PM by  Sergey
@Anonymous. You can declare multiple reference typed properties in a single "global" class and use that class as a source object. For example, declare an Address typed property in your main source type like this:

public class Address
{
public string Street;
public string City;
}

public class MySource
{
public int ID;
public string Name;
public Address Address;
}

Then create a filter like this:

Get records where ID is greater than [10] and Address.Street contains "123"

There is much more to this topic, please make sure to read about the ParentAttribute at https://codeeffects....

You can also use collections as properties of your main source. Read about it at https://codeeffects....
April 11, 2018 11:25 AM by  Anonymous
Can we use more than one model class as source object(filter criteria)?
August 15, 2017 02:04 AM by  Anonymous
Is this library dead?
Why does the support and store links 404?
Why does the download link of the free version for me to evaluate bring me to an older version?
Which license would I need to use with any applications built for use within my employer, under a single top level DNS, like ABCCorp.
August 13, 2017 09:49 PM by  Anonymous
Great!
July 05, 2017 08:27 PM by  Alex
@Mariano and @Arturo. Please download the latest version 4.3.6.7 released on June 25, 2017. This version fixed this issue. Make sure to use gettable-only or readonly properties, or set the value of the FieldAttribute.Settable to false for all the properties in your source object. I just verified this version with your use case on our demo project.
July 04, 2017 08:27 PM by  Mariano
My email is: mnofresno@gmail.com

Hi @Alex, i got the same problem as @Arturo, please can you tell us how we can completely disable the default "Set..." Action in the CodeEffects rule editor?

The Settable property is OK but the action is still visible.

Thanks!
September 10, 2016 01:22 PM by  Prasanna
https://stackoverflo...

Please provider solution ASAP
May 18, 2016 02:54 AM by  Alex
@Arturo. I sent your request to our guys. If issue is confirmed, the fix will be included into the next minor version. Thank you for reporting this!
May 17, 2016 08:54 PM by  Arturo
Hi @Alex, i used the Settable property, but the word 'set' is still showing when creating the rule.
I downloaded the demo, changed settable property for all fields to false and it's the same, the 'set' appears as an option.
May 15, 2016 08:07 PM by  Alex
@Arturo. Use the Settable property of the FieldAttribute. Details at http://codeeffects.c...
May 13, 2016 11:25 PM by  Arturo
Hi, im working with code effects and I need to hide the "set" after the sentence "then".
Should not appear to select when creating the rule.
March 10, 2016 09:41 PM by  Sam
@Sankar Nested ifs are not supported
March 09, 2016 12:07 PM by  Sankar
Nested IFs are not working in this version of CodeEffects
February 02, 2016 08:20 PM by  Alex
@Yatin. Current version of Code Effects does not support nested IFs
February 01, 2016 03:30 PM by  Yatin
How can I create Business Rule with nested if conditions ?
October 21, 2015 07:25 PM by  Alex
@Srini. The next major version of Code Effects will replace the span-based string value input with regular textbox. This will naturally add that functionality.
October 20, 2015 08:58 PM by  Srini
Is Ctrl-C, Ctrl-V allowed to set a value within the rule editor?
October 19, 2015 04:32 PM by  Alex
@Anonymous. Yes, it can be used in that way.
October 15, 2015 05:09 PM by  Anonymous
Can this rules engine be used to populate document templates that have a lot of business rule/logic (i.e. calculations/derivations using data from a data source and conditional logic) ?
July 10, 2015 06:18 PM by  Alex
@Roman Rapido. We have never tested Code Effects using DevExpress but there are no reasons why it shouldn't work in there. Code Effects is implemented as a plain server control in ASP and plain component in MVC. We have customers who use it in Azure, Telerik, SharePoint and other environments without problems. You can download our free version and test it in any environment.
July 10, 2015 07:22 AM by  Roman Rapido
Will it work in Devexpress XAF Framework?
June 19, 2015 06:55 AM by  Sergey
@Giri. Sorry for delay in replay. We don't have that info yet. Possibly by the end of this year.
June 18, 2015 10:10 PM by  Brian
Oh. duh! I totally missed that. Thanks.
June 18, 2015 09:42 PM by  Valik
Brian, Look at their front page. There is a line of logos at the bottom. I believe these are just some of their customers. We use Code Effects in federal tax agency in my country.
June 18, 2015 08:03 PM by  Brian
I noticed there was a question earlier about who's using it and the Canadian gov't and Verizon came up. Are there any others you could give me? I am evaluating CodeEffects and another BRE FlexRule. I Like CodeEffects better because of it's simplicity and easy of use, but I gotta sell it to the business. Any big names would help me do that. thx.
June 17, 2015 07:33 AM by  Giri
Thanks Sergey, May I know tentatively when we can expect the next major release.
June 16, 2015 07:37 PM by  Sergey
@Giri. Currently Code Effects does not support IN and NOT IN operators. We have plans to include this feature in one of the next major versions.
June 16, 2015 12:06 PM by  Giri
Hi,
Is there a way I can write a rule where FC in ('Arsenal', 'MCUtd')... if the field has Arsenal or MCUtd succeeds and fails in all other cases. This can be very useful when the list is very long and I have to use OR for each value (FC is equal to 'Arsenal' or FC is equal to 'MCutd'.... ) TKVM.
December 16, 2014 11:00 PM by  Alex
@tthieucdl@gmail.com. Please take a look at the Ruleset mode of the rule editor. Details can be found at http://codeeffects.c...
December 15, 2014 09:36 AM by  tthieucdl@gmail.com
Hi,
I have a requirement : sometime we don't need write that: If clause then do action1 and do action2 and do action 3...
But we need something like this:
1- Set evaluation:
Check if (some conditions)
2- Set of Actions:
If (true) then do changeFieldNameAction
If (true) then do CreateNewObjectAction
If (true) then do SendMailAction

Please review this example for more detail: https://www.youtube....
(At time 3:50)
Any suggestion for this? Thank you very much.
November 27, 2014 06:45 AM by  Nikka
Excellent product. Thank you guys!
March 28, 2014 10:59 PM by  Alex
@Milan. This is not supported in Code Effects.
March 28, 2014 07:05 PM by  Milan
Hello, I have opposite problem. Our users are confused when they see conditions like 'Check if Metod("A") is Method("B")'. Is it possible to prohibit using some methods on left or right side? Some methods make sense only when they are in the left side, some on the right side. Maybe as parameter to MethodAttribute? Side.LeftOnly, Side.RightOnly, Side.Both (default)?
December 13, 2013 06:51 PM by  Alex
@Anonymous. Code Effects prohibits having the same field as a field and value in a single condition. Currently, Code Effects doesn't make a difference between in-rule methods and fields when it generates context menus. But I see your point. The same in-rule method should be allowed in the same condition if that method has parameters. Let me talk to our guys here. We'll try to squeeze this fix into the final code of 4.0 if they agree with me. Thank you for reporting this!
December 12, 2013 11:44 PM by  Anonymous
Thanks. It works perfect in v.4 if I try to check if A is B.
But will it be possible to make smth like:

[Method("A")]
public bool A(bool anyParameter)
{
//some logic
return result;
}

Check if A(true) is A(false)

Currently I can see that I can choose only another method on the right side, not "A".
December 12, 2013 10:04 PM by  Alex
@Anonymous. Version 4.0 supports this feature.
December 12, 2013 09:49 PM by  Anonymous
Is it possible to compare result of two in-rule methods? For example if I have:

[Method("A")]
public bool A(){              return true; }

and

[Method("B")]
public bool B(){              return true; }

Can I create a rule like this?

Check if A is B
August 21, 2013 08:56 PM by  Anonymous
Canadian government uses Code Effects
July 04, 2013 01:19 AM by  Karell Ste-Marie
We use Code Effects with the Verizon Powerful Answers Award system http://powerfulanswersaward.com/ system and its business rules and it is working very well.
July 01, 2013 06:39 PM by  Sergey
@Mikhael. Code Effects is used by governments and Fortune 500 companies, including well known corporations from banking, energy and insurance industries.
July 01, 2013 05:50 PM by  Mikhael Gordon
Do large corporations use this engine? Can anyone tell? Thanks