Business rules are used to add application logic to the system and used in different scenarios across all SAP SuccessFactors solutions. In Employee Central Core, business rules are used to automate HR processes, such as workflow and event reason derivations, alert notifications, and many others.
Business rules are comprised of the following:
- Condition (IF) - The logic that must be met before the system takes action. When you want the system to apply the action every time, set the IF statement to Always True .
- Action (THEN) - The logic that defines how the system reacts when the condition is met. Some application-specific scenarios do not require a THEN statement.
- Trigger or Rule Event - The event type that activates the rule processing.
Business rules can be applied to any application of SAP SuccessFactors. In this unit, we will only cover the rules for Employee Central data.
IF Logic
IF statements are the conditions in the rule that must be validated. It determines when the THEN logic is executed. The IF logic uses "and"/"or" statements. The following list provides examples of when IF logic is used:
- If a particular option is chosen from a picklist
- If specific text or numbers are entered into a field (or if they are greater than or less than the values stated)
- If a field value has changed
Some rules are created without an IF statement. This is also known as Always True, which means there are no conditions for the system to validate. Once the rule is triggered, the system will execute the THEN statement.
Else If statements allow you to combine several conditions in the same rule.
THEN Logic
The THEN statement determines the system action once the condition is met. Depending on the use case, these are the actions the system can execute with Then logic:
- SET: This automatically propagates information based on existing information or a specific value chosen.
- Raise message: This brings a pop-up box up on the screen that provides additional information to the user filling in the information or an error message that something was done incorrectly.
- Create: This creates a child object. Examples include adding a new pay component to an employee or creating another child object attached to the parent object.
- Delete: Delete data from the database when the condition is met. For example, you can remove a pay component when the employee moves away from London.
- Execute: Carry out specified action when the condition is met.
- Add to: Add items to a collection when the condition is met. For example, you can create a single rule to assign multiple learning courses to new hires.
ELSE statements can also be added. These actions occur when THEN statements are not applicable because the IF condition is NOT true.
Triggers or Rule Event Types
Triggers, also called rule event types, initiate the rule processing. The system will not validate the conditions (IF statements) or execute any actions (THEN statements) if no user action activates the rule.
There are six rule events associated with HRIS elements and fields. Rule events define which user action sets the rule execution. Complete the interaction or use the table to learn more about triggers or rule events.
Rule Event for HRIS Elements
This event/trigger | Is assigned at... | Rule is triggered... | Use this event to... |
---|---|---|---|
onChange | Field level only | When a field value is changed | Activate rules as soon as the user changes a field |
onInit | HRIS Element level | During hire/rehire, using Add New Employee page. When creating a new FO record in Manage Org Pay and Job Structures page (for example, location, event reason). | Set field properties (for example, making fields mandatory or hiding fields) or default values you want to be shown as soon as the user calls up the Add New Employee or Manage Organization Pay and Job Structures UI. |
onSave | HRIS Element level | When the page is saved. | Validate user entries when the user wants to save the changes. For example, if the user didn't make an entry in a mandatory field, an error message is displayed. |
onView | HRIS Element level | When viewing transient fields on the page. | Calculate fields that are transient (this means that the result is not a fixed value stored on the database but is calculated during rule execution when the user calls up the page). For example, to calculate an employee's age. |
saveAlert | HRIS Element level | When a change to jobInfo, compInfo, employmentInfo, workPermitInfo is saved. | Sends alerts to remind users of upcoming system events, such as, visa or contract expiry. |
onPostSave | HRIS Element | After changes to an object is saved | Trigger events for Intelligent Services. |