0% found this document useful (0 votes)
0 views

Fast Formulas

The document provides a comprehensive overview of FAST Formulas, detailing their types, creation methods, and various usages in business processes such as payroll, benefits, and compensation. It explains how to access and utilize database items within formulas, as well as the contexts and inputs required for effective formula execution. Additionally, it includes sample code and debugging techniques for better understanding and application of FAST Formulas.

Uploaded by

oracleuser2520
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Fast Formulas

The document provides a comprehensive overview of FAST Formulas, detailing their types, creation methods, and various usages in business processes such as payroll, benefits, and compensation. It explains how to access and utilize database items within formulas, as well as the contexts and inputs required for effective formula execution. Additionally, it includes sample code and debugging techniques for better understanding and application of FAST Formulas.

Uploaded by

oracleuser2520
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

FAST FORMULAS

OVERVIEW
WHAT IS FAST FORMULAE?
BUSINESS PROCESSES – USING FAST
FORMULAE
FAST FORMULAE USAGES
FAST FORMULAE USAGES (PAYROLL)
FAST FORMULAE USAGES (BENEFITS)
FAST FORMULAE USAGES (COMPESNATION)
FAST FORMULAE USAGES (ABSENCE)
FAST FORMULAE USAGES (TIME & LABOR)
FAST FORMULAE USAGES (VALIDATIONS &
EXTRACTS)
FAST FORMULAE TYPES
FAST FORMULAE TYPES (CONTD…)
FAST FORMULAE TYPES (CONTD…)
FAST FORMULAE CREATION METHODS
WHERE CAN WE CREATE/ACCESS FAST
FORMULAS

1. Set up and Maintenance -> Search Task


2. Implementation Projects,
a. Payroll users
• Under the define fast formulas task list
b. Non-Payroll Users
• Under the define elements, Balances and Fast Formulas task
list
3. Work Areas,
WHERE CAN WE CREATE/ACCESS FAST
FORMULAS

1. Set up and Maintenance -> Search Task


2. Implementation Projects,
a. Payroll users
• Under the define fast formulas task list
b. Non-Payroll Users
• Under the define elements, Balances and Fast Formulas task
list
3. Work Areas,
FAST FORMULA LEVELS
FAST FORMULA EDITOR TYPES
FAST FORMULA – TEXT EDITOR
FAST FORMULA – EXPRESSION BUILDER
FAST FORMULA – EXPRESSION BUILDER
FAST FORMULA – EXPRESSION BUILDER
FAST FORMULA – SECURITY
FAST FORMULA – SAMPLE
FAST FORMULA – SAMPLE
FAST FORMULA – STRUCTURE
FAST FORMULA – DATA TYPES
Text (T)
Number (N)
Date (D)

Text values and number indexes array Arrays (TN)


Number values and number indexes array Arrays (NN)
Date values and number indexes array (DN)

Text values and number indexes array Arrays (TT)


Number values and number indexes array Arrays (NT)
Date values and number indexes array (DT)
FAST FORMULA – INPUTS & OUTPUTS
TYPES OF INPUTS

Found in: Payroll Admin > Batch Loader > Globals type
DATABASE ITEMS DEFINITION
DATABASE ITEMS TYPES
DYNAMIC DATABASE ITEMS
Dynamic Database items are created automatically when you define:

Elements
The element name is the DBI name prefix.
Balances
The balance name followed by balance dimension name is the DBI name.

Formula global values


The global value name is the DBI name.

Input values
The element and input value names are the DBI name prefix.
Grade Rates
Pay Scale Rates
Absence Types
DATABASE ITEMS
Using Database Items
• To use a Database item in a formula, simply refer to it by name.
• To find the Database items you need, click Show Items on the Formula window and run
a query, or use the Search for Database Item Name feature available with the fast formula
Assistant
• Do not refer to Database items until you need them to avoid unnecessary database calls
• Formulas cannot be used to update Database items
• Where you have a choice use an Inputs statement instead of Database items — this is
more efficient.
DATABASE ITEMS
How to Find the Formula Type where you can use the particular DBI and the CONTEXT
which is required by the particular DBI?
Step 1:
To find the route id for the DBI which is required to Find Formula type where we can use this DBI,Input is DBI NAME:
select route_id from ff_user_entities_b where user_entity_id in
(select user_entity_id from ff_database_items_b where base_user_name
='HWM_PER_ASG_REL_DATE_START');

Step 2:
Query to find the Formula Type where we can use the Particular DBI with the DBI Route ID, Input is route_id:
select * from FF_FORMULA_TYPES_B where formula_type_id in
(select formula_type_id from FF_FTYPE_CONTEXT_USAGES where context_id in
(select CONTEXT_ID from FF_CONTEXTS_B where CONTEXT_ID in
(select CONTEXT_ID from
ff_route_context_usages where route_id in (300000000198407))
)
);

Step 3:
To find out the Context for the particular DBI , Input is DBI NAME:
select * from FF_CONTEXTS_TL where LANGUAGE='US' AND context_id in
(select CONTEXT_ID from FF_CONTEXTS_B where CONTEXT_ID in
(select CONTEXT_ID from ff_route_context_usages where route_id in
(select route_id from ff_user_entities_b where user_entity_id in
(select user_entity_id from ff_database_items_b where base_user_name
='HWM_PER_ASG_REL_DATE_START')
)
)
LIST OF DATABASE ITEMS

Please refer to the following documentation which contains list of DBIs per each
release:
Note 1565118.1 Database Items for Extracts and Formulas in Oracle Fusion HCM

New DBIs are delivered with each Monthly Release Update (MRU). Please run the
sql from the below note to get the most current list of DBIs from your system:
Note 1919091.1 FUSION HCM: How to Get the Most Current List of DBIs from
Your Database
FAST FORMULA – COMMENTS
FAST FORMULA – ALIAS STATEMENTS
FAST FORMULA – DEFAULTS
FAST FORMULA – DEFAULTS
FAST FORMULA – DEFAULTS
FAST FORMULA – CALCULATION SECTION
CALCULATION SECTION – TYPES OF
STATEMENTS
FAST FORMULA – RETURNS SECTION
FAST FORMULA – LOCAL VARIABLES
FAST FORMULA – LOCAL VARIABLES – NAMING
CONVENTIONS
FAST FORMULA – CONDITIONS
FAST FORMULA – CONDITIONS
OPERATORS, FUNCTIONS & ASSIGNMENTS
FAST FORMULAE - COMPILATION
FAST FORMULAE - SCENARIOS
test1 = MONTHS_BETWEEN(to_date('01/01/2010','DD/MM/YYYY'),to_date('01/01/2011','DD/MM/YYYY'))

/* Formula to return experience*/


DEFAULT FOR PER_REL_DATE_START is '4712/01/01 00:00:00' (date)

l_Hire_Date = '2018/01/01 00:00:00' (date)

l = months_between (l_Hire_Date,PER_REL_DATE_START)

RULE_VALUE = to_char(l)

return RULE_VALUE
SAMPLE CODE
/*
Version Date Created/Modified By Comments
---------------------------------------------------
1.0 1/2/18 Lakshmi Draft version
*/

ALIAS PER_ASG_MARITAL_STATUS AS MAR_STATUS

DEFAULT FOR PER_ASG_MARITAL_STATUS IS 'ZZZZ'


DEFAULT FOR PER_ASG_SEX IS ' '
DEFAULT FOR PER_ASG_LAST_NAME IS ' '

l_debug = ESS_LOG_WRITE('Start Debugging...')

lvar = 'Testing Only'

if ( MAR_STATUS = 'M' AND PER_ASG_SEX = 'F')THEN


(
if PER_ASG_LAST_NAME WAS DEFAULTED THEN
lvar = UPPER(PER_ASG_LAST_NAME) + 'M' + 'Female'
ELSE
lvar = 'Name not defaulted' + 'M' + 'Female'
RULE_VALUE = lvar
l_debug = ESS_LOG_WRITE('Debug1 - Inside IF Mar status M and gender F. l_var value is' + lvar)
)
else if MAR_STATUS = 'S' THEN
RULE_VALUE = '30'
else
RULE_VALUE = '40'

l_debug = ESS_LOG_WRITE('Debug2 - End of program RULE_VALUE is' + RULE_VALUE)

l_debug = ESS_LOG_WRITE('End Debugging')


RETURN RULE_VALUE
FAST FORMULA – CONTEXT
Most inputs need to be passed to the formula from the calling window or process,
or explicitly retrieved from the database. However each formula type has some
information that is always available to it at run time. This is called the formula
contexts.
Using Formula Contexts
A formula executes within an application-specific execution context. Formula context variables specify the
formula execution context.

Examples of contexts are:


•EFFECTIVE_DATE for the effective date the formula is executing
•PAYROLL_ID for the running payroll
•PERSON_ID identifying the person for whom the formula is executing

Context values act as SQL bind values when database item values are fetched from the database. They can
also be passed into formula function calls.

Context Value Setting


The application code calling a formula usually sets all the context values. For some complex applications,
such as the payroll run, the code only sets the contexts necessary to meet general processing requirements.
A payroll run sets contexts for the legislative data group, date earned, the payroll being processed, the
payroll relationship, payroll actions, and the person being processed. Payroll formulas also use additional
contexts whose setting is country-specific. For example, the jurisdiction area and tax code context values are
localization specific and are set within formulas using a variety of mechanisms.
LIST OF CONTEXTS FOR EACH FORMULA TYPE

select t.base_formula_type_name
, ttl.formula_type_name
, ttl.description
, c.base_context_name
from ff_formula_types_b t
, ff_formula_types_tl ttl
, ff_ftype_context_usages u
, ff_contexts_b c
where t.formula_type_id = u.formula_type_id
and ttl.formula_type_id = t.formula_type_id
and ttl.language = userenv('LANG')
and ttl.formula_type_name like 'Oracle%Payroll%'
and c.context_id = u.context_id;
FAST FORMULA – INPUTS & OUTPUTS
Formulas can take input from the window, database, or a process such as a payroll
run and can return values or messages.

Values are passed at runtime and contents of inputs statement depends on formula
type.
LIST OF CONTEXTS FOR EACH FORMULA TYPE

select
t.base_formula_type_name,ttl.formula_type_name,ttl.descrip
tion, c.base_context_name
from
ff_formula_types_b t,
ff_formula_types_tl ttl,
ff_ftype_context_usages u,
ff_contexts_b c
where t.formula_type_id = u.formula_type_id
and ttl.formula_type_id = t.formula_type_id and
ttl.language = userenv('LANG')
and ttl.formula_type_name like 'Extract%Criteria%'
and c.context_id = u.context_id
CONTEXTS, DBI’S & FORMULA TYPE
To find the Formula Type where you can use the particular DBI

Step 1:
To find the route id for the DBI which is required to Find Formula type where we can use this DBI,Input is DBI NAME:
select route_id from ff_user_entities_b where user_entity_id in
(select user_entity_id from ff_database_items_b where base_user_name
='HWM_PER_ASG_REL_DATE_START');

Step 2:
Query to find the Formula Type where we can use the Particular DBI with the DBI Route ID, Input is route_id:
select * from FF_FORMULA_TYPES_B where formula_type_id in
(select formula_type_id from FF_FTYPE_CONTEXT_USAGES where context_id in
(select CONTEXT_ID from FF_CONTEXTS_B where CONTEXT_ID in
(select CONTEXT_ID from
ff_route_context_usages where route_id in (300000000198407))
)
);

Step 3:
To find out the Context for the particular DBI , Input is DBI NAME:
select * from FF_CONTEXTS_TL where LANGUAGE='US' AND context_id in
(select CONTEXT_ID from FF_CONTEXTS_B where CONTEXT_ID in
(select CONTEXT_ID from ff_route_context_usages where route_id in
(select route_id from ff_user_entities_b where user_entity_id in
(select user_entity_id from ff_database_items_b where base_user_name
='HWM_PER_ASG_REL_DATE_START')
)
)
);
ARRAYS
ARRAY – INDEX TYPES
ARRAY – RETURN METHODS
ARRAY – METHODS
LOOPS

Example of looping an array,


DEFAULT FOR PER_ORG_NAME is 'XX'
DEFAULT_DATA_VALUE for PER_EXT_ORG_CLASSIFICATION_CODE is 'NA'

INCLUDE = 'FALSE'
I=1

l_debug = ESS_LOG_WRITE('Start Debugging...')

l_debug = ESS_LOG_WRITE('Debug1 - Organization name is : '+PER_ORG_NAME)

WHILE PER_EXT_ORG_CLASSIFICATION_CODE.EXISTS(I) LOOP


(
l_debug = ESS_LOG_WRITE('Debug2 - Org Classification is: '+PER_EXT_ORG_CLASSIFICATION_CODE[I])
IF (PER_EXT_ORG_CLASSIFICATION_CODE[I] = 'DEPARTMENT')
THEN (
INCLUDE = 'TRUE'
EXIT
)

I=I+1
)
l_debug = ESS_LOG_WRITE('Debug2 - Retun value : '+INCLUDE)
RETURN INCLUDE
CHANGE CONTEXTS
DEFAULT FOR PER_ASG_PERSON_NUMBER is 'XX'
DEFAULT for PER_ASG_ASSIGNMENT_TYPE is 'NA'
DEFAULT for PER_ORG_ORGMGR_MANAGER is 'NA'

INCLUDE = 'FALSE'
I=1

l_debug = ESS_LOG_WRITE('Start Debugging...')

l_debug = ESS_LOG_WRITE('Debug1 - Person Number is : '+PER_ASG_PERSON_NUMBER)

CHANGE_CONTEXTS(PERSON_ID = to_number(PER_ORG_ORGMGR_MANAGER))
(
l = PER_ASG_PERSON_NUMBER
)

l_debug = ESS_LOG_WRITE('Debug11 - Manager person number is: '+l)

IF PER_ASG_ASSIGNMENT_TYPE = 'E' THEN


(
l_debug = ESS_LOG_WRITE('Debug2 - Assignment Type is: '+PER_ASG_ASSIGNMENT_TYPE)
INCLUDE = 'TRUE'
)

l_debug = ESS_LOG_WRITE('Debug2 - Retun value : '+INCLUDE)


RETURN INCLUDE

You might also like