SaaS CMS has officially launched! Learn more now.

Class BaseRuleSetFilterExpressionProvider

Base class for Filter Expression Providers that use Windows Workflow Foundation Rules engine to store and retrieve expressions.

Inheritance
System.Object
BaseRuleSetFilterExpressionProvider
Namespace: Mediachase.Commerce.Marketing.Validators.Providers
Assembly: Mediachase.Commerce.Marketing.Validators.dll
Version: 11.8.3
Syntax
[Obsolete("Use promotion system in EPiServer.Commerce.Marketing instead. Will be removed in a future major release, but not earlier than August 2018.")]
public abstract class BaseRuleSetFilterExpressionProvider : FilterExpressionProvider

Constructors

BaseRuleSetFilterExpressionProvider()

Initializes a new instance of the BaseRuleSetFilterExpressionProvider class.

Declaration
public BaseRuleSetFilterExpressionProvider()

Properties

ConditionBoolDefs

Gets or sets the condition bool defs.

Declaration
protected IEnumerable<ElementDefs> ConditionBoolDefs { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<ElementDefs>

The condition bool defs.

ConditionDecimalDefs

Gets or sets the condition decimal defs.

Declaration
protected IEnumerable<ElementDefs> ConditionDecimalDefs { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<ElementDefs>

The condition decimal defs.

ConditionIntegerDefs

Gets or sets the condition integer defs.

Declaration
protected IEnumerable<ElementDefs> ConditionIntegerDefs { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<ElementDefs>

The condition integer defs.

ConditionTextDefs

Gets or sets the condition text defs.

Declaration
protected IEnumerable<ElementDefs> ConditionTextDefs { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<ElementDefs>

The condition text defs.

Methods

AddExpression(CodeBinaryOperatorExpression, CodeBinaryOperatorType, CodeBinaryOperatorExpression)

Adds the new expression to the current master.

Declaration
protected virtual CodeBinaryOperatorExpression AddExpression(CodeBinaryOperatorExpression master, CodeBinaryOperatorType op, CodeBinaryOperatorExpression expr)
Parameters
Type Name Description
System.CodeDom.CodeBinaryOperatorExpression master

The master.

System.CodeDom.CodeBinaryOperatorType op

The op.

System.CodeDom.CodeBinaryOperatorExpression expr

The expr.

Returns
Type Description
System.CodeDom.CodeBinaryOperatorExpression

AddExpressionAsNode(ref FilterExpressionNodeCollection, CodeBinaryOperatorExpression)

Adds the expression as node.

Declaration
protected virtual void AddExpressionAsNode(ref FilterExpressionNodeCollection col, CodeBinaryOperatorExpression expr)
Parameters
Type Name Description
FilterExpressionNodeCollection col

The col.

System.CodeDom.CodeBinaryOperatorExpression expr

The expr.

AddExpressionAsNode(ref FilterExpressionNodeCollection, CodeExpression)

Adds the expression as node.

Declaration
protected virtual void AddExpressionAsNode(ref FilterExpressionNodeCollection col, CodeExpression expr)
Parameters
Type Name Description
FilterExpressionNodeCollection col

The col.

System.CodeDom.CodeExpression expr

The expr.

AddStringExpression(String, String, String)

Adds the string expression.

Declaration
protected virtual string AddStringExpression(string master, string op, string expr)
Parameters
Type Name Description
System.String master

The master.

System.String op

The op.

System.String expr

The expr.

Returns
Type Description
System.String

ConvertExpressionToNode(CodeMethodInvokeExpression)

Converts the expression to node.

Declaration
protected virtual FilterExpressionNode ConvertExpressionToNode(CodeMethodInvokeExpression expr)
Parameters
Type Name Description
System.CodeDom.CodeMethodInvokeExpression expr

The expr.

Returns
Type Description
FilterExpressionNode

ConvertNodesToExpression(FilterExpressionNodeCollection)

Converts the nodes to expression.

Declaration
protected virtual CodeBinaryOperatorExpression ConvertNodesToExpression(FilterExpressionNodeCollection nodes)
Parameters
Type Name Description
FilterExpressionNodeCollection nodes

The nodes.

Returns
Type Description
System.CodeDom.CodeBinaryOperatorExpression

ConvertNodesToStringExpression(FilterExpressionNodeCollection)

Converts the nodes to string expression.

Declaration
protected virtual string ConvertNodesToStringExpression(FilterExpressionNodeCollection nodes)
Parameters
Type Name Description
FilterExpressionNodeCollection nodes

The nodes.

Returns
Type Description
System.String

ConvertNodesToStringExpression(FilterExpressionNodeCollection, String)

Converts the nodes to string expression.

Declaration
protected virtual string ConvertNodesToStringExpression(FilterExpressionNodeCollection nodes, string separator)
Parameters
Type Name Description
FilterExpressionNodeCollection nodes

The nodes.

System.String separator

The separator.

Returns
Type Description
System.String

ConvertNodeToBlock(FilterExpressionNode, FilterExpressionNode)

Converts the node to block.

Declaration
protected virtual CodeBinaryOperatorExpression ConvertNodeToBlock(FilterExpressionNode leftNode, FilterExpressionNode rightNode)
Parameters
Type Name Description
FilterExpressionNode leftNode

The left node.

FilterExpressionNode rightNode

The right node.

Returns
Type Description
System.CodeDom.CodeBinaryOperatorExpression

ConvertNodeToExpression(FilterExpressionNode)

Converts the node to expression.

Declaration
protected virtual CodeBinaryOperatorExpression ConvertNodeToExpression(FilterExpressionNode node)
Parameters
Type Name Description
FilterExpressionNode node

The node.

Returns
Type Description
System.CodeDom.CodeBinaryOperatorExpression

ConvertNodeToStringExpression(FilterExpressionNode)

Converts the node to string expression.

Declaration
protected virtual string ConvertNodeToStringExpression(FilterExpressionNode node)
Parameters
Type Name Description
FilterExpressionNode node

The node.

Returns
Type Description
System.String

ConvertRuleSetToExpressionNodes(RuleSet)

Converts the rule set to expression nodes.

Declaration
protected virtual FilterExpressionNodeCollection ConvertRuleSetToExpressionNodes(RuleSet rules)
Parameters
Type Name Description
System.Workflow.Activities.Rules.RuleSet rules

The rules.

Returns
Type Description
FilterExpressionNodeCollection

ConvertTargetToString(CodeExpression)

Converts the target to string.

Declaration
protected virtual string ConvertTargetToString(CodeExpression expr)
Parameters
Type Name Description
System.CodeDom.CodeExpression expr

The expr.

Returns
Type Description
System.String

ConvertTargetToString(CodeMethodInvokeExpression)

Converts the target to string.

Declaration
protected virtual string ConvertTargetToString(CodeMethodInvokeExpression expr)
Parameters
Type Name Description
System.CodeDom.CodeMethodInvokeExpression expr

The expr.

Returns
Type Description
System.String

ConvertTargetToString(CodePropertyReferenceExpression)

Converts the target to string.

Declaration
protected virtual string ConvertTargetToString(CodePropertyReferenceExpression expr)
Parameters
Type Name Description
System.CodeDom.CodePropertyReferenceExpression expr

The expr.

Returns
Type Description
System.String

CreateConditionElement(ElementDefs, ConditionElementType, String, IEnumerable<ConditionSelectItem>)

Creates the condition element by him definitions

Declaration
protected virtual ConditionElement CreateConditionElement(ElementDefs conditionDef, ConditionElementType condElType, string customControlPath, IEnumerable<ConditionSelectItem> items)
Parameters
Type Name Description
ElementDefs conditionDef

The condition def.

ConditionElementType condElType

Type of the cond el.

System.String customControlPath

The custom control path.

System.Collections.Generic.IEnumerable<ConditionSelectItem> items

The items.

Returns
Type Description
ConditionElement

CreateFilterExpressionNode(ElementDefs)

Creates the filter expression node by him definitions

Declaration
protected virtual FilterExpressionNode CreateFilterExpressionNode(ElementDefs elementDef)
Parameters
Type Name Description
ElementDefs elementDef

The element def.

Returns
Type Description
FilterExpressionNode

CreateFilterNodes()

Creates the filter nodes.

Declaration
protected virtual void CreateFilterNodes()

CreateMethodElement(ElementDefs, String)

Creates the method element by him definitions

Declaration
protected virtual MethodElement CreateMethodElement(ElementDefs methodDef, string customControlPath)
Parameters
Type Name Description
ElementDefs methodDef

The method def.

System.String customControlPath

The custom control path.

Returns
Type Description
MethodElement

CreateRule(String, FilterExpressionNodeCollection)

Creates the rule.

Declaration
protected virtual Rule CreateRule(string expressionKey, FilterExpressionNodeCollection filters)
Parameters
Type Name Description
System.String expressionKey

The expression key.

FilterExpressionNodeCollection filters

The filters.

Returns
Type Description
System.Workflow.Activities.Rules.Rule

CreateRule2(String, FilterExpressionNodeCollection)

Creates the rule2.

Declaration
protected virtual Rule CreateRule2(string expressionKey, FilterExpressionNodeCollection filters)
Parameters
Type Name Description
System.String expressionKey

The expression key.

FilterExpressionNodeCollection filters

The filters.

Returns
Type Description
System.Workflow.Activities.Rules.Rule

CreateRuleSet(String, String, FilterExpressionNodeCollection)

Creates the rule set.

Declaration
protected virtual RuleSet CreateRuleSet(string expressionPlace, string expressionKey, FilterExpressionNodeCollection filters)
Parameters
Type Name Description
System.String expressionPlace

The expression place.

System.String expressionKey

The expression key.

FilterExpressionNodeCollection filters

The filters.

Returns
Type Description
System.Workflow.Activities.Rules.RuleSet

EliminateEmptyNodes(FilterExpressionNodeCollection)

Eliminates the empty nodes (nodes that consist of only logical elements).

Declaration
protected virtual FilterExpressionNodeCollection EliminateEmptyNodes(FilterExpressionNodeCollection nodes)
Parameters
Type Name Description
FilterExpressionNodeCollection nodes

The nodes.

Returns
Type Description
FilterExpressionNodeCollection

ExtractPropertyFromTarget(CodeExpression)

Extracts the property from target.

Declaration
protected virtual string ExtractPropertyFromTarget(CodeExpression expr)
Parameters
Type Name Description
System.CodeDom.CodeExpression expr

The expr.

Returns
Type Description
System.String

FilterNodeFindRecursively(IEnumerable<FilterExpressionNode>, Func<FilterExpressionNode, Boolean>)

Filters the node find recursively.

Declaration
public static FilterExpressionNode FilterNodeFindRecursively(IEnumerable<FilterExpressionNode> nodeCollection, Func<FilterExpressionNode, bool> predicate)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<FilterExpressionNode> nodeCollection

The node collection.

System.Func<FilterExpressionNode, System.Boolean> predicate

The predicate.

Returns
Type Description
FilterExpressionNode

FindElementDef(String)

Searches in registered ElementDefs

Declaration
public ElementDefs FindElementDef(string key)
Parameters
Type Name Description
System.String key

The key.

Returns
Type Description
ElementDefs

GetElementConditions(String, FilterExpressionNode)

Gets the element conditions.

Declaration
public override ConditionElementCollection GetElementConditions(string expressionPlace, FilterExpressionNode node)
Parameters
Type Name Description
System.String expressionPlace

The expression place.

FilterExpressionNode node

The node.

Returns
Type Description
ConditionElementCollection
Overrides

GetElementDefsByBAFDataMetaClass(String, String)

Gets the element defs by BAF data meta class.

Declaration
protected IEnumerable<ElementDefs> GetElementDefsByBAFDataMetaClass(string pattern, string metaClassName)
Parameters
Type Name Description
System.String pattern

The pattern.

System.String metaClassName

Name of the meta class.

Returns
Type Description
System.Collections.Generic.IEnumerable<ElementDefs>

GetElementDefsByMetaDataPlusMetaClass(String, MetaClass)

Creates the filter expression node.

Declaration
protected IEnumerable<ElementDefs> GetElementDefsByMetaDataPlusMetaClass(string pattern, MetaClass metaClass)
Parameters
Type Name Description
System.String pattern

The pattern.

MetaClass metaClass

The meta class.

Returns
Type Description
System.Collections.Generic.IEnumerable<ElementDefs>

GetElementMethods(String, FilterExpressionNode)

Gets the element methods.

Declaration
public override MethodElementCollection GetElementMethods(string expressionPlace, FilterExpressionNode node)
Parameters
Type Name Description
System.String expressionPlace

The expression place.

FilterExpressionNode node

The node.

Returns
Type Description
MethodElementCollection
Overrides

GetEscapedAndCleanedExpressionNodeRightValue(FilterExpressionNode)

Gets the escaped and cleaned expression node right value.

Declaration
public static string GetEscapedAndCleanedExpressionNodeRightValue(FilterExpressionNode node)
Parameters
Type Name Description
FilterExpressionNode node

The node.

Returns
Type Description
System.String

GetNewElements(String, FilterExpressionNode)

Gets the new elements.

Declaration
public override FilterExpressionNodeCollection GetNewElements(string expressionPlace, FilterExpressionNode parent)
Parameters
Type Name Description
System.String expressionPlace

The expression place.

FilterExpressionNode parent

The parent.

Returns
Type Description
FilterExpressionNodeCollection
Overrides

IsStringCondition(ElementDefs)

Determines whether a given definition is a text condition.

Declaration
protected virtual bool IsStringCondition(ElementDefs conditionDef)
Parameters
Type Name Description
ElementDefs conditionDef

The condition definition.

Returns
Type Description
System.Boolean

LoadExpressionNodeCollectionFromXaml(String)

Loads the expression.

Declaration
protected virtual FilterExpressionNodeCollection LoadExpressionNodeCollectionFromXaml(string xaml)
Parameters
Type Name Description
System.String xaml

The xaml.

Returns
Type Description
FilterExpressionNodeCollection

LoadFilters(String, String)

Loads the filters.

Declaration
public override FilterExpressionNodeCollection LoadFilters(string expressionPlace, string expressionKey)
Parameters
Type Name Description
System.String expressionPlace

The expression place.

System.String expressionKey

The expression key.

Returns
Type Description
FilterExpressionNodeCollection
Overrides

RegisterDefinitions(IEnumerable<ElementDefs>)

Registers the definitions in to cache map.

Declaration
protected void RegisterDefinitions(IEnumerable<ElementDefs> definitions)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<ElementDefs> definitions

The definitions.

RegisterProviderElementDefinitions()

Registers the provider element definitions.

Declaration
protected virtual void RegisterProviderElementDefinitions()

SaveFilters(String, String, FilterExpressionNodeCollection)

Saves the filters.

Declaration
public override void SaveFilters(string expressionPlace, string expressionKey, FilterExpressionNodeCollection filters)
Parameters
Type Name Description
System.String expressionPlace

The expression place.

System.String expressionKey

The expression key.

FilterExpressionNodeCollection filters

The filters.

Overrides