SAP Knowledge Base Article - Public

2277956 - How to create a Business Rule

Symptom

Basic steps to create a business rule

"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 - Employee Central

Reproducing the Issue

What is Business Rule?

Business rules are a way to add application logic to determine the outcome of a change made to particular data in the system. Rules follow the logic 'If this data is changed in a certain way, then the system reacts in this way.‘

  • Go to Configure Business Rules
  • Create new rule

Example for :Employee Central Core

  • Trigger Rules to Generate Assignment ID External
    You can use this scenario to create rules that generate the value for Assignment ID External based on MDF Sequence objects. Create a single rule only based on this scenario. For more information, refer to the Assignment ID topic in the Implementing Employee Central Core guide on the SAP Help Portal.
  • Trigger Rules to Generate Employee ID for Hire/Rehire
    You can use this scenario to create rules that generate an Employee ID from the Metadata Framework (MDF) Sequence and assign it to the User ID field of the Employee Information object during the Hire/Rehire with new employment process. You must first register the rule for the Hire/Rehire Configuration object. If you have enabled the Onboarding feature, you must also register the rule for the Onboarding Configuration object.
  • Trigger Rules for Hire/Rehire
    You can use this scenario to create rules for the Hire/Rehire with new employment process using the Employee Information base object.
  • Trigger Rules for Event Reason Derivation
    You can use this scenario to create rules that derive the event reason for the Job Information Model and Compensation Information Model.
  • Trigger Rules to Generate Employee Central Alerts
    You can use this scenario to create rules that generate Employee Central alerts for HRIS Elements. In Manage Business Configuration, rules created using this scenario can be registered only for the saveAlert event type.
  • Trigger Rules to Enforce New Employment for Rehire
    You can use this scenario to create rules that validate business requirements for Rehire with new employment and display an error message if the conditions are not met.
  • Trigger Workflows
    You can use this scenario to create rules that trigger workflows to approve data changes. In Manage Business Configuration, rules created using this scenario can be registered only for the onSave event type.
  • Trigger Rules to Display Internal Job History
    You can use this scenario to create rules to display the Internal Job History on the People Profile page.
  • Trigger Rules to Validate HRIS Elements
    You can use this scenario to create rules that validate HRIS Elements and display messages.
  • Trigger Rules to Calculate Full-Time Equivalent
    You can use this scenario to create rules that calculate the full-time equivalent for a user using the base object Job Information Model.
  • Trigger onPostSave Events for Job Information
    You can use this scenario to create rules that trigger events after changes to Job Information are saved. In Manage Business Configuration, rules created using this scenario can be registered only for the onPostSave event type.
  • Trigger Cross-Entity Rules
    You can use this scenario to create rules that make changes to a target object based on the source object.
  • Trigger onChange Rules for HRIS Elements
    You can use this scenario to create rules that trigger changes to HRIS Elements. In Manage Business Configuration, rules created using this scenario can be registered only for the onChange event type.
  • Trigger onSave Rules for HRIS Elements
    You can use this scenario to create rules that save changes to HRIS Elements. In Manage Business Configuration, rules created using this scenario can be registered only for the onSave event type.

Types of events/triggers for business rules

  • Trigger onChange Rules for HRIS Elements
    You can use this scenario to create rules that trigger changes to HRIS Elements. In Manage Business Configuration, rules created using this scenario can be registered only for the onChange event type.
  • Trigger onSave Rules for HRIS Elements
    You can use this scenario to create rules that save changes to HRIS Elements. In Manage Business Configuration, rules created using this scenario can be registered only for the onSave event type.
  • onInit Rule

Resolution

  1. Go to Admin Center -> Configure Business Rules.
  2. Click on ‘Create New Rule’.
           1.jpg
  3. Select ‘Basic’ and enter the values to the below fields and click on ‘Continue’.

          -          Rule Name: A name for the rule

          -          Rule Id: A unique id for the rule

          -          Start Date: Date from which the rule should be active

          -          Rule Type:  Select the particular rule type. For Example, if the rule should be triggered in Job Information, select the ‘JOBINFO’ rule type.

          -          Base Object: Select the base object. For Example, if the rule needs to be configured in Job Information, select the ‘Job Information’ base object.

Or Basic

2.jpg

SCENARIO 1: onChange rule.

  1. Create a rule logic as per the requirement. The below rule sets the Local Job Tiltle field value to ‘Test Local Job Title’ if the Business Unit field is changed to  ‘Test Business Unit’

    3.jpg
  2. This business rule can now be assigned to the Business Unit field through Admin Center-> Manage Business Configuration.

    4.jpg
  3. Click on ‘Details’ beside the field ‘Business unit’ and map the rule to the filed with the event ‘On Change’->Click Done -> Save

    5.jpg
  4. This can now be tested in any of the employee’s Job Information.

    6.jpg
  5. Change the business unit to ‘Test Business Unit’ as per the rule logic and the Local job title fields gets populated.

7.jpg

 

SCENARIO 2: onSave rule.

  1. Create a rule as below. This rule derives value to "Shift" field based on the values entered for "Full/Part time", "Regular/Temp" and "Entity" field in Job information portlet.

    8.jpg
  2. Next, we can assign this “DeriveShiftForEmployee” rule to the Job Information object with an onSave rule. (Same as per Scenario 1).

9.jpg

10.jpg

NOTE: You can also add a Trigger Rule to a field through Details beside any field.

FAQ - Additional Information

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

A)Guide: Implementing Business Rules in SAP SuccessFactors

    Guide:Implementing Employee Central Core   Chapter:Rule Scenarios for Employee Central Core

See Also

  •  2293654 - Unabled to click Save when creating/editing a Business Rule
  • 2163077 - Base Objects in Business Rules Do Not Support All Rule Types in Employee Central
  • 2489543 - How to find which onChange rule(s) are being executed (from Browser & SPLUNK) *INTERNAL*
  • 2621890 - Troubleshooting Business Rules in Employee Central
  • 2385330 - How to make more than one National ID Card Type Required in Add New Hire - Employee Central
  • 2331851 - Employee Central Implementation - Business Rules FAQ

Keywords

Business Rule, Rule, onChange, OnSave, business, create, configure, how, manage, OnInit , KBA , LOD-SF-EC-JOB-RUL , Job Info Business Rules , LOD-SF-EC , Employee Central , How To

Product

SAP SuccessFactors Employee Central all versions ; SAP SuccessFactors Recruiting all versions