12.1 Common Errors
In the following, you can find some of the most common errors and how to prevent them.
1. When defining a rule like 'set jobInfo.department.name = ABC' (base object is jobInfo), it cannot be executed. Why?
There is a limitation for setting foundation objects. You can only set foundation object values if the base object is the foundation object. For example, if you redefine the rule like this, it will be triggered:
Base object =Department
THEN Condition: 'Set Name = ABC'
2. When you export rules from the source instance, and try to import to another target instance. you cannot open the rules in the target system. Why?
It is necessary to ensure that the base object, picklist and foundation object are the same as in the source instance. Please check the following:
○ Base object and the objects used in the rule exist in the target instance
○ EC picklist and MDF picklist used in the rules are the same in the target instance
○ Foundation object values are the same in the target instance
3. You use the rule to generate a sequence code for Position Code, but the Position Code is updated every time you update the position data. Why?
There are some tricks. The rule is triggered by the 'save' event, you can create one more rule for the initialization ('init') of the position. See the example below:
○ Init Rule: IF (always true) THEN set positionCode = 'Automatic'
○ Save Rule: IF (positionCode = 'Automatic') set positionCode = 'POS'+pos_seq
4. You can define negative values for the sequence number in the Rules Engine UI (for example. start number and step value), but the rule is not executed. Why?
The Rules Engine UI is based on the Metadata Framework (MDF) which has the limitation to validate negative numbers. So please do not use negative number in Sequence.
5. You can define different message types (like warning, error), but you cannot see any difference on the UI when the messages are displayed. Why?
EC doesn't support other message types than error messages. So, regardless of what message type you select, all messages are treated as error messages at the moment.
6. You used EC picklist and MDF picklist in rules, and get an error during execution. Why?
If the EC picklist does not have the same value of MDF picklist, there is an error during rule execution. Please ensure MDF picklists have the same value as EC picklists.
7. You have 3 objects: A, B, C. Their association is: A is grandparent, B is parent, and C is child. A is the base object. When you try to set a value (for example, 'set A.B.C.field = 123'), the system gives an error.
If B does not exist, you cannot create C.
8. You have an HRIS element field that is defined in the Succession Data Model which is NOT visible, and then it is defined in Corporate Data Model as visible. This field is visible on the EC page, but not visible in the Rules Engine. Why?
This is an example for a propagated field with different visibility. The Rules Engine only supports the
Succession Data Model, and the Corporate Data Model is not taken into consideration. That is why this field is not visible (as defined in the Succession Data Model).
Configuring Business Rules in SuccessFactors
Troubleshooting © 2014 SAP SE or an SAP affiliate company. All rights reserved. 127
12.2 Tips for Troubleshooting
As there is currently no test run tool for rules, here are some tips for troubleshooting.
● If a rule fails, or is not triggered, remove one statement and check if it works. If not, remove one more and so on to find out which ones work and which ones not.
● Then for the ones that do not work, check this guide again if you find any hint. If not, redefine the statement.
12.3 How to improve performance
You can improve the system performance during rule execution by following some guidelines.
Placing conditions at the top of a rule
If possible, place the following conditions at the top of a rule:
● Normal field from base object
Normal fields means primitive type of field (such as string, Boolean, number, and so on), but not foundation objects or MDF objects. When you have a normal field in a long list of AND/OR conditions, then please move this to the top as it can be executed fast, and the Rules Engine checks this first. If it is false, then the rest of AND conditions don't need to be executed. If it is true, then the rest of OR conditions don't need to be executed.
See the example rule below, where FTE = 1.
● EC picklist from base object
When you use an EC picklist in a long list of nested AND/OR conditions, move this condition to the top of the rule. As an EC picklist can be executed fast by the rule, it can be checked first. If it is false, then the rest of AND conditions don't need to be executed. If it is true, then the rest of OR conditions don't need to be executed.
See the example rule below, where Employee Class is equal to Expatriate.
● Comparing two MDF object fields
When you compare two MDF object fields of the same base object (for example, Alert.End-Date is equal to Alert.Start-Date), move this condition to the top. It can be checked fast because the MDF object is not loaded, but instead, the system compares the internal code.
● Right expression for MDF object contains concrete value
When the left expression is an MDF object, it is faster to select a concrete value for the right expression (for example, ABC, 01/01/2012, and so on). If you select another field for the right expression, the system has to retrieve the concrete value itself, which takes more time.
See the example rule below, where Position ID is equal to po04, which can be executed fast.
If you select Position ID is equal to Position Name, this takes more time.
128 © 2014 SAP SE or an SAP affiliate company. All rights reserved.
Configuring Business Rules in SuccessFactors Troubleshooting
Placing conditions at the bottom of a rule
If possible, place the following conditions at the bottom of a rule:
● ECobject.ECobject.fields
When EC objects are related to other EC objects, or when you create cross-portlet rules, for example, you navigate from one EC object to another EC object to get to a specific field (as in the example below:
EmploymentInformation.JobRelationsInformation.EventDate). In such a case, the EC to EC API needs more time to get data from another big table, therefore you should put such a condition to the bottom of the rule
● Collection Filters
Collection filters call the EC API to get the collection data first and then to filter the matched data according to the condition of the collection. This can be time-consuming if the collection size is big. You should put this to the bottom.
Here is an example of a rule that considers the above-mentioned guidelines:
Keeping number low
If possible, keep the number of the following examples low in a rule, as these slow down system performance:
● ECobject.ECobject.fields and collection filters
Because of the high amount of input for a rule engine batch call, we don't suggest to use the following in the rule definition:
○ ECobject.ECobject.field (for example, jobInfo.employmentInfo.custom_string1)
○ Collection filters
If you cannot avoid using these in a rule (for example, when you define cross-portlet rules), move them to the bottom of the rule.
● Define a function that has an SQL execution
If you call batch execution, try to avoid using the functions Lookup or Get Next Value in the rule, as they call an SQL script. According to the rule execution policy for batches, the batches are executed one by one, which means the function will be called many times.
Configuring Business Rules in SuccessFactors
Troubleshooting © 2014 SAP SE or an SAP affiliate company. All rights reserved. 129
● Load many rules at the same time
It decreases the performance of the underlying MDF when you call up several rules at once, so please don't load many rules in loop.
Related Information
Collection Filters [page 32]
Collection filters are used to get a unique value from a list of values. This is relevant when there is a parent-child relationship between data objects.
130 © 2014 SAP SE or an SAP affiliate company. All rights reserved.
Configuring Business Rules in SuccessFactors Troubleshooting
Important Disclaimers on Legal Aspects
This document is for informational purposes only. Its content is subject to change without notice, and SAP does not warrant that it is error-free. SAP MAKES NO WARRANTIES, EXPRESS OR IMPLIED, OR OF MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
Coding Samples
Any software coding and/or code lines / strings ("Code") included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended to better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, unless damages were caused by SAP intentionally or by SAP's gross negligence.
Accessibility
The information contained in the SAP documentation represents SAP's current view of accessibility criteria as of the date of publication; it is in no way intended to be a binding guideline on how to ensure accessibility of software products. SAP specifically disclaims any liability with respect to this document and no contractual obligations or commitments are formed either directly or indirectly by this document.
Gender-Neutral Language
As far as possible, SAP documentation is gender neutral. Depending on the context, the reader is addressed directly with "you", or a gender-neutral noun (such as "sales person" or "working days") is used. If when referring to members of both sexes, however, the third-person singular cannot be avoided or a gender-neutral noun does not exist, SAP reserves the right to use the masculine form of the noun and pronoun. This is to ensure that the documentation remains comprehensible.
Internet Hyperlinks
The SAP documentation may contain hyperlinks to the Internet. These hyperlinks are intended to serve as a hint about where to find related information. SAP does not warrant the availability and correctness of this related information or the ability of this information to serve a particular purpose. SAP shall not be liable for any damages caused by the use of related information unless damages have been caused by SAP's gross negligence or willful misconduct. Regarding link classification, see: http://
help.sap.com/disclaimer.
Configuring Business Rules in SuccessFactors
Important Disclaimers on Legal Aspects © 2014 SAP SE or an SAP affiliate company. All rights reserved. 131
www.sap.com/contactsap
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company. The information contained herein may be changed without prior notice.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors. National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names mentioned are the trademarks of their respective companies.
Please see http://www.sap.com/corporate-en/legal/copyright/
index.epx for additional trademark information and notices.