Rule Chain
IMPORTANT - Articles Impacted due to 6.42 July CS Release
Due to the v6.42 July, 2024 release, this article has been impacted. Steps, images, and playable GIFs in this article will soon be updated to reflect the latest changes.
This article explains admins how to simplify the process of scheduling groups of related rules that must run in a particular sequence.
Overview
Rule Chains are groups of related rules that are chained together to execute one after another with a shared schedule. In the Rule Chain tab, you can configure chains of rules and view existing rule chains. In Rule Chain, you can also add rules as a sub-chain for every rule.
Limitations:
- You can add a maximum of 20 rules to a rule chain.
- A rule can be added to a maximum of five Rule Chains.
- The schedules of the Rules that are already scheduled to run are deleted when they are added to a Rule Chain.
For more information on the Rule Chain List view, refer to the Rule Chain Listing Page section.
Create Rule Chain
To create a Rule Chain:
- Navigate to the Administration > Rules Engine > Rule Chain.
- In the Rule Chain list view, click the Create Rule Chain option. The Create New Rule Chain page appears with the following three sections:
Chain Details Section
- In the Rule Chain Name field, enter the name for the rule chain to identify the chain uniquely.
- (Optional) In the Rule Chain Description field, enter a brief description for the rule chain.
- Click Continue.
Add Rules Section
- In the Add Rules section, add Rules to the chain and sub-chains, and then re-arrange rules to set the order of the run.
Note: You can drag-and-drop rules in a rule chain to any level.
- Click Continue.
Notes:
- Rules at the same level run independently. However, if a Rule gets into a ‘Failed’ or ‘Partial Success’ state, then its sub-chains are not got executed.
- Horizon Rules also can be added from the Select a Rule dropdown list.
Schedule
Rule Chain scheduler allows you to run rules in the following two ways:
Important: Rule Chain can only be scheduled to run once a day.
Time-Based
The time-based schedule type allows you to schedule a rule chain daily, weekly, or monthly.
To schedule Rule Chains based on date and time:
-
In the Schedule section of the Create Rule Chain page, select the Time-Based option.
-
In the Schedule Type option, select one of the following options to set the rule chain frequency:
-
Daily: The following options are available when you select the Daily option:
-
Every Weekday (Mon-Fri): Select this option to run the rule chain only on weekdays.
-
Every day: Select this option to run the rule chain every day (Sun-Sat).
-
-
Weekly: Select the day of the week on which the rule chain must run once during the week.
-
Monthly: The following options are available when you select the Monthly option:
-
On Day: Select the day of the month on which the rule chain must run once during the month.
-
On the: Select any weekday in a Month on which the rule must run.
-
- In the Start Date field, select the date on which the execution of the rule chain must start.
- In the End Date field, select the date on which the execution of the rule chain must end.
- In the Select Time field, select the preferred start time in hours and minutes.
Note: Currently, we do not support scheduling a rule chain to run in repeat mode (for example, 2, 3, 4, etc.). Instead, we allow a rule chain to run once a day.
- In the Select Time Zone field, select the preferred time zone.
- Enable the Send notification email on every run toggle option to send the Rule Chain success or failure messages to the logged-in user.
- In the Mention Emails for Failure and Mention Emails for Success sections, add the email addresses of users who must be notified when this rule chain succeeds or fails.
Note:
- You can add multiple email IDs separated by a comma.
- When the rule chain has Partial Success, it will deliver the result to the email address added to the Mention Emails for Failure.
-
Click Save Rule Chain.
Event-Based
This schedule type executes a rule chain in the following two ways:
Events Framework
You can run a rule chain using an event from the Events Framework. Using the Event Schedule type, you can run the rule chain using the CURL command. CURL command is a handy way to trigger a rule outside of Gainsight. The events-based triggering of a rule chain helps you eliminate the need to schedule a rule. In a broader sense, event-based triggering of a rule chain enables you to integrate rules with non-Gainsight services if you have developer support.
To schedule Rule Chains based on events:
- In the Schedule section of the Create Rule Chain page, select the Event-Based option.
- Select the Events Framework option.
- In the Select a Topic and Select an Event fields, select the appropriate topics and events.
- Enable the Send notification email on every run toggle option to send the Rule Chain success or failure messages to the logged-in user.
- In the Mention Emails for Failure and Mention Emails for Success sections, add the email addresses of users who must be notified when this rule chain succeeds or fails.
Note: You can add multiple email IDs separated by a comma. -
Click Save Rule Chain.
S3 File Ingestion
This schedule type is applicable only if your rule has an S3 dataset. You can use this schedule type to trigger a rule chain automatically that is configured using an S3 dataset. When you upload a new CSV file that matches with the configuration as the S3 dataset, the S3 dataset rule is triggered automatically.
Note: If you are using the EQUALS option in the File Path field of your S3 dataset, you must ensure that the old and new file names must be the same. However, if you are using the STARTSWITH option in the File Path field of your S3 dataset, the rule in the rule chain is triggered for any CSV file uploaded that matches the string's start.
To schedule a rule chain based on an Event for S3 File option:
- In the Schedule section of the Create Rule Chain page, select the Event-Based option.
- Select the S3 File Ingestion option.
- In the Select a Rule field, select the rule that contains S3 data information.
- In the Select an S3 Task field, select the S3 task for the selected rule.
- Enable the Send notification email on every run toggle option to send the Rule Chain success or failure messages to the logged-in user.
- In the Mention Emails for Failure and Mention Emails for Success sections, add the email addresses of users who must be notified when this rule chain succeeds or fails.
Note: You can add multiple email IDs separated by a comma. -
Click Save Rule Chain.
Rule Chain Listing Page
You can view the Rule Chain listing page by navigating to the Administration > Rules Engine > Rule Chain tab. The listing page displays all the rule chains created by the admin.
Rule Chains are displayed on the listing page with the following columns:
- Rule Chain Name: The name of the Rule Chain. Click on the name to navigate to the Rule Chain editing page.
- Status: A toggle switch that indicates whether the rule chain is active.
- Number of Rules: The total number of rules that are added to the rule chain.
- Last Run Status: The previous execution status of the rule indicating success, failure, or partial success. Clicking on this status navigates you to the Execution History tab of the rule.
- Last Run: The date and time at which the rule chain was last triggered.
- Next Run: The date and time at which the rule chain is scheduled for its next run.
- Last Modified by: The name of a person who modified the rule chain most recently.
- Created On: The date and time on which the rule chain was created.
- Last Modified Date: The date and time on which the rule chain was last modified.
- Created By: The name of the person who created the rule chain.
Click the '+' icon to add/remove any of the above columns to your view. You can also sort and rearrange columns as required.
Quick Filter
In the Rule Chain Listing view, you can filter the rule chains using the Rule Chain dropdown list into the following categories:
- All Rule Chains
- Active Rule Chains
- Inactive Rule Chains
Pagination
If you have multiple rule chains, use the pagination tool at the bottom right corner to navigate through different pages and view multiple reports, in a set of 20, 40, or 60 on a single page, based on your preference.
Additional Options
Click the three-vertical dots icon of a Rule Chain to view the following additional options:
Run Now
After a Rule Chain is created, you can use the Run Now option to configure the rule to run.
To schedule the rule chain:
- Click the three-vertical dots icon for a rule chain and click Run Now. The Rule Count Check dialog appears.
- In the Run this Rule Chain For field, select Once.
- Select the date when to run the rule chain in the Select Rule Chain Date field.
- Select the Test Run check box if you like to test-run a rule chain and receive an email with a summarized results list.
- In the Send Rule results to these email field, enter additional email addresses of users who must receive a copy of the Rule Chain result email.
Note: The email ID of the logged-in user is auto-populated in the field. - Click Run Now.
Edit Chain
This option allows you to edit the rules in the rule chain. Click Edit to navigate to the Chain Details section of the rule chain creation page.
Execution Logs
This option allows you to view logs of the rule chain along with the event and action data. The execution logs of a selected rule chain appear with the following sections:
- Execution Logs: This list is arranged in descending order with the latest execution details appearing at the top. Click on the Date and Time stamp to view Log details of that execution of the selected Rule Chain.
- Execution Log Details: This log contains the following details of execution:
- The date and time stamp indicating when the rule chain last completed the execution.
- The total number of rules executed from the rule chain and the number of rules completed and failed.
- Execution history of each triggered rule in the rule chain. You can click on each rule to view the complete logs of that rule in the Execution History tab of the rule details. For more information on the execution history details, refer to the Schedule and Execute Rules article.
- Refresh: Click this option to update the execution status of the rule chain.
- View Logs: Click this option to view the logs of the rule chain.
Delete Chain
This option allows you to delete the rule chain permanently.
Known Issues
- The date format that is currently accepted is YYYY-MM-DD.
- There is a possibility that rule results emails may not trigger in the precise order that the rule chain executes.