SAP Knowledge Base Article - Public

2431478 - Example Configuration of an EC Alert and Notification Rule

Symptom

Examples of EC Alert and Notification Rule configurations

New Base object : 2856599 - 1911 - Rule Scenario Base Objects Used in Alert Triggering Rules for Employee Central Data Objects - Generate Alerts for Employee Central Data

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental. 

Environment

  • SAP SuccessFactors HXM Suite
  • SAP SuccessFactors Employee Central

Resolution

Note: There are Best Practices and also some scenarios to be avoided when configuring these rules.

New Base object : 2856599 - 1911 - Rule Scenario Base Objects Used in Alert Triggering Rules for Employee Central Data Objects - Generate Alerts for Employee Central Data

Note: Post 1H 2021 Release: Delete Old Pending Alert

  • Using this new rule setting, you can delete unwanted pending alerts for several HRIS effective-dated entities when creating a new alert.

    After a new alert is created following a data change, old pending alerts become irrelevant and are not expected to be sent. You can update your alert rules by including the new setting Delete Old Pending Alert Flag. This will delete unwanted pending alerts and prevent them from being sent for future data changes. Three HRIS effective-dated entities are supported now: job information, compensation information, and pay component recurring.

    Guide and Chapter:New Rule Setting for Deleting Unwanted Pending Alerts for Effective-Dated Entities 

Best Practices

Due to the way the Alerts and Notifications are processed, certain rule configurations will work better for this process than others. Understand with this configuration the saveAlert rules are only processed during the EC Alerts and Notifications scheduled job. The job will only check the rules against records which were Last Modified between the jobs "Last successful run date" and the day/time the job runs on.

As the job does not check every record in the system during every run, certain rule configurations mean the Alert will only be generated if the record is modified and job run on a very specific date.

  • EC Alerts and Notifications Job Execution

Refer to the Job Execution Overview section of the handbook, to better understand how EC Alerts and Notifications job execute. This is very important to understand before implementing EC Alert rules.

What is a good rule configuration?

  • Never set the IF as Always - the rule will ALWAYS be passed against every record that was "Last Modified" between the jobs "Last successful run date" and the day/time the job runs on. Therefore it will trigger every time.
  • Always do a NULL check against the value you are triggering the alert for (such as Probation End Date or Contract End Date).
  • Where possible, it is also work doing a "Value is not equal to Previous Value" check to ensure that the new Alert is only triggered if the value has changed. For example, we do not need to make a new Alert message if a new record is inserted or existing record is edited, but the Probation End Date has not changed.
  • Use the "Event Date" and/or "End Date" to force the system to only create the Alert if the record being inserted is a new (future) record or the "current" record. 

Good Example 1:

This Rule is to trigger an EC Alert and Notification 1 day prior to the users Probationary Period End Date:


1.png

Below is a breakdown of the rule's conditions and their relevance

  • The below highlighted conditions only trigger for users who have made a change to their 'Probationary Period End Date'.
  • Since this rule is triggered from Job Information, there is a high possibility that an employee may have more than one record were the ‘Probation Period End Date’ is the same.
  • To stop multiple alerts from being triggered (one for each record). We can create an ‘IF’ condition in the rule to stop this.
  • This is done by comparing the current value with the pervious value and only triggering if there is a change.

2.png

  •  The above highlighted condition stops the alert from being sent if you remove the 'Probationary Period End Date'.

3.png

  • The above highlighted condition stops the alert from being sent for changes made where the  'Probationary Period End Date' is set to a date in the past.
  • Without this condition, when the  'Probationary Period End Date' is changed to a date in the past, an alert will be sent out the day after the change is made, when the job runs again.

4.png

  • The below highlighted condition sets the Alert effective date set to 1 day before the 'Probationary Period End Date'.

5.png

Good Example 2:

The following example is a little more specific. As per the above example it is the same but constrains the trigger more to ensure that either the record must be either a future dated record OR the current record.

ContractEndDateAlertRule_Good.png

  • If you would also like to trigger the same alert for different Intervals e.g. 30, 10 and 1 day emails, please review KB article 2462860 - How to Configure EC Alerts and Notifications to be sent on Staggered Dates/Intervals. 

What is a bad rule configuration?

When configuring the EC Alert and Notification rule, using the DatePlus() condition in the IF section of the rule will increase the risk that the Alert will not be triggered because of how the Alert will be created. This is partly due to the way the EC Alerts and notifications job works (again, please refer to the "Job Execution Overview" section in the handbook).

Scenario example:

For example, we have requirement to trigger and Alert 1 month before the Contract End Date, which is stored in Job Information. So we create an Alert Rule, and using DatePlus() we want to trigger the alert 1 month before the Contract End Date expires - but have not taken into consideration how the EC Alerts and Notifications feature really works. Here is the Example rule:

ContractEndDateAlertRule.png

Explanation of why this is not a good idea:

Do not use is equal to Date Plus in if condition

The employee USER1 is hired with effective date 1st August and the Contract End Date is 14th November 2018. The hire process was completed on and the record was inserted into the system on 20th July 2018.

When the EC Alert job ran the next day (early hours of 21st July 2018) it would evaluate all the Job Information records that were Last Modified between the jobs "Last successful run date" and the day/time the job runs on (typically this would be between yesterday and today). The EC Alerts and Notifications job would then find the Job Info record for USER1 as it was Last Modified in this timeframe. It would then check to see if the Probation End Date (14th November 2018) is equal to Today + 1 month. So "today" +1 month = 21st August and it would compare this value with "14th November 2018" and it would not match.

As that record has been processed already and when the ob runs again tomorrow it will look at all Job Info record that were Last Modified between 21st July (the time after it last ran) and "Today" (early hours 22nd July) the record is not included. Therefore the Alert will never get generated.

To further explain: 
Then another Job Info Data Change was inserted later for USER1 on 14th October 2018 (exactly 1 month before the Contract End Date). The Alert Job that then runs on 15th October 2018 would of course include this Job Info record in the job run, and compare it to the Alert rule. But, the rule would compare 15th November 2018 (Today +1 month) with 14th November 2018. The rule would not match and not trigger the alert.

The DatePlus() rule function in the IF condition of the Alert Rule is what is causing this not to trigger. For this to have worked the Job Info record would need to have been "Last Modified" on the 13th October 2018, so that the Record would then be picked up in the following days EC Alerts job run, which would then consider 14th October 2018 ("Today + 1 month) being equal to 14th November 2018.

This is not to say that you cannot use DatePlus() rule function in the IF condition of the EC Alert rules, but it restricts the chances of the Alert ever getting created.

Recommendation:

Do not use DatePlus() in your IF conditions ever. As per the Good Examples above, use the Effective Dating of the record to determine whether the Alert should be created.

Also As confirmed by EC Alert Developer team, You can use (is on or after Date Plus) in If Condition

See Good Examples below

alertec.PNG

Also note that the EC Alerts and Notifications job execution will perform other actions, such as removing Pending Alerts from Inactive Subject User or Recipient, as well as removing identical duplicates. Please refer to the "Job Execution Overview" section in the handbook

FAQ - Additional Information

Q) Where can I get information on this from the Guide?

A) Guide: Employee Central Workflows: Implementation and Administration

Chapter: Alert Example

Q) Which base object can I use for an alert Rule

A) New Base object : 2856599 - 1911 - Rule Scenario Base Objects Used in Alert Triggering Rules for Employee Central Data Objects - Generate Alerts for Employee Central Data

Q) Where can I get information on MDF Alert

A) 2560623 - Step by step configuration of MDF Alerts & Notifications [Custom MDF] / 2532558 - EC Alerts: Configuring Alerts for MDF Objects

See Also

  • 2315275 - Employee Central - Workflows & Alerts
  • 2156278 - How to set up EC Alerts and Notification using Business Rules
  • 2462860 - How to Configure EC Alerts and Notifications to be sent on Staggered Dates/Intervals
  • 2757243 - Termination reminder alert
  • 2666252  - Can email templates created in document generation be used for EC Alerts?
  • 2677124 - EC Alerts: System Logic for when a saveAlert Rule is Removed or Changed
  • 2462997 - EC Alerts and Notification Job Failing 
  • 2757863 - Manage Alerts and Notifications tool
  • Guide: Employee Central Workflows: Implementation and Administration

Keywords

SF, success factors, Business Rules, EC, terminate, Ec Alert, workflow , KBA , LOD-SF-EC-ALR , Alerts & Notifications (saveAlert - EC Core only) , How To

Product

SAP SuccessFactors Employee Central all versions ; SAP SuccessFactors HXM Suite all versions