This page provides Business administrators a user guide for the Rules Manager microservice for the Infosys Equinox platform.
Getting Started
Overview
Accessing the Rules Manager Admin Console
The Rules Manager microservice (“Rules Manager”) gives a business the ability to configure the conditions (rules) and its actions for different events like user signup, login, view products, add to cart, checkout, placing an order, etc. These events are configurable in the Rules Manager. The set of rules with the active status for an event is executed on specific dates based on the priority order. On matching the conditions, the event is either allowed or denied, redirected to a defined URL and the additional properties are added for the customer.
For a detailed overview of the Rules Manager microservice, see the Rules Manager Microservice Overview.
Service Glossary
- Business Admin – a role that manages business settings, creates, and manages stores, and enables microservice(s) for a business.
- Rules Manager Admin – a role that creates and manages events, rules manager groups, rules.
- Rules Manager Group – container for individual rules that are grouped logically based on an event. Creation of a Rules Manager Group is required and should be defined before a Rule can be created.
- Rules – configured actions to be performed based on the configured conditions. For example, to allow only certain e-mail IDs for sign up event.
- Events – defines the event type (such as user registration, referring a friend, liking the business on Facebook, add to cart, etc.) which is configured and used within a rule.
End-to-End Steps to Configure the Rules Manager Data
To configure rules manager data, you need to follow the sequence given below:
- Configure the Rules Manager’s collection properties based on the business needs.
- Create events with the required properties.
- Create one or more rules manager groups.
- Create one or more rules under each rules manager group.
- Configure conditions in each rule.
- Configure action(s) in each rule.
- Verify the result in the storefront.
Accessing the Rules Manager Admin Console
top | Configuring Search Parameters
To access the Rules Manager Admin console,
- Log in to the Foundation server for your business (URL provided by Infosys Equinox).
- Click Rules Manager in the StoreOps page.
The Rules Manager landing page appears:
Configuring Search Parameters
Accessing the Rules Manager Console | Rules Manager Group Page
In the Rules Manager Group page, you can search based on Rules Manager Group Name, Priority, Status, and/or Date, modify the search fields as needed, and select the number of pre-defined rows per screen.
Search for Rules Manager Group
To search the rules manager group,
- Click the Rules Manager Group Name, Priority, and/or Status drop-down list in the header to open an entry field to provide search criteria.
Note: For displaying a predefined number of rules manager groups per screen, see Selecting Predefined Rows. - Enter the desired search criteria in the search field, and then click Go.
The rules manager group(s), which matches the search criteria appears.
Modify Searchable Fields
To modify the searchable fields,
- Click the vertical ellipse available at the beginning of the search field.
- Select or deselect the items to add or remove the searchable fields in the header:
- Click the Go button.
The selected searchable fields appear in the header:
Selecting Predefined Rows
By default, 10 rules manager groups per screen will appear, but the number of rules manager groups per screen can be modified as follows:
- Click the vertical ellipse available at the beginning of the search field.
- Select Row Select.
The Row Select appears as part of the search criteria.
- Select 10 Rows, 25 Rows, or 50 Rows from the drop-down list.
- Click the Go button. The selected rows of rules manager group appear on the screen.
Note: To reset the search field in the header, click the Reset button.
Rules Manager Group Page
Configuring Search Parameter | Configuring Events
In the Rules Manager Group page, you can:
- create a new Rules Manager Group
- view or edit the existing Rules Manager Groups
- delete a rules manager group
- search by rules manager group name, priority or status
- sort rules manager group name, priority, or status by ascending/descending order
Note:
- Pagination option appears in all screens that contain the rules manager group information.
- To navigate to the next page, click Next.
Creating a New Rules Manager Group
A rules manager group is nothing but a container of multiple rules for an event. You can prioritize and allow active rules to be executed only on the specific duration.
To create a new rules manager group,
- In the Rules Manager home page, click the Create Rules Manager Group button.
The Create Rules Manager Group page appears:
- Enter/select the following required information:
Field Description Group Name Enter a name that describes the rules manager group. Date Range Select the start date and time, and end date and time for the rules manager group. The rule engine executes the rules only if it is within this date range.
The following statuses shown in the summary of the rules manager group based on the date range:- – indicates the rules within the rules manager group is yet to start and will be executed by the rule engine only on the defined date range.
- – indicates the rule execution has been started and in progress.
- – indicates the rules within the rules manager group has been expired and will not be considered by the rule engine.
Status Select: - Active to activate the rules manager group. The rule engine checks only active rules manager groups.
- In-Active to deactivate the rules manager group. Later, you can change the status to ‘Active’ if required.
Note: When the rules manager group is within its time bounds and the status is made inactive, the rules manager group will not be picked up by the rule engine to execute the rules within it.
Priority Enter the priority number between 1 and 25 where 25 being the highest and 1 being the lowest in the priority order. The rule engine reads the active rules manager groups in it as per the priority order. - Click the Save button to save the newly created rules manager group. Once the group is created, in the Rules Manager Group tab, you can view/edit the created rules manager group details and/or create a new rule within the group.
Creating a New Rule
You can create multiple rules with a different set of event types, action types, and priorities within each rules manager group.
The rule engine executes the rules manager group and rules within each rules manager group based on the priority, active status, and event type. The rule engine reads each active rule within the group, executes the event and actions set for each rule.
Note: Before creating a rule, you need to configure events. For more information, see Configuring Events.
To create a new rule,
- In the Rules Manager’s home page, click a particular rules manager group.
The summary of the created rules manager group opens:
- Click the Create Rules button.
The Create Rules page appears:
- In the Create Rules page, enter/select the required information:
Field Description Rule Name Enter a name that describes the rule. Priority Enter the priority number between 1 and 25 where 25 being the highest and 1 being the lowest in the priority order. The rule engine reads the active rules manager groups and active rules in it as per the priority order. Event Select the required event type. Note: The configured event appears here. For information on how to configure event types, see Configuring Event Types.
Date Range Select the start date and time, and end date and time for the rule. The rule execution will be applicable only on the selected date and time, otherwise, the rule expires. You will be able to select the date for a rule that falls within the rules manager group duration. The following statuses shown in the summary of the rule based on the date range:
- – indicates the rule is yet to start and will be executed by the rule engine only on the defined date range.
- – indicates the rule execution has been started and in progress.
- – indicates the rule has been expired and will not be considered by the rule engine.
Note: The rule created within the rules manager group is bound to be within this start and end dates.
Status Select: - Active to activate the rule. The rule engine considers only active rules manager groups and rules.
- In-Active to deactivate the rule. Later, you can change the status to ‘Active’ if required.
Note: When the rule is within its time bounds and the status is made inactive, the rule will not be picked up by the rule engine to execute.
Display Message Enter the locale-specific display message. Description Enter the locale-specific description. Add Locale Click this button to add multiple locales. Accordingly, you need to add the display message and description for the selected locale.
Note: The Add Locale drop down appears when there are multiple locales configured at the store level. The list of locales are defined in the collection property applicablelocales. - Click the Save button to save the rule to the rules manager group.
The Summary page will be displayed where you can view/edit the rule details:
Editing a Rule
To edit a rule, perform the following steps:
- In the Rules Manager Group page, click a particular rules manager group.
You can see the list of rules within the group. - Click on a particular rule.
Note: To delete an inactive rule, click the icon against the rule. You cannot delete a rule with the active status. For more details, see Deleting a Rule.
The rule details appear:
- Click:
- the icon to edit the rule details.
- the CONDITIONS tab to create conditions; see Configuring Conditions to the Rule for more information.
- the ACTIONS tab to set actions to the rule; see Creating Actions to the Rule for more information.
Deleting a Rule
You can delete a rule. You will be able to delete a rule only when its status is inactive.
To delete a rule,
- In the Rules Manager Group page, click a particular rules manager group:
You can see the list of rules within the group. - Click the icon against a rule that is in inactive status:
- In the Confirm pop-up, click Yes:
The rule is deleted.
Configuring Conditions to the Rule
You can add multiple rules or group of rules to a rule. By default, a row will be shown to add a rule. After setting the conditions to the rule, you need to click Generate Query to validate if the configured condition is appropriate to the use case or not.
- In the CONDITIONS tab, click the icon.
- Set rules as required.
The following table describes options to create rules or group of rules to the rule:Options in Condition Description Enables you to set logical operators such as follows: - NOT – negates the value of the condition
- AND – returns true when all the conditions are true; otherwise returns false
- OR – returns true when any one of the conditions is true; otherwise returns false
These operators apply the rules that are a direct descendant in the condition builder.
For example,
To create a condition where you need to allow the users only from the selected countries with a specific email domain, you need to configure the following rules:
Enables you to add multiple rules to the Condition. For example,
Enables you to add a collection of rules within the group. For example, if you need to allow users with a specific name and specific email domain from the selected countries:
Operands/Operators/Values Enables you to select the operands and operators for the condition. You can create different conditions by changing the combination of operands and operators. You can enter the required value for the selected item.
- Operands – The list of operands appears based on the event type of the rule. The properties which are configured under Additional Properties in the Events section is displayed as operands here. The property with Property Level as Input or Input/ Output can only be added as an operand here. For more details, see Configuring Events.
- Operators – Select any one of the following operators:
- equal – The value must exactly match the selected operand.
- not equal – The value must NOT match to the selected operand.
- less – The value must be less than the selected operand.
- less or equal – The value must be less than or equal to the selected operand.
- greater – The value must be greater than the selected operand.
- greater or equal – The value must be greater than or equal to the selected operand.
- in – Matches any one of the values in a list of values (separated by comma) you specify
Note: You can select a pre-defined list or manually enter values for specific operands. - not in – Finds values excluding any one of the values from the list of values (separated by comma) you specify
- between – Checks for the value that is between the values you specify
- not between – Checks for the value that is not between the values you specify
- contains – Finds records containing the specific value
- doesn’t contain – Finds records excluding the specific value
- begins with – Checks for the value that begins with the value you specify
- doesn’t begin with – Checks for the value that does not begin with the value you specify
- ends with – Checks for the value that ends with the value you specify
- doesn’t end with – Checks for the value that does not end with the value you specify
- is not empty – Checks for the records or values that is not empty
- null – Checks for the value that is null
- is not null – Checks for the value that is not null
- Values – Provide a value that matches with the data type of the operand.
Note: The value should match with the data type of the property key defined in events.
Allows you to delete a rule group in a condition. Allows you to delete a rule in a condition. Enables you to generate conditions and validate against your appropriate use case, after creating conditions using the condition builders. Click this button to view the generated conditions. For example,
- Select a status, which allows you to stop further processing of the succeeding rules manager groups:
- Never – Whether or not the condition matches in the current rules manager group, continue to execute the succeeding rules manager groups. By default, this option will be selected.
- Always – Whether or not the condition matches in the current rules manager group, the rule engine stops executing the succeeding rules manager group.
- If condition matches – When the current rules manager group’s condition matches, rule engine stops executing the succeeding rules manager group.
- If stop condition matches – Enables you to define the stop condition. The rule engine stops executing when the Stop condition matches. The user can specify the business rule that can stop the processing of rule engine.
Note: For details, see Creating Conditions to the Rule.
- Click the Save button to save the conditions to the rule.
Creating Actions to the Rule
Overview
After creating a new rule and creating conditions to it, you need to specify what needs to be done when the condition matches. This is set using the actions such as Allow, Deny, Redirect, Add Param, etc. You can also create multiple different actions based on the action condition and assign different rule values to each action by specifying the required formula. The actions will vary according to the event and the action selected for a rule.
Creating an Action
To create an action,
- In the ACTIONS tab, click Add Actions.
The create action page appears:
- Enter an action name, which describes the action.
- Select the action type as follows:
Action Type Description Allow Allows the user actions in the storefront for the configured conditions. For example, to allow the user signup only using a specific email domain:
Example: You can configure to allow a user to sign in from a particular social media and country. Also, exclude users from a particular state in that country.Deny Denies the user actions in the storefront for the configured conditions. You need to provide a denial message to be displayed in the storefront. For example, to deny users signing in from the restricted country:
Example: You can configure a parameter for the total SKU count allowed in the cart. The user will not be able to purchase SKUs beyond this cart count in the storefront.Redirect Redirects the customer to the configured URL. For example, - redirecting to Terms and Conditions page when the customer’s age is below 18:
- if the user is searching for a product and if the product is not available, the user is redirected to the next available product page.
Add Param Allows to add a list of custom parameters in the response of the action. You need to define these parameters in the events with Property Level as Output or Input/ Output. These parameters are processed in the storefront for the user actions.
Note:- A validation error is shown while trying to add duplicate keys in the same rule.
- The value should match with the data type of the property key defined in the event.
Note: Based on the default value configured in the customActionTypesConfig collection property, the action types are listed in the Action Type drop-down list.
- redirecting to Terms and Conditions page when the customer’s age is below 18:
- Configure the conditions which are specific to the action type.
Note: For more details on configuring conditions, refer to Configuring Conditions to the Rule. - Click the Save button to create an action.
Note: You can create multiple actions to a rule. However, only one action will be executed based on conditions.
Viewing or Editing an Action
The created actions will be displayed as an accordion under the Actions tab.
To view or edit an action,
- Click on a particular action or the icon. For example,
- Make necessary changes in the action name.
- Click the Save button. The updated action is displayed under the Actions tab.
Note: To discard the changes, click Cancel.
Viewing/Editing a Rules Manager Group
In the Rules Manager Group page, you can view or edit a particular rules manager group.
To view/edit a rules manager group,
- In the Rules Manager Group page, click on a particular rules manager group.
Note: To delete an inactive rules manager group, click the icon against the rules manager group. For more details, see Deleting a Rules Manager Group.
The following page appears where you can view the list of rules available within the group and general details of the rules manager group.
- Click the icon to make necessary changes if required:
- Click the Save button.
Deleting a Rules Manager Group
You can delete a particular rules manager group. You will be able to delete a rules manager group when the following conditions are met:
- The rules manager group must be inactive.
- All the rules within that rules manager group must also be inactive.
To delete a rules manager group, in the Rules Manager Group page:
- Click the icon against a particular rules manager group that is in active status:
- In the Confirm pop-up, click Yes:
The rules manager group is deleted.
Configuring Events
Rules Manager Group Page | Revision History
Before creating a rules manager group and rule, you need to configure events. In the Events page, you can create an event and assign properties to it. Once created, the event name will be displayed under Event Type while creating a new rule.
- The events created here need to be mapped with the events in the Storefront Orchestration service (SFO).
- You can delete an event only via the Delete an Event API of the Rules Manager Swagger. While deleting, ensure that the event is not associated with any rules.
Creating an Event
To create a new event,
-
- Click Events in the left panel. The Events page appears:
- Click the Create Events button.
The Create Events page appears:
- In the Create Events page, enter/select the required information:
Field Description Event Name Enter a name that describes the event.
Note: This name will be displayed in the Event drop-down list while creating a rule.Description Enter the description. Status Select a status: - In-Active to deactivate the event. Later, you can change the status to ‘Active’ if required.
- Active to activate the event. Only the active events are used in rules.
- In the Additional Properties section, click the Add Property button. A row will be added.
Note: You can also add multiple properties to an event. - Provide a name for the property to be added.
Note: This name is displayed in the Conditions tab of the rule configuration. - In Value, enter a valid JSON path of the request data (JSON).
Note:- For example, if the request JSON is {“data”: {“price”:100,”quantity”:5,”type”:”Mobile”}}
then the Valid Path: For obtaining price, enter price; for obtaining quantity, enter data.quantity - The mapping of the request data of the microservice and the storefront orchestration service should be configured by the developers before passing it. For example, the JSON path for the customer’s e-mail ID in the Customers service is Users.email, however, the JSON path in the SFO service is CustomerDetails.email.
- For example, if the request JSON is {“data”: {“price”:100,”quantity”:5,”type”:”Mobile”}}
- Select a property level.
The value can be:- Input – Indicates the property can be added as an operand in conditions. For more details, see Configuring Conditions to the Rule.
- Output – Indicates the property can be added as a parameter in the Add Param action type. For more details, see Configuring Actions to the Rule.
- Input/ Output – Indicates the property can be added in both conditions and Add Param action type.
- Select a data type.
- Click the Save button.
The added event appears under the Events page.
- Click Events in the left panel. The Events page appears:
Viewing/Editing an Event
To view or edit an event,
- Click Events in the left panel.
- In the Events page, click a particular event; for example,
- Make necessary changes.
- Click the Save button. The updated event appears under the Events page.
Date (YYYY/MM/DD) | Description | Created By | Peer-Reviewed By | Approved By |
2023/10/13 | Updated for release 8.15 | AN | JP | Shruthi |
2023/06/06 | Page created and content added for 8.14. | AN | JP | Shruthi |