Professional Documents
Culture Documents
OTL Fast Formula
OTL Fast Formula
DISCLAIMER
This document in any form, software or printed matter, contains proprietary information that is the exclusive property of
Oracle. Your access to and use of this confidential material is subject to the terms and conditions of your Oracle software
license and service agreement, which has been executed and with which you agree to comply. This document and
information contained herein may not be disclosed, copied, reproduced or distributed to anyone outside Oracle without
prior written consent of Oracle. This document is not part of your license agreement nor can it be incorporated into any
contractual agreement with Oracle or its subsidiaries or affiliates.
This document is for informational purposes only and is intended solely to assist you in planning for the implementation
and upgrade of the product features described. It is not a commitment to deliver any material, code, or functionality, and
should not be relied upon in making purchasing decisions. The development, release, and timing of any features or
functionality described in this document remains at the sole discretion of Oracle.
Due to the nature of the product architecture, it may not be possible to safely include all features described in this document
without risking significant destabilization of the code.
Main Difference
With normal fast formulas, the rule-processing engine calls the formula for each day and detail time entry on the time card.
Each call passes information about only a single entry to the formula. With AP fast formulas, the rule-processing engine calls
the formula only once. The single call passes all relevant time attributes for the entire time card. This behavior significantly
reduces the number of calls to the middle tier and improves processing performance. Also, AP formulas are flexible and
enable you to loop through time card data in various ways, with more control over the process.
Output
AP formula output returns values in an array format for the entire time card. Normal formula output returns values one
record at time. The results are the same for the AP and normal formulas.
Samples
These delivered formulas and rule templates, composed of these formulas, are perfect examples of AP and normal formulas
and templates. They both generate the same result:
Formula: WFM_THRESHOLD_TIME_CALCULATION_RULE_AP
/* +======================================================================+
| Copyright (c) 2009 Oracle Corporation |
| Redwood Shores, California, USA |
| All rights reserved. |
+======================================================================+
*
* Formula Name : WFM_THRESHOLD_TIME_CALCULATION_RULE_AP
*
* Formula Type: Time Calculation rule
*
*
* Description: Divides reported daily or period time into calculated
* time attributes for hours above and below defined
* threshold hours. Reported time and specific time attribute
* results are inputs to the delivered formula. This formula
* uses an array to process time card data.
*
* Detail: Compares the total time category hours for the day or
* period to the threshold value. Hours above the threshold
* are converted to a single pay time type. Hours under the
* threshold either remain the same pay time type value or
* are converted into a new pay time type attribute.
*
*
*
* Change History
* --------------
*
* Who Ver Date Description Default input values are set
as Array Data type
*----------------- ------ ------------ -----------------------------------------
EMPTY_TEXT_NUMBER,
* David Cohanoff 206.12 2013-FEB-10 Created.
EMPTY_DATE_NUMBER, and
* EMPTY_NUMBER_NUMBER
***************************************************************************/
DEFAULT FOR HWM_CTXARY_RECORD_POSITIONS is EMPTY_TEXT_NUMBER
DEFAULT FOR HWM_CTXARY_HWM_MEASURE_DAY is EMPTY_NUMBER_NUMBER
DEFAULT FOR measure is EMPTY_NUMBER_NUMBER
/* Following 2 lines are required right after inputs for all OTL and HWM formulas */
ffs_id = GET_CONTEXT(HWM_FFS_ID, 0)
rule_id = GET_CONTEXT(HWM_RULE_ID, 0)
ffName = 'WFM_THRESHOLD_TIME_CALCULATION_RULE_AP' || ' - v115.1106 '
rLog = add_rlog (ffs_id, rule_id, '>>> Enter - ' || ffName )
NullDate = '01-JAN-1900'(DATE)
NullText = '--NULL--'
measure_period = GET_CONTEXT(HWM_MEASURE_PERIOD, 0)
hCreateYn = 'N'
if (upper(hExecType) = 'CREATE' ) then (
hCreateYn = 'Y'
)
wMaAry = HWM_CTXARY_RECORD_POSITIONS.count
rLog = add_rlog (ffs_id, rule_id, 'Start bulk process - wMaAry=' || TO_CHAR( wMaAry ) )
out_measure_ary_under = EMPTY_NUMBER_NUMBER
out_measure_ary_over = EMPTY_NUMBER_NUMBER
nidx = nidx + 1
Loop through time card and
if (MEASURE.exists(nidx) ) then ( process records by selecting
aiMeasure = MEASURE[nidx] individual input attributes
defined in the input section,
) such as Measure
aiMeasureDay = 0
if (HWM_CTXARY_HWM_MEASURE_DAY.exists(nidx) ) then (
aiMeasureDay = HWM_CTXARY_HWM_MEASURE_DAY[nidx]
)
aiRecPosition = HWM_CTXARY_RECORD_POSITIONS[nidx]
ocMeasure_under = -9999
ocMeasure_over = -9999
CALL_FORMULA ('WFM_THRESHOLD_TIME_CALCULATION_RULE_SUB'
, ffs_id > 'ffs_id'
, rule_id > 'rule_id'
, hSumLvl > 'hSumLvl'
, hCreateYn > 'hCreateYn'
)
)
/* +======================================================================+
| Copyright (c) 2009 Oracle Corporation |
| Redwood Shores, California, USA |
| All rights reserved. |
+======================================================================+
*
* Formula Name : WFM_THRESHOLD_TIME_CALCULATION_RULE
*
* Formula Type: WFM TCR Threshold Rule - FF Seed Data
*
* Description: Divides reported daily or period time into calculated
* time attributes for hours above and below defined threshold
* hours. Reported time and specific time attribute results
* are inputs to the delivered formula.
*
* Detail: Compares the total time category hours for the day or
* period to the threshold value. Hours above the threshold
* are converted to a single pay time type. Hours under
* the threshold either remain the same pay time type value
* or are converted into a new pay time type attribute.
*
*
* Change History
* --------------
*
* Who Ver Date Description
*----------------- ------ ------------ -----------------------------------------
* David Cohanoff 206.12 2013-FEB-10 Created.
*
*
**************************************************************************/
Default input and input
default for measure(number) is 0 variable value data type is
single Number, Date, or Text
INPUTS ARE
measure(number)
/* Following 2 lines are required right after inputs for all OTL and HWM formulas */
create_yn = 'N'
if (upper(exec_type) = 'CREATE' ) then (
create_yn = 'Y'
)
tot_ck = 0
hr_ot =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
)
) else (
if ( measure > 0 ) then (
hr_reg = measure
)
RETURN out_measure_under,
out_measure_over
Copyright © 2021, 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 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 means, electronic or mechanical, for any purpose, without
our prior written permission.
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. 0120