Professional Documents
Culture Documents
Disclaimer 1
Rule Template 4
Rules 6
Rule Sets 6
Contexts 7
Database Items 7
Input Variables 7
Formula: WFM_PERIOD_MAXIMUM_TIME_ENTRY_RULE 7
Fixed Parameters 11
Valid Functions 11
Return Variables 11
Formula: WFM_PERIOD_MINIMUM_TIME_ENTRY_RULE 12
Fixed Parameters 16
Valid Functions 16
Return Variables 16
Contexts 17
Database Items 17
Formula: WFM_THRESHOLD_TIME_CALCULATION_RULE 17
Fixed Parameters 22
Valid Functions 22
Return Variables 22
Appendix 24
Appendix 2: Contexts 26
A formula can return more than one value to the calling program. Different programs that call the
formula expect outputs to be returned differently. Based on the formula type, the number and data type
of values to be returned are predefined.
» Some programs expect the predefined names for output variables: the location of a variable in the
return statement does not matter.
» Some programs expect the return variable to be returned by location; in this case the name of output
variables does not matter.
» If predefined names are expected to be used and the formula does not use the expected names, the
process would error out at run time.
As shown in the following figure, formulas are associated with rule templates which are used to create rules. A group
of rules form a rule set. Rule sets are attached to a person’s core processing profile.
Rule Template
A rule template is an interface that exposes input values, parameters, and output variables from the associated fast
formula. The purpose of rule templates is to simplify rule configuration. Administrators determine exactly which
parameters the formula requires and the value that the formula returns. They document this information in the
template.
As shown in the following figure, you can create a time entry validation rule template with Defined_Limit (the
maximum number of work hours) as a parameter.
Note: Multiple rules can share the same template with different parameter values. For example, two rules created
using the preceding example rule template could have the defined limit values of 36 and 40 hours, respectively.
Rules
Time and Labor administrators use the two delivered rule template types to create two types of rules:
» Time entry rules validate time card entries and can generate a message with a defined severity.
Example: Workers cannot enter more than a specified number of hours per week.
» Time calculation rules use entered values to either update the entries or create additional entries depending on
the formula logic.
Example: US states do not all calculate overtime the same. Configure and assign different time calculation rules
based on the primary work location of US workers.
Rule Sets
Rule sets are a date-effective collection of rules or rule sets of the same type. Effective dates enable you to add,
delete, and edit rules and embedded rule sets within the rule set. Assign rule sets to groups of workers with similar
vacation and time processing requirements using a time processing profile.
Contexts
The following are contexts available to formulas of this type:
» HWM_FFS_ID
» HWM_RULE_ID
» HWM_PROJECT_ID
» HWM_RESOURCE_ID
» HWM_SUMMATION_LEVEL
» HWM_RECORD_POSITION
For detailed information see Appendix 2: Contexts.
Database Items
None.
Input Variables
For detailed information see Appendix 6: Input Attributes
Use any attribute name in the NAME column of the TM_ATRB_FLDS_VL where attribute_category is equal to
TIME_BUILDING_BLOCK.
Example:
Formula: WFM_PERIOD_MAXIMUM_TIME_ENTRY_RULE
The following fast formula associated with the Period Maximum Hours Template time entry rule template evaluates
the time entered on the time card to determine if the time reporter entered more hours than the specified threshold.
In the following example, the configuration sets a limit of 45 hours for the work week. If the time reporter enters more
than 45 hours, a warning or error message appears after the time reporter submits the time card. The time reporter
only sees a message if the time entered causes the fast formula to fail. If the time entered passes validation, no
message appears.
/* +======================================================================+
* delivered formula.
* HWM_FF_TER_PERIOD_GT_MAX_ERR - HWM_FF_TER_PERIOD_GT_MAX_WRN
* Change History
* --------------
***************************************************************************/
measure(number)
/* Following 2 lines are required right after inputs for all OTL and HWM formulas */
ffs_id = GET_CONTEXT(HWM_FFS_ID, 0)
process_empty_tc = 'Y'
')'
l_send_msg = 0
is_create_msg = 'N'
is_create_msg = 'Y'
is_create_msg = 'Y'
is_create_msg = 'Y'
is_create_msg = 'N'
is_create_msg = 'N'
l_tkn1 = 'DEF_LIMIT'
l_msg_cd = l_msg_cd
wk_hrs_total_tc = l_hrs_total_tc
wk_hrs_total_day =0
wk_hrs_total_day =0
wk_hrs_total_tc =0
RETURN OUT_MSG
Fixed Parameters
Use the GET_RVALUE_xxxx function to extract fixed parameters associated with a rule.
The parameter name must be less than 30 alphanumeric characters. Fixed parameters automatically get populated
on the rule template Parameters page.
Valid Functions
The following are the valid functions for this formula:
» GET_RVALUE_NUMBER
» GET_RVALUE_TEXT
» GET_RVALUE_DATE
Return Variables
Naming standards for return variables must:
Return variable names appear in the Output section of the rule template, where the administrator can assign
message severity.
OUTPUT_MSG_TEXT Text
Formula: WFM_PERIOD_MINIMUM_TIME_ENTRY_RULE
The following fast formula associated with the Period Minimum Hours Template time entry rule template evaluates
the time entered on the time card to determine if the time reporter entered less hours than the specified threshold.
In the following example, the configuration sets a minimum of 20 hours for the work week. If the time reporter enters
less than 20 hours, a warning or error message appears after the time reporter submits the time card.
/* +======================================================================+
+======================================================================+
* HWM_FF_TER_PERIOD_LS_MIN_ERR - HWM_FF_TER_PERIOD_LS_MIN_WRN
* Change History
* --------------
***************************************************************************/
INPUTS ARE
measure(number)
/* Following 2 lines are required right after inputs for all OTL and HWM formulas */
ffs_id = GET_CONTEXT(HWM_FFS_ID, 0)
process_empty_tc = 'Y'
')'
l_send_msg = 0
/*
l_default_last_date = '01-JAN-1900'(DATE)
*/
is_create_msg = 'N'
is_ck_time = 'N'
l_Ck_hours = 0
l_Ck_hours = l_hrs_total_tc
is_ck_time = 'Y'
l_Ck_hours = wk_hrs_total_day
is_ck_time = 'Y'
l_Ck_hours = measure
is_ck_time = 'Y'
if (l_Ck_hours = 0 ) then (
is_create_msg = 'Y'
is_create_msg = 'Y'
/* desfault l_msg_cd = Entered hours for period is less than {DEF_LIMIT} hours required for the
timecard period */
l_tkn1 = 'DEF_LIMIT'
l_msg_cd = l_msg_cd
wk_hrs_total_day = l_hrs_total_day
wk_hrs_total_tc = l_hrs_total_tc
wk_hrs_total_day =0
wk_hrs_total_tc =0
RETURN OUT_MSG
Fixed Parameters
Use the GET_RVALUE_xxxx function to extract the fixed parameters associated with a rule.
The parameter name must be less than 30 alphanumeric characters. Fixed parameters automatically get populated
on the rule template Parameters page.
Valid Functions
The following are the valid functions for this formula:
» GET_RVALUE_NUMBER
» GET_RVALUE_TEXT
» GET_RVALUE_DATE
Return Variables
Naming standards for return variables must:
» Be no more than 30 characters.
» Meet fast formula naming standards.
The return variable data type is TEXT.
Return variable names appear in the Output section of the rule template, where administrators can assign message
severity.
OUTPUT_MSG_TEXT Text
Contexts
The following contexts are available to formulas of this type:
» HWM_FFS_ID
» HWM_RULE_ID
» HWM_PROJECT_ID
» HWM_RESOURCE_ID
» HWM_SUMMATION_LEVEL
» HWM_RECORD_POSITION
Database Items
None.
Input Variables
Use any attribute name in the NAME column of TM_ATRB_FLDS_VL where attribute_category is equal to
TIME_BUILDING_BLOCK.
Example:
Formula: WFM_THRESHOLD_TIME_CALCULATION_RULE
The following fast formula associated with the Threshold time calculation rule template evaluates the total number of
hours that a time reporter enters on a time card. If the hours exceed a threshold, the results are a number above
and a number below the threshold. As part of the rule definition, the formula and template enable administrators to
associate time attributes with the values above and below the threshold value.
Time calculation results appear on the time card review page showing the number of hours below and over the
threshold as well as their defined time attributes, such as the Regular and Premium payroll time types, respectively.
The Regular and Premium time attributes definitions determine how time attributes are assigned to formula results.
Example: The time calculation rule is defined to pay hours over 40 at a premium. Depending on the time attribute
definitions, if the time reporter enters 45 hours, the time card review page could display the following:
» 40 hours below the threshold value of 40 with the Regular payroll time type and 5 hours above the threshold with
the Premium payroll time type
» 45 hours below the threshold with the Regular payroll time type and 5 hours above the threshold with the
Premium payroll time type.
+======================================================================+
* delivered formula.
* Detail: This threshold formula takes the total hours for the day
* Change History
* --------------
***************************************************************************/
INPUTS ARE
measure(number) ,
PayrollTimeType(text)
/* Following 2 lines are required right after inputs for all OTL and HWM formulas */
ffs_id = GET_CONTEXT(HWM_FFS_ID, 0)
paytypeIn = PayrollTimeType
create_yn = 'N'
create_yn = 'Y'
tot_ck = 0
hr_ot =0
hr_reg =0
if (sum_lvl = 'TIMECARD' AND tot_tc > max_hr and max_hr > 0 ) then (
tot_ck = tot_tc
) ELSE IF (sum_lvl = 'DAY' AND tot_day > max_hr and max_hr > 0) then (
tot_ck = tot_day
) ELSE IF ( sum_lvl = 'DETAIL' AND measure > max_hr and max_hr > 0 ) then (
tot_ck = measure
hr_ot = measure
hr_reg = 0
) else (
hr_reg = measure
) else (
hr_reg = measure
out_measure_under = hr_reg
out_measure_over = hr_ot
wk_hrs_total_day = tot_day
wk_hrs_total_tc = tot_tc
wk_hrs_total_day =0
wk_hrs_total_day =0
wk_hrs_total_tc = 0
RETURN out_measure_under,
out_measure_over
Fixed Parameters
Use the GET_RVALUE_xxxx function to extract fixed parameters associated with a rule.
The parameter name must be less than 30 alphanumeric characters. Fixed parameters automatically get populated
on the rule template Parameters page.
Valid Functions
The following are the valid functions for this formula:
» GET_RVALUE_NUMBER
» GET_RVALUE_TEXT
» GET_RVALUE_DATE
Return Variables
Naming standards for return variables must:
» Be no more than 30 characters.
» Meet fast formula naming standards.
The data type is the same as the associated time attribute on the rule template Output page.
Return variable names appear in the Output section of the rule template. Return values get passed, or assigned, to
the Time building block attribute through the rule template Output page.
HWM_RECORD_POSITION The record position value indicates the type of record being 11.1.8 and
processed. above
The following table describes the valid values.
END_PERIOD End period record; the last record for the time
card
The time card records are passed to the fast formula in the following
sequence:
1. Detail records for day one of the time card, sorted in a
predefined order
2. End of day record for day one
3. Steps 1 and 2 repeat for all days of the time card period
4. End period record for the time card, it is the final record
passed from the time card
HWM_RULE_ID The rule ID is the key for rule currently being processed. This key is 11.1.8 and
used to get parameter values set in the rule and, in combination with above
HWM_FFS_ID, used to store and retrieve work area values.
HWM_PROJECT_ID The project ID associated with the time card record currently being 11.1.8 and
processed. above
HWM_RESOURCE_ID The resource ID or person ID associated with the time card record 11.1.8 and
currently being processed. above
P_PARM_NAME , Parameters:
P_PARM_NAME ,
P_PARM_SEQ ,
P_PARM_VALUE )
SET_WRK_TEXT( Same as SET_WRK_NUM, except it is used to store string values. 11.1.8 and
P_FFS_ID , P_PARM_VALUE: String value. above
P_PARM_NAME ,
P_PARM_SEQ ,
P_PARM_VALUE )
GET_WRK_TEXT( Get the stored value for the item called P_PARM_NAME. If there is no item called 11.1.8 and
P_FFS_ID , P_PARM_NAME, then return the default-value. The data type of the default value is above
the expected data type for the item.
P_PARM_NAME ,
Parameters:
P_PARM_SEQ ,
P_FFS_ID: Use the HWM_FFS_ID context (see Appendix 2: Contexts).
DEFVAL ) RETURN
VARCHAR2 P_PARM_NAME: Any alphanumeric name.
P_PARM_SEQ: Set to 0 unless storing multiple values with the same PARM_NAME.
DEFVAL: Default value
RETURN VARCHAR2: Return a varchar value
GET_WRK_NUM( Same as GET_WRK_TEXT, except it is used to return numeric values. 11.1.8 and
P_FFS_ID , above
P_PARM_NAME ,
P_PARM_SEQ ,
DEFVAL ) RETURN
NUMBER
GET_WRK_DATE( Same as GET_WRK_TEXT, except it is used to return date values. 11.1.8 and
P_FFS_ID , above
P_PARM_NAME ,
P_PARM_SEQ ,
DEFVAL ) RETURN
DATE
P_COLUMN_NAME , Parameters:
Example:
message_name:
'HWM_FF_TER_PERIOD_GT_MAX_WRN'
message_text :
The hours entered for the period exceed the maximum limit
{DEF_LIMIT} defined for the time card.
from fnd_messages
P_MESSAGE_NAME: HWM_FF_TER_PERIOD_GT_MAX_WRN
TOKEN1_NAME: 'DEF_LIMIT'
TOKEN1_VALUE: 8
HWM_EMP_SCHD_AVAILABILITY_CODE HWM_EMP_SCHD_AVAILABILITY_CODE TN Y Y
HWM_EMP_SCHD_END_DATE_TIME HWM_EMP_SCHD_END_DATE_TIME DN Y Y
HWM_EMP_SCHD_MEASURE HWM_EMP_SCHD_MEASURE NN Y Y
HWM_EMP_SCHD_OBJECT_CATEGORY HWM_EMP_SCHD_OBJECT_CATEGORY TN Y Y
HWM_EMP_SCHD_OBJECT_ID HWM_EMP_SCHD_OBJECT_ID NN Y Y
HWM_EMP_SCHD_OBJECT_NAME HWM_EMP_SCHD_OBJECT_NAME TN Y Y
HWM_EMP_SCHD_OBJECT_TYPE HWM_EMP_SCHD_OBJECT_TYPE TN Y Y
HWM_EMP_SCHD_PERSON_ID HWM_EMP_SCHD_PERSON_ID NN Y Y
HWM_EMP_SCHD_START_DATE_TIME HWM_EMP_SCHD_START_DATE_TIME DN Y Y
HWM_EMP_SCHD_SUBRESOURCE_ID HWM_EMP_SCHD_SUBRESOURCE_ID NN Y Y
HWM_PUB_SCHD_ACTIVITY_TYPE HWM_PUB_SCHD_ACTIVITY_TYPE TN Y Y
HWM_PUB_SCHD_DATE_FROM HWM_PUB_SCHD_DATE_FROM DN Y Y
HWM_PUB_SCHD_DATE_TO HWM_PUB_SCHD_DATE_TO DN Y Y
HWM_PUB_SCHD_MEASURE HWM_PUB_SCHD_MEASURE NN Y Y
HWM_PUB_SCHD_ORDER_ENTERED HWM_PUB_SCHD_ORDER_ENTERED NN Y Y
HWM_PUB_SCHD_START_TIME HWM_PUB_SCHD_START_TIME DN Y Y
HWM_PUB_SCHD_STOP_TIME HWM_PUB_SCHD_STOP_TIME DN Y Y
HWM_PUB_SCHD_SUBRESOURCE_ID HWM_PUB_SCHD_SUBRESOURCE_ID NN Y Y
HWM_PUB_SCHD_TCSMR_CONFIG_SET_ID HWM_PUB_SCHD_TCSMR_CONFIG_SET_ID NN Y Y
HWM_PUB_SCHD_TCSMR_SET_ID HWM_PUB_SCHD_TCSMR_SET_ID NN Y Y
HWM_PUB_SCHD_TM_REC_ID HWM_PUB_SCHD_TM_REC_ID NN N Y
HWM_PUB_SCHD_TM_REC_TYPE HWM_PUB_SCHD_TM_REC_TYPE TN Y Y
HWM_PUB_SCHD_TM_REC_VERSION HWM_PUB_SCHD_TM_REC_VERSION NN N Y
HWM_PUB_SCHD_UNIT_OF_MEASURE HWM_PUB_SCHD_UNIT_OF_MEASURE TN Y Y
e.g., PYR_Peddi Over Time Loc3_City Peddi Over Time Loc3_City Not applicable
C ON N E C T W I TH U S
blogs.oracle.com/oracle Copyright © 2014, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only, and the
contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other
facebook.com/oracle warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or
fitness for a particular purpose. We specifically disclaim any liability with respect to this document, and no contractual obligations are
formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any
twitter.com/oracle means, electronic or mechanical, for any purpose, without our prior written permission.
oracle.com Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and
are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are
trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. 0315