What are the variables and functions used in autocomplete rules?
Hello, my name is Steve. In this video, I’ll describe variables and functions used in autocomplete rules.
Autocomplete rules use variables to hold criteria values and required references to be used in the logic of the rule. These values are from the fields inside the current or related business object.
Variables are needed so that you can:
-
Access and store the values of fields on a related object.
-
Transform the value of a field on the current, or related, object so that it's in a form you can use in the rule's logic.
-
Get information about the UI state, such as the role of the logged in user, or if a given field has been modified. You use a function to get these values.
You have access to all fields inside the current and related objects. For example, when working with the Worker Assignment business object, you have access to:
-
Fields on the assignment.
-
All attributes of lookup fields, such as job, grade, business unit, and legal employer.
-
Related parent business objects, such as Work Relationship.
-
Related child business objects, such as Work Measure.
There are several different variable types you can add. Some examples include:
-
String, which you can use to define a specific regular expression pattern to match a user-input text field to, such as phone number, address lines, name, and so on. Another purpose would be to apply a transformation function on a field that returns a value of type string.
-
Another variable type is Integer, which you can use to define a counter to control a looping logic. Another use would be to define a period of time represented by a number of days. Later on in the rule you could use this variable to add to, or subtract from, a given date.
-
Another variable type is Long Integer, which can be used to store IDs of any business entity such as Job, Position, Salary Basis, and so on. When setting up this variable, you may need to use a transformation function.
-
Decimal is another variable type which is used to store IDs of business entities. such as job, collective agreement, or salary basis, in various descriptive flexfield (DFF) segments. When setting up customer specific associations between various entities, you can use Value Set queries on other objects. Currently, the transformation functions that return a decimal type value aren't available unless you have a custom object function that returns a decimal type value.
-
Another variable type is Date, which stores a date derived from a calculation involving adding or subtracting a specific number of days from a specific date. Or you can apply a transformation function to return a date type value.
-
Boolean is another variable type used to control looping structures, or when you apply a transformation on a field that returns a Boolean value.
-
Row and Row collection are special variable types which are discussed in a separate topic.
To create an autocomplete rule, you first have to create the variables needed to hold the values for your rule.
To change the initial default operand type to a function, click the xyz icon. The name of the initial default function is displayed as a hyperlink. Click the link to see what other functions are available for the variable type.
There are three function types:
-
Standard functions are those used for common technical transformations. For example, for a string variable, the standard function 'Lowercase of' returns a lower case string that is provided as a parameter.
-
Global functions are provided by the HCM suite of applications. These functions provide information about UI context. For example, for a string variable, the global function 'Substring' returns a part of a string passed to the function as a parameter.
-
Object functions are custom functions created using the Configure Business Objects task. For example, You use an object function when you can’t achieve a specified outcome using the existing capabilities of autocomplete rules. To create an object function, you must be able to code in groovy. Because of their complexity, object functions must be approved by Oracle.
When defining your autocomplete rule, you can use the global function, Get string values from HCM Params. This function returns UI context values from a defined list of process flows. For example, the functions shown here pass the following HCM Params:
-
EMP_Groovy_ActionTypeCode: This returns the related action type code of the action being used in the rule, such as the string 'EMPL_ADD_EMP. EMPL_ADD_EMP' is the code for the Hire an Employee action. You can use this value to ensure that the autocomplete rule operates only during a specific action, such as when hiring an employee.
-
EMP_Groovy_LegislationCode: This returns the legislation code of the legal employer on the assignment, such as 'IN' for India legislation.
-
EMP_Groovy_LegalEntityId: This returns the legal entity ID of the legal employer on the assignment, such as '202' for the Vision Corporation.
-
• EMP_Groovy_PeriodType: Returns the period type from the worker’s work relationship. For example, 'E' for employee.
Here are some of the action type codes for the 'EMP_Groovy_ActionTypeCode' HCM Params value.
Action Type Name | Action Type Code |
---|---|
EMPL_ADD_ASG |
Add Assignment |
EMPL_CHG_LOCATION |
Change Location |
EMPL_GLB_TRANSFER |
Global Transfer |
EMPL_PROMOTION |
Promote |
Use the HCM Param only for objects where you cannot access the When and Why object directly or indirectly tot get the action type code.
For a complete list of action type codes, see the autocomplete rules documentation, which is available on Oracle Help Center.
The Get date values from HCM Params global function can be used with the 'ChangeDate' parameter. The 'ChangeDate' parameter returns the effective date for changes related to the Person object. Some examples of changes in effective dates include:
-
Person name effective date.
-
Marital status effective date.
-
Address change start date.
-
Visas and permits start date.
You can use the Get Boolean value from HCM Params for employment actions that return true for data either loaded through the HCM Data or Spreadsheet loaders or data entered in a responsive UI.
This concludes the description of variables and functions used in autocomplete rules.
Thanks for watching.