Podcast
Questions and Answers
What does the Validate method in the RulesEngine return to indicate the success of a rule?
What does the Validate method in the RulesEngine return to indicate the success of a rule?
What happens if a RuleManager is null when calling the Execute method in the RulesEngine?
What happens if a RuleManager is null when calling the Execute method in the RulesEngine?
How does the ValidateRule method determine the appropriate ICriteriaType object?
How does the ValidateRule method determine the appropriate ICriteriaType object?
What is the primary purpose of the RulesEngine class?
What is the primary purpose of the RulesEngine class?
Signup and view all the answers
What does the RuleClauses property of the RuleManager help with?
What does the RuleClauses property of the RuleManager help with?
Signup and view all the answers
What is the purpose of the text box labeled 'Value' in the context of Comparison Operators?
What is the purpose of the text box labeled 'Value' in the context of Comparison Operators?
Signup and view all the answers
Which of the following options specifies the manner in which a rule resolves in comparison to other rules?
Which of the following options specifies the manner in which a rule resolves in comparison to other rules?
Signup and view all the answers
What does the 'Within/Outside' selector determine in relation to geographic rules?
What does the 'Within/Outside' selector determine in relation to geographic rules?
Signup and view all the answers
When defining a geographical rule, what do the text boxes for Latitude and Longitude specify?
When defining a geographical rule, what do the text boxes for Latitude and Longitude specify?
Signup and view all the answers
What type of criteria can be selected from the drop-down for Custom Property Name?
What type of criteria can be selected from the drop-down for Custom Property Name?
Signup and view all the answers
What component must be chosen to define which characteristics are used in a persona rule?
What component must be chosen to define which characteristics are used in a persona rule?
Signup and view all the answers
Which operator is NOT included in the list of comparison criteria options?
Which operator is NOT included in the list of comparison criteria options?
Signup and view all the answers
What determines if a rule resolves in conjunction or alternatively with other rules?
What determines if a rule resolves in conjunction or alternatively with other rules?
Signup and view all the answers
Which function does the Value Text Box serve in a persona rule?
Which function does the Value Text Box serve in a persona rule?
Signup and view all the answers
In a persona rule setup, which of the following is primarily influenced by the selected Rule Type?
In a persona rule setup, which of the following is primarily influenced by the selected Rule Type?
Signup and view all the answers
Which type of rule is concerned with the customer's characteristics rather than the user's?
Which type of rule is concerned with the customer's characteristics rather than the user's?
Signup and view all the answers
What does the 'Criteria Property' dropdown allow the user to do?
What does the 'Criteria Property' dropdown allow the user to do?
Signup and view all the answers
Which characteristic can be used to build a persona rule aside from those in the Admin Console?
Which characteristic can be used to build a persona rule aside from those in the Admin Console?
Signup and view all the answers
What does the 'RequiresCriteriaObject' field indicate?
What does the 'RequiresCriteriaObject' field indicate?
Signup and view all the answers
Which of the following statements is true about 'CriteriaObject'?
Which of the following statements is true about 'CriteriaObject'?
Signup and view all the answers
What is the purpose of the 'ValidRuleClause' field?
What is the purpose of the 'ValidRuleClause' field?
Signup and view all the answers
Which of the following statements captures the essence of 'LookupObject'?
Which of the following statements captures the essence of 'LookupObject'?
Signup and view all the answers
What does the 'RequiresValueType' Boolean determine?
What does the 'RequiresValueType' Boolean determine?
Signup and view all the answers
What is indicated by the 'DependencyName' field in the class?
What is indicated by the 'DependencyName' field in the class?
Signup and view all the answers
When is 'CriteriaValueLabel' considered obsolete?
When is 'CriteriaValueLabel' considered obsolete?
Signup and view all the answers
What does 'RequiresGeoCode' signify?
What does 'RequiresGeoCode' signify?
Signup and view all the answers
What is the function of the RuleClauseComparisonOperator.Equals?
What is the function of the RuleClauseComparisonOperator.Equals?
Signup and view all the answers
What does the CriteriaTypeParameter Label define?
What does the CriteriaTypeParameter Label define?
Signup and view all the answers
What does the ValueMaximum parameter represent in a rule clause?
What does the ValueMaximum parameter represent in a rule clause?
Signup and view all the answers
In the context of CriteriaObject, what is the significance of RequiresCriteriaProperty?
In the context of CriteriaObject, what is the significance of RequiresCriteriaProperty?
Signup and view all the answers
Which of the following accurately describes RuleTypeOption?
Which of the following accurately describes RuleTypeOption?
Signup and view all the answers
What does the PossibleValues array for CriteriaValue imply?
What does the PossibleValues array for CriteriaValue imply?
Signup and view all the answers
How does CriteriaType affect the functionality of a rule clause?
How does CriteriaType affect the functionality of a rule clause?
Signup and view all the answers
In which situation is the CriteriaObject field necessary?
In which situation is the CriteriaObject field necessary?
Signup and view all the answers
Study Notes
Persona Rule Types
- Persona rules are built on user and customer characteristics, which can be selected from data fields on the Customer screen or outside the Admin Console, such as shopper's location.
- Rule Types are grouped in the Rule Tab's drop-down field.
- Depending on rule types, the Rule Tab updates to display only the fields needed for completion.
- The tables list each Rule Type and the data fields required to create a persona rule.
User Custom Property
- This text box allows you to determine the User Custom Property that the rule will compare using the Comparison Operator and Value.
- The Comparison Operator drop-down offers options like "Equals," "Not Equals," "Less Than," "Less Than or Equals," "Greater Than," "Greater Than or Equals," "Matches," "Range," and "List."
- The Value text box holds the value against which the Comparison Operator will resolve.
- The Condition option determines if the rule will resolve in addition to other rules (And) or if it should resolve true in an either/or scenario (Or).
Customer Fields
- The Criteria Property drop-down determines the Criteria Property the rule will compare using the Comparison Operator and Value.
- Similar to User Custom Property, the Comparison Operator drop-down offers various options for comparison.
- The Value text box holds the value against which the Comparison Operator will resolve.
- The Condition option determines whether the rule will resolve in addition to other rules (And) or in an either/or scenario (Or).
Distance from a Point
- The Location Phrase text box accepts an address that Google Maps translates into specific Latitude and Longitude coordinates.
- The Latitude text box determines the Latitude for the origination point of the rule.
- The Longitude text box determines the Longitude for the origination point of the rule.
- The Within/Outside selector determines whether the distance is within or outside the area originating from the geographic location.
- The Distance text box and selector determine the numerical distance from the origination point for which the rule will resolve as true, and whether that distance is in Kilometers or Miles.
- The Condition option determines if the rule will resolve in addition to other rules (And) or in an either/or scenario (Or).
Customer Custom Properties
- The Custom Property Name text box allows you to determine the Customer Custom Property that the rule will compare using the Comparison Operator and Value.
- The Comparison Operator drop-down offers options like "Equals," "Not Equals," "Less Than," "Less Than or Equals," "Greater Than," "Greater Than or Equals," "Matches," "Range," and "List."
- The Value text box holds the value against which the Comparison Operator will resolve.
- The Condition option determines if the rule will resolve in addition to other rules (And) or in an either/or scenario (Or).
### Rule Types by Context
- Rule Types are classes responsible for implementing the rules engine logic and validating rules.
- The Validate method, when called, returns True if the rule passes and False if it fails.
Rule Types for Entity Properties
- These rules allow you to check values of entity properties.
- An instance of the entity being checked must be provided to the rules engine's list of context objects.
RulesEngine
- This class acts as the concrete implementation and generic rules engine for Configured Commerce.
- The Execute and ValidateRule methods are virtual, enabling derivation from the RulesEngine base class for new RulesEngine instances.
Execute Method
- Executes rules and returns a Boolean (True for pass, False for fail).
- Requires an input object with an associated RuleManager object.
- If RuleManager is null, a result of True is returned, as default objects may not have associated rules.
- If RuleManager is available, the RuleClauses property of the RuleManager is iterated through for processing conditions.
ValidateRule Method
- Validates a RuleClause by calling the appropriate CriteriaType's implementation of the validate method.
- Retrieves the valid ICriteriaType object using the CriteriaTypeFactory.
- Interrogates the enumerable context for a context object with a type matching the object type required for the current RuleClause.
- If no context is found, the RuleClause is validated without any context.
IRulesEngine
- The RulesEngine.Execute method receives the entity containing the RuleManager and a list of objects with context information (like CustomerOrder, UserProfile) to validate against.
Field-Level Data
- The following fields, not readily apparent in the database, are essential for understanding the data perspective.
Table/Field or Property
- CriteriaType: This field is not stored in the database.
- DependencyName: This attribute of the class identifies the class in RuleTypeOption and RuleTypeClause.
- LookupObject: Identifies a specific entity to find a single instance and embed its Guid (ID) into RulesClause.SimpleValue.
- CriteriaObject: Represents the fixed object that must be passed into the rule for evaluating logic. Crucial for customer order-specific rules in shipping and promotion engines.
- DisplayName: This is what displays as the criteria in the UI.
- RequiresCriteriaObject: A Boolean flag that determines if the UI should prompt for the criteria object itself. Currently, this is only set to True for Object and CustomProperty criteria.
- RequiresCriteriaProperty: A Boolean flag defining if the UI should prompt for the CriteriaPriority in the RuleTypeOption.
- RequiresCriteriaValue: A Boolean flag defining if the UI should prompt for the CriteriaValue in the RuleTypeOption.
- CriteriaValueLabel: This is a parameter description.
- RequiresValueType: Boolean, defines if a data type needs to be defined for the CriteriaValue. This is mostly obsolete as Custom Properties are now type-aware.
- RequiresGeoCode: Boolean, defines if this is a distance-related rule.
- ValidRuleClauseComparisonOperators: Defines the specific comparison values valid in the UI. If none are specified, all comparisons are available.
- ParameterDescriptions: Explicitly defines parameter values that can be acquired through the UI, overriding default values.
RuleTypeOption
- Description: Used in the rule clause dropdown to select a rule to configure.
- CriteriaType: A pointer back to the CriteriaClass plugin using the DependencyName from the class.
- CriteriaObject: An optional field defining the object to apply the criteria to.
- CriteriaProperty: If the criteria type is Object, this defines a specific property of the CriteriaObject or "All Properties" for selecting from any property.
- ValueType: Allows selecting the type of data for the rule clause.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
This quiz delves into the intricacies of persona rules and their various types. It covers user custom properties, comparison operators, and how to effectively utilize these elements to create meaningful rules. Test your understanding of how persona rules are structured and applied.