Provides a data model for authoring and validating complex business rules in an MVC environment.
-
BindSource(System.String, System.String) Returns: System.Void
Parameters:
- sourceAssembly, System.String - The full name of the assembly that contains the declaration of the source object. You can obtain the full name of the source object's assembly by executing Assembly.GetAssembly( SourceObjectType ).FullName.
- sourceType, System.String - The full name of the source object type. You can obtain the source object's full name by executing sourceObjectInstance.GetType().FullName.
Binds the instance of the RuleModel to the type of the source object. Calling this method is a required step when saving a rule inside of SaveAction in MVC. See the MVC demo project for a SaveAction implementation example.
-
BindSource(System.String) Returns: System.Void
Parameters:
- sourceXmlFile, System.String - The full path to the custom XML file that describes the source object. In Code Effects, this document is called Source XML.
Binds the instance of the RuleModel to the type of the source object. Calling this method is a required step when saving a rule inside of the SaveAction in MVC. See the MVC demo project for a SaveAction implementation example.
-
BindSource(System.Type) Returns: System.Void
Parameters:
Binds the instance of the RuleModel to the type of the source object. Calling this method is a required step when saving a rule inside of the SaveAction in MVC. See the MVC demo project for a SaveAction implementation example.
-
Create(System.String, System.String, System.String) Returns: RuleModel
Parameters:
- ruleXml, System.String - Rule Xml as a string.
- sourceAssembly, System.String - The full name of the assembly that contains the declaration of the source object. You can obtain the full name of the source object's assembly by executing Assembly.GetAssembly( SourceObjectType ).FullName.
- sourceType, System.String - The full name of the source object type. You can obtain the source object's full name by executing sourceObjectInstance.GetType().FullName.
Creates an instance of the RuleModel, binds it to the type of the source object and loads the Rule XML. Calling this method is a required step when loading a rule using the LoadAction in MVC. See the MVC demo project for an implementation example.
-
Create(System.String, System.Type) Returns: RuleModel
Parameters:
- ruleXml, System.String - Rule Xml as a string.
- sourceType, System.Type - The type of the source object.
Creates an instance of the RuleModel, binds it to the type of the source object, and loads the Rule XML. Calling this method is a required step when loading a rule using the LoadAction in MVC. See the MVC demo project for an implementation example.
-
Create(System.String, System.Xml.XmlDocument) Returns: RuleModel
Parameters:
- ruleXml, System.String - Rule Xml as a string.
- sourceXml, System.Xml.XmlDocument - The Source XML loaded in the XmlDocument.
Creates an instance of the RuleModel, binds it to the type of the source object, and loads the Rule XML. Calling this method is a required step when loading a rule using the LoadAction in MVC. See the MVC demo project for an implementation example.
-
Create(System.String, System.String) Returns: RuleModel
Parameters:
- sourceAssembly, System.String - The full name of the assembly that contains the declaration of the source object. You can obtain the full name of the source object's assembly by executing Assembly.GetAssembly( SourceObjectType ).FullName.
- sourceType, System.String - The full name of the source object type. You can obtain the source object's full name by executing sourceObjectInstance.GetType().FullName.
Creates an instance of the RuleModel, binds it to the type of the source object, and loads the Rule XML. Calling this method is a required step when deleting a rule using the DeleteAction in MVC. See the MVC demo project for an implementation example.
-
Create(System.String) Returns: RuleModel
Parameters:
- sourceXmlFile, System.String - The full path to the custom XML file that describes the source object. In Code Effects, this document is called Source XML.
Creates an instance of the RuleModel, binds it to the type of the source object, and loads the Rule XML. Calling this method is a required step when deleting a rule using the DeleteAction in MVC. See the MVC demo project for an implementation example.
-
Create(System.Type) Returns: RuleModel
Parameters:
Creates an instance of the RuleModel, binds it to the type of the source object, and loads the Rule XML. Calling this method is a required step when deleting a rule using the DeleteAction in MVC. See the MVC demo project for an implementation example.
-
GetRuleXml() Returns: System.String
Parameters: None
Returns a string that contains the XML document of the rule currently shown in the Rule Editor. Call the IsValid() method to verify that the current rule is valid before calling this method, otherwise an InvalidRuleException will be thrown. Use the returned string to store the rule in a database as an XML type or in a file system as an XML file. This is the string that you pass to all evaluation classes to evaluate your rule. You also use this string to load the rule into the Rule Editor for editing and deletion.
-
IsEmpty() Returns: System.Boolean
Parameters: None
Returns the a value indicating whether the Rule Editor is empty (contains no rule elements).
-
IsValid() Returns: System.Boolean
Parameters: None
Returns a value indicating whether the submitted rule passed automatic rule validation. You must call this method to trigger the validation. If validation fails, this method marks the submitted rule invalid and returns False.
IMPORTANT! This overload does not perform the reusable rules circular references check. Use it only if you're certain that the submitted rule does not reference other rules.
-
Parameters:
- getRuleDelegate, CodeEffects.Rule.Common.GetRuleDelegate - A delegate that takes rule ID and returns XML of that rule.
Returns a value indicating whether the submitted rule passed automatic rule validation. You must call this method to trigger the validation. If validation fails, this method marks the submitted rule invalid and returns False. This overload does perform the reusable rules circular references check, provided that the GetRuleDelegate value is not null.