Using Global Variables in Fast Formula -WSA
Using Global Variables in Fast Formula -WSA
In this session, we will explain how to talk to another Fast Formula that is executed in the same session.
In many processes, we define more than one Fast Formula and sometimes these Fast Formulas execute the same
routine again and again. This can be avoided if we could talk to each other or if we can pass a value between
Fast Formulas.
In the above example, the Annual FTE needs to be calculated in the Salary Fast Formula and the Bonus Fast
Formula. Instead of doing the calculation in every Fast Formula, we want to calculate the Annual FTE salary in
the Fast Formula that is executed first and pass the value to the Fast Formula that is executed later.
As per the setup, we assume, the Annual FTE Salary Fast Formula is executed first and the Bonus Fast Formula
is executed later. To find out which process is executed first, you can run the process for a person and the Fast
Formula ESS Logs can help you.
1
2
What is WSA:
“The working storage area is a mechanism for storing global values across
formulas. The values are accessed by name. The names are case-independent”.
WSA_SET
WSA_EXISTS
WSA_DELETE
WSA_GET
/*
Author : Ti(lak)shmi
Type : Total Compensation Item
NAME : TCS_FTE_SAL_TEST_FF
Remarks: This formula is for demonstrating the communication between Fast Formulas.
This formula calculates the Full time FTE salary and assigns it to a WSA Variable.
*/
VALUES = CMP_ASSIGNMENT_SALARY_ANNUAL_AMOUNT
IF (PER_ASG_FTE_VALUE WAS NOT DEFAULTED) THEN
(
VALUES = VALUES * PER_ASG_FTE_VALUE
)
) ELSE (
L_DATA = ESS_LOG_WRITE( 'Salary Amount is 0 to test WSA ' )
WSA_SET('TCS_WSA_TEST_FTE_SALARY', VALUES)
)
2
3
WSA_DELETE('TCS_WSA_TEST_FTE_SALARY' )
)
L_DATA = ESS_LOG_WRITE( 'END TCS_BONUS_TEST_FF' )
RETURN COMPENSATION_DATES ,VALUE
TCS Setups:
Item:
3
4
Category Setup
Statement Setup
BEGIN CS_FTE_SAL_TEST_FF
Salary Amount is 54963
END CS_FTE_SAL_TEST_FF
BEGIN TCS_BONUS_TEST_FF
WSA FOUND
WSA VALUE 54963
Bonus Amount 10992.6
END TCS_BONUS_TEST_FF
As per the log, Salary Fast Formula calculated the Salary and assigned the Salary value to a WSA Variable and
the Bonus Fast Formula was able to get the value from the WSA Variable.
4