5.2 Employee Central Rule Events, Rule Scenarios, and Model Base Objects
Key Takeaways
- HRIS elements support six rule events: onChange, onInit, onSave, onView, saveAlert, and onPostSave.
- onChange is assigned only at field level; the other events are assigned at HRIS element level.
- A Model base object (such as Job Information Model) is required to set field properties like Required and Visibility.
- onView rules cannot be used for changes on the Add New Employee screen.
- onSave rules run in the configured order, except that event reason derivation and workflow derivation rules run after all other rules.
5.2 Employee Central Rule Events, Rule Scenarios, and Model Base Objects
Quick Answer: In Employee Central, rules are assigned to HRIS elements and fields in Manage Business Configuration under Trigger Rules. Six events exist: onChange (field level), onInit, onSave, onView, saveAlert, and onPostSave (element level). Use a Model base object when a rule must set field properties. On save, event reason derivation and then workflow derivation run after all other onSave rules.
What a Rule Consists Of
THR81 describes three parts:
- Condition (IF): logic that must be met. Use Always True when the action should always run.
- Action (THEN): how the system reacts. Some scenarios need no THEN.
- Trigger (rule event): which user action starts processing. Without a trigger, nothing is evaluated.
THEN actions include:
- SET: propagate or set a value
- Raise message: an information or error pop-up
- Create: a child object, such as a new pay component
- Delete: remove data, for example a pay component when an employee leaves London
- Execute: carry out a specified action
- Add to: add items to a collection, such as several learning courses for new hires
ELSE IF combines conditions in one rule, and ELSE handles the case when no condition is met.
The Six HRIS Rule Events
| Event | Assigned at | Triggered when | Use it to |
|---|---|---|---|
| onChange | Field level only | A field value changes | React immediately to a field change, such as propagation |
| onInit | HRIS element | Hire or rehire opens Add New Employee, or a new FO record is created in Manage Organization, Pay and Job Structures | Set field properties or defaults as soon as the page opens |
| onSave | HRIS element | The page is saved | Validate entries, derive event reasons and workflows |
| onView | HRIS element | Transient fields are viewed | Calculate transient values, such as age |
| saveAlert | HRIS element | A change to jobInfo, compInfo, employmentInfo, or workPermitInfo is saved | Send reminders of upcoming events, such as visa or contract expiry |
| onPostSave | HRIS element | After the change is saved | Trigger events for Intelligent Services |
Employee Central Core Rule Scenarios
SAP provides scenarios for the most common EC use cases. Each scenario limits the base objects and events you can use:
| Scenario | Purpose and limits |
|---|---|
| Generate Assignment ID External | Generates Assignment ID External from MDF sequences; create only one rule |
| Generate Employee ID for Hire/Rehire | Generates the User ID from an MDF sequence during hire or rehire with new employment |
| Rules for Hire/Rehire | Rules that fire in hire scenarios; base object Employee Information or Employee Information Model |
| Trigger onInit Rules for Hire/Rehire | Initializes HRIS elements in all hire and rehire processes; Employee Information Model; onInit only |
| Trigger Event Reason Derivation | Derives event reasons; base object Job or Compensation Information Model |
| Generate Employee Central Alerts | Creates alerts for EC data |
| Enforce New Employment for Rehire | Validates changes, for example of legal entity, and enforces new employment |
| Trigger Workflows | Triggers approval workflows; onSave only |
| Display Internal Job History | Filters the Internal Job History block |
| Validate HRIS Elements | Validations and alert messages |
| Calculate Full-Time Equivalent (FTE) | Calculates FTE with the Job Information Model |
| Trigger onPostSave Events for Job Information | Events or alerts after Job Information saves; onPostSave only |
| Trigger Cross-Entity Rules | Changes in one entity update another; limited entities |
| Trigger onChange Rules for HRIS Elements | Field-change rules such as propagation from Job Classification; onChange only |
| Trigger onSave Rules for HRIS Elements | Rules on save; onSave only |
| Trigger an Off Cycle Event Batch / Trigger Event for Off Cycle Event Batch | Rules run by the Off Cycle Event Batch job (SET or EXECUTE) |
| Trigger onView Rules for HRIS Elements | Defaults, field properties, and transient calculations; onView only |
| Save Changes to Foundation Objects | Rules on FO saves, for example defaulting standard weekly hours on a location |
Standard Versus Model Base Objects
Unlike MDF objects, EC objects have a standard and a model base object, for example Job Information and Job Information Model. The base object determines what the rule can do and which events are allowed when it is assigned in the data model.
To set field properties you must use a Model base object. Model base objects support these properties:
| Property | Use |
|---|---|
| Required | Set a field required (true) or not (false) |
| Visibility | Set None, Edit, or View |
| Value | Combine a property change with a default or conditional value |
| Previous Value | Compare the old value with the new one, for example FTE.Value is not equal to FTE.Previous Value |
Also note: you cannot use onView events for changes on the Add New Employee screen. When assigning a rule in BCUI, select the same base object the rule was created with. If the rule uses Job Information Model, choose Job Information Model in the Trigger Rules row.
The Order of onSave Rules
The system processes onSave rules in the order defined in Manage Business Configuration, with one exception: event reason derivation and workflow derivation rules run after all other rules.
- Personal Information (no ERD): National ID rules, then workflow derivation rules.
- Job Information: Job Information rules, then event reason derivation, then workflow derivation.
- Manager Self-Service saving Job and Compensation Information together: Job Information rules, Compensation Information rules, ERD for Job Information, workflow derivation for Job Information, ERD for Compensation Information, and workflow derivation for Compensation Information.
Because of this order, the workflow rule can test the event reason the ERD rule just set (Section 9.5).
Assigning EC Rules in BCUI
In Manage Business Configuration, open the element (Take Action > Make Correction):
- Element-level events: in the element's Trigger Rules section, choose the base object, the event type, the rule, and Enabled. Use the up and down arrows to order rules.
- onChange: open the field's Details and add the rule in that field's Trigger Rules.
Save, and accept any data model adjustments BCUI proposes.
A rule must calculate an employee's current age each time the profile is viewed, without storing the value. Which event fits?
A rule must make a Job Information field mandatory under certain conditions. Which base object must it use?
Job Information has three onSave rules ordered in BCUI: a workflow derivation rule, a validation rule, and an event reason derivation rule. In which order do they run?