Monitor and Notify When Thresholds are Approached
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 10:48 PM
Requirement 1.
We have created below three groups
1.OpCo_Local_Admin
2. OpCo_Fulfiller_License
3. OpCo_Approver_Admin
Requirement 2.
We have created Custom table 'u_license_tracking' with custom field
1.Company (Reference to `core_company`)
2.Fulfiller_Count (Integer)
3. Approver_Count (Integer)
4.Fulfiller_Budget (Integer)
5. Approver_Budget (Integer)
Write a scheduled script or Business Rule to populate this table with counts (from the OpCo groups mentioned above).
Requirement 3.
As a License Manager,
I want a scheduled job to check if the number of users with "Fulfiller" or "Approver" roles is nearing the threshold for each company,
so I can take action before limits are exceeded.
• If counts are within 10% of the thresholds, a notification is sent to a designated group or email.
• Notifications include company name, current counts, and thresholds.
• If the number of licenses = threshold, the notification should contains "You have no more licenses available", if not, the notification should contains "You have X licenses left to allocate"
Could you please help me for above requirement how to calculate threshold and how to trigger notification with scheduled job.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 11:20 PM
You can do something like,
1. Create a Business Rule to update your custom table with Fulfiller Count and Approver Count. This can be created on sys_user_grmember table on insert. Assuming the roles are already added to the group so that it will be inherited to the user upon adding the user to group. You can also double check this by looking up to sys_user_has_role table to query user and role and granted by. Please note that you need to keep on incrementing the counts whenever a new group member is added to the group.
2. Create a flow which runs on a specified duration on this custom table which performs
- Calculates the 10% of Threshold (I am assuming that you have defined the threshold values somewhere for each company)
- If count is < 10% of the threshold, use notification action to send the notification based on your template
- Else if count => threshold then another notification with a specific content
You can do all these in a single flow.
Please mark if this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 11:52 PM
Could you please tell me how to calculate threshold and after calculating it how to configuration notification?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2025 01:20 AM
Hi,
You can calculate the threshold by doing simple math something like the below. You need to store the calculated value in a flow variable and use that variable to compare the it against the current license count.
Lets say,
Threshold = 50
10% Threshold = 50 * 0.10 = 5
Current license = 10 ; assuming 10 members with license
Then the condition (Current license count > 10% of Threshold) will be true. You can trigger a notification.
Similarly you can the logic for other scenario as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2025 03:56 AM
How to trigger notification to the group using scheduled job?