Monday, August 6, 2018

Grade Steps Progressions (GSP) Fast Formula Samples - 2




In our previous blog, we explained the Eligibility Formula for GSP. In this blog, we will continue our discussion with the Salary progression rate calculation Rule (GSP Rate), Salary progression, Date determination and Rule (GSP Date).
 
Formula Type: Salary progression rate calculation Rule (GSP Rate).

These Formulas allow you to customize the rate for all the Grades and Steps in a Grade Ladder. The Formula is defined at a Grade Ladder level and therefore the FF is executed for every Grade/Step in the Ladder and the value from the Formula takes precedence to the defined rate at Grade/Step level.

Note that the Formulas are not returning the salary but the Grade Step Rate. The GSP process is using the defined Annual Factors and FTE (Full Time Equivalent) to calculate the Salary from the value returned by the Fast Formula.  Do not assume that the value returned from the Formula is used as it is.

The Formulas uses the same context as any other Compensation Formula. Please see our previous blog on Compensation Formula Types and Contexts.

Input Values:

Input Values
Types
CMP_IV_GRADE_LADDER_ID
Number
CMP_IV_GRADE_LADDER_NAME
Text
CMP_IV_GRADE_ID
Number
CMP_IV_GRADE_NAME
Text
CMP_IV_STEP_ID
Number
CMP_IV_STEP_NAME
Text

Grade Ladder Setup with Rate and Date Formula.



 

Formula use case For Calculating Rate:
As per our hypothetical use case, the Rate is calculated from a person’s current salary.

·       Get the Current Salary and Salary Frequencies from the Salary setup using DBI.
·       Get the Salary frequency from the Grade Ladder DBI, if the Ladder’s frequency is not the same as Salary setup (you do not need to get it from DBI as it is defined at ladder level, you can hard code the values), convert the salary to Grade Ladder frequency.
·       For each step, we add 2% of the original salary and the percentage increased with every setup. For example if the current step is 1 and Rate is calculated for Step 2, then we add 2% of salary, if Rate is calculated for Step 3 then we add 4% salary and so on.
·       As per our eligibility Rule, the person is either eligible for next step or the following step after that, therefore we use 2% or 4% hike.
·       If there is any FTE defined, we need to convert the rate with FTE because it is again applied in the process after the formula returns the value.


Formula Type: Salary progression rate calculation Rule

/***********************************************************
Formula Type : Salary Progression Rate Calculation Rule

***********************************************************/
/* DBI FOR  Ladder Factor and Freq */
DEFAULT_DATA_VALUE FOR  PER_ASG_GRADE_RATES_ANNUALIZATION_FACTOR IS 1
DEFAULT_DATA_VALUE FOR  PER_ASG_GRADE_RATES_RATE_FREQUENCY is ' '
DEFAULT_DATA_VALUE FOR  PER_ASG_GRADE_RATES_NAME is ' '
DEFAULT_DATA_VALUE FOR  PER_GRADE_RATES_ANNUALIZATION_FACTOR IS 1
DEFAULT_DATA_VALUE FOR  PER_GRADE_RATES_RATE_FREQUENCY IS ' '

DEFAULT FOR     PER_ASG_GRADE_LADDER_NAME IS ' '
/* DBI FOR  Salary Information */
DEFAULT FOR CMP_ASSIGNMENT_SALARY_FTE_VALUE IS 1
DEFAULT FOR CMP_ASSIGNMENT_SALARY_AMOUNT IS -1
DEFAULT FOR CMP_ASSIGNMENT_SALARY_ANNUALIZATION_FACTOR IS -1
DEFAULT FOR CMP_ASSIGNMENT_SALARY_ANNUAL_AMOUNT IS -1 
DEFAULT FOR CMP_ASSIGNMENT_SALARY_BASIS_CODE IS ' '

DEFAULT FOR PER_GRADE_STEP_NAME IS '-1'

/* Input Values */
INPUTS ARE CMP_IV_GRADE_LADDER_ID(NUMBER), CMP_IV_GRADE_ID (NUMBER), CMP_IV_STEP_ID(NUMBER),
           CMP_IV_GRADE_LADDER_NAME (TEXT), CMP_IV_GRADE_NAME (TEXT),CMP_IV_STEP_NAME (TEXT)

DEFAULT FOR CMP_IV_STEP_NAME IS '-1'

L_temp = ESS_LOG_WRITE('*** Entering Tilak_Lakshmi_GSP_RATE' )
L_temp = ESS_LOG_WRITE('Ladder name ' + PER_ASG_GRADE_LADDER_NAME )

L_Grade_annual_factor = 12
L_Grade_Freq  = 'MONTHLY'

/* find the current asg frequency
  You do not need this, since the FF written for a Ladder
*/
index = PER_ASG_GRADE_RATES_ANNUALIZATION_FACTOR.FIRST(-1)
WHILE (PER_ASG_GRADE_RATES_ANNUALIZATION_FACTOR.EXISTS(index))
LOOP (

   L_temp = ESS_LOG_WRITE('Grade Rate Name  ' + PER_ASG_GRADE_RATES_NAME[index] )
   IF (PER_ASG_GRADE_RATES_NAME[index] =PER_ASG_GRADE_LADDER_NAME) THEN (
      L_Grade_annual_factor = PER_ASG_GRADE_RATES_ANNUALIZATION_FACTOR[index]
      L_Grade_Freq          = PER_ASG_GRADE_RATES_RATE_FREQUENCY[index]

       L_temp= ESS_LOG_WRITE( ' Grade Annualization Factor  ' +  to_char(L_Grade_annual_factor) )
       L_temp= ESS_LOG_WRITE( ' Grade Annualization Frequency  ' +  L_Grade_Freq )
      EXIT
   )
   index  = PER_ASG_GRADE_RATES_ANNUALIZATION_FACTOR.NEXT(index ,-1)

)

L_temp= ESS_LOG_WRITE( ' CMP_ASSIGNMENT_SALARY_FTE_VALUE  ' +  to_char(CMP_ASSIGNMENT_SALARY_FTE_VALUE) )
L_temp= ESS_LOG_WRITE( ' CMP_ASSIGNMENT_SALARY_AMOUNT  ' +  to_char(CMP_ASSIGNMENT_SALARY_AMOUNT) )
L_temp= ESS_LOG_WRITE( ' CMP_ASSIGNMENT_SALARY_ANNUALIZATION_FACTOR  ' +  to_char(CMP_ASSIGNMENT_SALARY_ANNUALIZATION_FACTOR) )
L_temp= ESS_LOG_WRITE( ' CMP_ASSIGNMENT_SALARY_ANNUAL_AMOUNT  ' +  to_char(CMP_ASSIGNMENT_SALARY_ANNUAL_AMOUNT) )
L_temp= ESS_LOG_WRITE( ' CMP_ASSIGNMENT_SALARY_BASIS_CODE  ' +  CMP_ASSIGNMENT_SALARY_BASIS_CODE )
L_temp= ESS_LOG_WRITE( ' PER_GRADE_STEP_NAME  ' +  PER_GRADE_STEP_NAME )
L_temp= ESS_LOG_WRITE( ' Eligible STEP_NAME  ' +  CMP_IV_STEP_NAME )


L_salary = CMP_ASSIGNMENT_SALARY_AMOUNT
/* if the freq of the grade and salary is not the same */
IF (L_Grade_Freq != CMP_ASSIGNMENT_SALARY_BASIS_CODE) THEN (
   L_salary = CMP_ASSIGNMENT_SALARY_ANNUAL_AMOUNT
   /* Convert the annual Salary to Grade rate */
   IF (L_Grade_annual_factor != 1) THEN (
      L_salary = L_salary / L_Grade_annual_factor
   )
)

L_temp= ESS_LOG_WRITE( ' Grade Rate salary  ' +  to_char(L_salary) )

/* Fte*/
IF (CMP_ASSIGNMENT_SALARY_FTE_VALUE WAS NOT DEFAULTED) THEN (
   L_salary = L_salary / CMP_ASSIGNMENT_SALARY_FTE_VALUE
   L_temp= ESS_LOG_WRITE( ' Grade Rate salary  ' +  to_char(L_salary) )
)
L_temp= ESS_LOG_WRITE( ' FTE Salary ' +  to_char(L_salary) )

/* add % to salary */
IF ( (TO_NUMBER(CMP_IV_STEP_NAME) - to_number(PER_GRADE_STEP_NAME)) > 1 ) THEN (
   L_salary =L_salary * 1.4
)ELSE (
    L_salary =L_salary * 1.2
)
L_temp= ESS_LOG_WRITE( ' Adjusted Salary ' +  to_char(L_salary) )


L_temp = ESS_LOG_WRITE('Exiting Tilak_Lakshmi_GSP_RATE: '+ TO_CHAR(L_salary) )
Return L_salary


Explanation of Formula.
/* DBI FOR  Ladder Factor and Freq */
DEFAULT_DATA_VALUE FOR  PER_ASG_GRADE_RATES_ANNUALIZATION_FACTOR IS 1
DEFAULT_DATA_VALUE FOR  PER_ASG_GRADE_RATES_RATE_FREQUENCY is ' '
DEFAULT_DATA_VALUE FOR  PER_ASG_GRADE_RATES_NAME is ' '
DEFAULT_DATA_VALUE FOR  PER_GRADE_RATES_ANNUALIZATION_FACTOR IS 1
DEFAULT_DATA_VALUE FOR  PER_GRADE_RATES_RATE_FREQUENCY IS ' '
DEFAULT FOR             PER_ASG_GRADE_LADDER_NAME IS ' '
/* DBI FOR  Salary Information */
DEFAULT FOR CMP_ASSIGNMENT_SALARY_FTE_VALUE IS 1
DEFAULT FOR CMP_ASSIGNMENT_SALARY_AMOUNT IS -1
DEFAULT FOR CMP_ASSIGNMENT_SALARY_ANNUALIZATION_FACTOR IS -1
DEFAULT FOR CMP_ASSIGNMENT_SALARY_ANNUAL_AMOUNT IS -1 
DEFAULT FOR CMP_ASSIGNMENT_SALARY_BASIS_CODE IS ' '
DEFAULT FOR PER_GRADE_STEP_NAME IS '-1'

Declaration and initialization of Formula. We have declared more DBI than what we actually used in the Formula.


/* Input Values */
INPUTS ARE CMP_IV_GRADE_LADDER_ID(NUMBER), CMP_IV_GRADE_ID (NUMBER), CMP_IV_STEP_ID(NUMBER),
           CMP_IV_GRADE_LADDER_NAME (TEXT), CMP_IV_GRADE_NAME (TEXT),CMP_IV_STEP_NAME (TEXT)

DEFAULT FOR CMP_IV_STEP_NAME IS '-1'

Declaration of Input values. The Step name alone initialized with default value because if the Ladder does not uses the Step, we do not get any errors from using Step Name Input values.

L_temp = ESS_LOG_WRITE('*** Entering Tilak_Lakshmi_GSP_RATE' )
L_temp = ESS_LOG_WRITE('Ladder name ' + PER_ASG_GRADE_LADDER_NAME )

L_Grade_annual_factor = 12
L_Grade_Freq  = 'MONTHLY'

/* find the current asg frequency
  You do not need this, since the FF written for a Ladder
*/
index = PER_ASG_GRADE_RATES_ANNUALIZATION_FACTOR.FIRST(-1)
WHILE (PER_ASG_GRADE_RATES_ANNUALIZATION_FACTOR.EXISTS(index))
LOOP (

   L_temp = ESS_LOG_WRITE('Grade Rate Name  ' + PER_ASG_GRADE_RATES_NAME[index] )
   IF (PER_ASG_GRADE_RATES_NAME[index] =PER_ASG_GRADE_LADDER_NAME) THEN (
      L_Grade_annual_factor = PER_ASG_GRADE_RATES_ANNUALIZATION_FACTOR[index]
      L_Grade_Freq          = PER_ASG_GRADE_RATES_RATE_FREQUENCY[index]

       L_temp= ESS_LOG_WRITE( ' Grade Annualization Factor  ' +  to_char(L_Grade_annual_factor) )
       L_temp= ESS_LOG_WRITE( ' Grade Annualization Frequency  ' +  L_Grade_Freq )
      EXIT
   )
   index  = PER_ASG_GRADE_RATES_ANNUALIZATION_FACTOR.NEXT(index ,-1)

)
Annualization Factor is defaulted to 12 and Frequency is defaulted to Monthly. As this Formula is created for a Ladder, we know in advance what is the Frequency and Annualization Factor. Therefore, we do not need to find the information from the DBI, we can use the hard coded values.
The code that finds the Frequency and Annualization factor do not work for this formula. This is just an example. The reason why it is not working is explained in the ‘Limitation of Formula’ section.


L_temp= ESS_LOG_WRITE( ' CMP_ASSIGNMENT_SALARY_FTE_VALUE  ' +  to_char(CMP_ASSIGNMENT_SALARY_FTE_VALUE) )
L_temp= ESS_LOG_WRITE( ' CMP_ASSIGNMENT_SALARY_AMOUNT  ' +  to_char(CMP_ASSIGNMENT_SALARY_AMOUNT) )
L_temp= ESS_LOG_WRITE( ' CMP_ASSIGNMENT_SALARY_ANNUALIZATION_FACTOR  ' +  to_char(CMP_ASSIGNMENT_SALARY_ANNUALIZATION_FACTOR) )
L_temp= ESS_LOG_WRITE( ' CMP_ASSIGNMENT_SALARY_ANNUAL_AMOUNT  ' +  to_char(CMP_ASSIGNMENT_SALARY_ANNUAL_AMOUNT) )
L_temp= ESS_LOG_WRITE( ' CMP_ASSIGNMENT_SALARY_BASIS_CODE  ' +  CMP_ASSIGNMENT_SALARY_BASIS_CODE )
L_temp= ESS_LOG_WRITE( ' PER_GRADE_STEP_NAME  ' +  PER_GRADE_STEP_NAME )
L_temp= ESS_LOG_WRITE( ' Eligible STEP_NAME  ' +  CMP_IV_STEP_NAME )


L_salary = CMP_ASSIGNMENT_SALARY_AMOUNT
/* if the freq of the grade and salary is not the same */
IF (L_Grade_Freq != CMP_ASSIGNMENT_SALARY_BASIS_CODE) THEN (
   L_salary = CMP_ASSIGNMENT_SALARY_ANNUAL_AMOUNT
   /* Convert the annual Salary to Grade rate */
   IF (L_Grade_annual_factor != 1) THEN (
      L_salary = L_salary / L_Grade_annual_factor
   )
)
Converting the salary to the Grade Rate value.

L_temp= ESS_LOG_WRITE( ' Grade Rate salary  ' +  to_char(L_salary) )

/* Fte*/
IF (CMP_ASSIGNMENT_SALARY_FTE_VALUE WAS NOT DEFAULTED) THEN (
   L_salary = L_salary / CMP_ASSIGNMENT_SALARY_FTE_VALUE
   L_temp= ESS_LOG_WRITE( ' Grade Rate salary  ' +  to_char(L_salary) )
)
L_temp= ESS_LOG_WRITE( ' FTE Salary ' +  to_char(L_salary) )
Applying FTE to the Grade Rate Value.

/* add % to salary */
IF ( (TO_NUMBER(CMP_IV_STEP_NAME) - to_number(PER_GRADE_STEP_NAME)) > 1 ) THEN (
   L_salary =L_salary * 1.4
)ELSE (
    L_salary =L_salary * 1.2
)
L_temp= ESS_LOG_WRITE( ' Adjusted Salary ' +  to_char(L_salary) )
Giving raise a per the experience.


L_temp = ESS_LOG_WRITE('Exiting Tilak_Lakshmi_GSP_RATE: '+ TO_CHAR(L_salary) )
Return L_salary

Returning the Final Value.

Limitation of the Formula:
1)     No DBI at Steps level to find the rate is available.
2)     The sample code is using the Grade level DBI to find the Rate and there is no rate defined at the Grade level.

Log

*** Entering Tilak_Lakshmi_GSP_RATE
Ladder name Tilak-Lakshmi Test Ladder
Grade Rate Name  GSP Midwest Customer Support Grades
 CMP_ASSIGNMENT_SALARY_FTE_VALUE  .5
 CMP_ASSIGNMENT_SALARY_AMOUNT  1001
 CMP_ASSIGNMENT_SALARY_ANNUALIZATION_FACTOR  12
 CMP_ASSIGNMENT_SALARY_ANNUAL_AMOUNT  12012
 CMP_ASSIGNMENT_SALARY_BASIS_CODE  MONTHLY
 PER_GRADE_STEP_NAME  1
 Eligible STEP_NAME  2
 Grade Rate salary  1001
 Grade Rate salary  2002
 FTE Salary 2002
 Adjusted Salary 2402.4
Exiting Tilak_Lakshmi_GSP_RATE: 2402.4


Formula use case For Calculating Date:
Honestly, we were not able to find a good use case for calculating the date. We are not sure if the following use case has any practical purpose but it may help you to understand the basics of the Data Calculation Fast Formula. We decided to determine the date from the Frequency of the salary. If the Salary Frequency is Annual, the Date will be the first of next year. If it is Monthly then the Date will be the first of next month.
Otherwise, the Effective date will be returned.

Formula Type: Salary progression rate calculation Rule


/*********************************************
Formula Type:     Salary Progression Date Determination Rule

****************************************************/


DEFAULT FOR     PER_ASG_GRADE_LADDER_NAME IS ' '
/* DBI FOR  Salary Information */
DEFAULT FOR CMP_ASSIGNMENT_SALARY_BASIS_CODE IS ' '


/* Input Values */
INPUTS ARE CMP_IV_GRADE_LADDER_ID(NUMBER), CMP_IV_GRADE_ID (NUMBER), CMP_IV_STEP_ID(NUMBER),
           CMP_IV_GRADE_LADDER_NAME (TEXT), CMP_IV_GRADE_NAME (TEXT),CMP_IV_STEP_NAME (TEXT)

L_temp = ESS_LOG_WRITE('*** Entering Tilak_Lakshmi_GSP_DATE' )
L_temp = ESS_LOG_WRITE('Ladder name ' + PER_ASG_GRADE_LADDER_NAME )

l_date  = GET_CONTEXT(EFFECTIVE_DATE, '2000/01/10' (date))
l_date_c = to_char(l_date, 'YYYY/MM/DD')

L_temp = ESS_LOG_WRITE('effective Date  ' + l_date_c )
L_temp = ESS_LOG_WRITE('Salary Frequency  ' + CMP_ASSIGNMENT_SALARY_BASIS_CODE )

/*Calculate the Date */
IF (CMP_ASSIGNMENT_SALARY_BASIS_CODE = 'ANNUALLY') THEN (
  
    L_DATE = TRUNC(ADD_MONTHS(l_DATE, 12), 'YYYY')
)ELSE (
   IF (CMP_ASSIGNMENT_SALARY_BASIS_CODE = 'MONTHLY') THEN (
  
       L_DATE = TRUNC(ADD_MONTHS(l_DATE, 12), 'MM')
   )
)
l_date_c = to_char(l_date, 'YYYY/MM/DD')

L_temp = ESS_LOG_WRITE('Exiting Tilak_Lakshmi_GSP_DATE: '+l_date_c  )
Return l_date_c

The Formula is pretty self-explanatory.  If the Salary Frequency is Annually, 12 months is added to effective date and First date of the year is calculated from the date.  If the Frequency is Monthly, 1 month is added to the effective date and First date of the month is calculated from the Date. The result is converted into ‘YYYY/MM/DD’ date format and the value is returned.


Log


 *** Entering Tilak_Lakshmi_GSP_DATE
Ladder name Tilak-Lakshmi Test Ladder
effective Date  2016/07/30
Salary Frequency  MONTHLY
Exiting Tilak_Lakshmi_GSP_DATE: 2016/08/01



This completes the Rate and Date formulas. As usual, if you have any questions or suggestions, please feel free to comment.






You Tube Tutorial: GSP Person Selection Formula 2 - Oracle Fusion HCM Fast Formula Tutorial-9

/*

Name:  GSP_PERSON_SELECTION2 

Type:  Compensation Person Selection

Purpose: Skip the person who is already in ceiling step 

          

***************************/


/* DBI */ 


DEFAULT_DATA_VALUE FOR  PER_GRD_GRADE_HISTORY_CEILING_STEP_ID IS -1

DEFAULT_DATA_VALUE FOR  PER_GRD_GRADE_HISTORY_EFFECTIVE_START_DATE IS  '1900/01/01 00:00:00' (date)

DEFAULT_DATA_VALUE FOR  PER_GRD_GRADE_HISTORY_EFFECTIVE_END_DATE IS  '1900/01/01 00:00:00' (date)

DEFAULT FOR PER_GRADE_STEP_NAME IS ' '


/* input Values */ 

INPUTS ARE CMP_IV_GRADE_LADDER_ID (NUMBER)


l_data = set_log('Entering GSP_PERSON_SELECTION2' )

grade = GET_CONTEXT(GRADE_ID, -1)

eDate = GET_CONTEXT(EFFECTIVE_DATE, '1900/01/01 00:00:00' (date) )


l_data = set_log('Ladder ' ||  TO_CHAR(CMP_IV_GRADE_LADDER_ID) )

l_data = set_log('Grade  ' ||  TO_CHAR(grade) )

l_data = set_log('EFF DATE   ' ||  TO_CHAR(eDate) )

l_data = set_log('Person Grade Step Name   ' ||  PER_GRADE_STEP_NAME )


/* Find the ceiling id of eff date */ 

RETVAL = 'Y' 

l_step_id = -1

index = PER_GRD_GRADE_HISTORY_CEILING_STEP_ID.FIRST( -1)

WHILE (PER_GRD_GRADE_HISTORY_CEILING_STEP_ID.EXISTS(index))

LOOP (

   lstDate = PER_GRD_GRADE_HISTORY_EFFECTIVE_START_DATE[index] 

   lenDate = PER_GRD_GRADE_HISTORY_EFFECTIVE_END_DATE[index] 

   l_data = set_log('CEILING Dates   ' ||  TO_CHAR(lstDate) || ' / '||  TO_CHAR(lenDate))

   if (edate >= lstDate AND edate <= lenDate ) THEN (

       l_step_id =  PER_GRD_GRADE_HISTORY_CEILING_STEP_ID[index] 

       l_data = set_log('Step ID    ' ||  TO_CHAR(l_step_id) )

       exit

   )

  index = PER_GRD_GRADE_HISTORY_CEILING_STEP_ID.NEXT(index, -1 )

)

/* eof loop */ 

IF ( l_step_id != -1  ) THEN (

  lparam = '|=STEP_ID='|| TO_CHAR(l_step_id) 

  l_data = set_log('Person Grade Step Name   ' ||   lparam )

  l_step_name = GET_VALUE_SET('GSP_GET_STEP_NAME' , lparam)

  l_data = set_log('Ceil Step Name   ' ||   l_step_name )  

  IF ( PER_GRADE_STEP_NAME = l_step_name )THEN (

     RETVAL = 'N' 

  )



)


l_data = set_log('Leaving  GSP_PERSON_SELECTION2 ' || RETVAL )

RETURN RETVAL 

Wednesday, July 25, 2018

Grade Steps Progressions (GSP) Fast Formula Samples



We found that there is not much information available on GSP Formula Types. So, we have put together a good set of sample codes with a hypothetical use case that could help the GSP users.

The information provided in this blog may not be the latest or may be obsoleted. Please consult with your Product Support to get the latest information. The code provided here is to give an example.

We explained the contexts of GSP Formula Types in our previous blog and therefore we are not going to repeat the same again. All the CMP/TCS and GSP formulas types support the same Contexts.


Formula Type: Compensation Person Selection.

The type of formula used in ESS parameters is person Selection Formula.
This formula is executed while selecting the person for the process. The count of processed people is calculated after executing this formula and individual persons are processed after the person selection Formula is executed for all the people who were selected by other ESS parameters.



åå


Input value for Person Selection Formula for GSP process.
Input Value
Type
Format
CMP_IV_GRADE_LADDER_ID
Number


Since the Person Selection is common for the entire compensation product, you can use any example provided for CWB, TCS or GSP.

Formula Type: Participation and Rate Eligibility.

The Formula type belongs to Oracle Benefit and used in Oracle Benefit’s Eligibility. GSP uses the Benefit Eligibility Engine to determine the eligibility of a Grade Ladder, grades and steps for a person. Therefore, you need to create eligibility profile to limit /Filter the Grade Ladder, Grades or Steps.

Again, it is very common for CWB, TCS and GSP. Though it is common type, it uses different input values and business logic to validate a Ladder, Grade or Steps.

The most important aspects the eligibility formula is the Return value and Return variable. This type of formula supports the value ‘Y’ or ‘N’ and the return variable must be ELIGIBLE. If you return any other variable or in any other case format the Formula set the person/grade/step as ineligible.


The contexts Supported by the GSP eligibility Formulas

Context
Type
DATE_EARNED
Date
EFFECTIVE_DATE
Date
HR_ASSIGNMENT_ID
Number
JOB_ID
Number
LEGAL_EMPLOYER_ID
Number
LEGISLATIVE_DATA_GROUP_ID
Number
PAYROLL_ASSIGNMENT_ID
Number
PAYROLL_RELATIONSHIP_ID
Number
PAYROLL_TERM_ID
Number
PERSON_ID
Number
HR_TERM_ID
Number


Eligibility of Grade Ladder.


You can create eligibility profile at Ladder level. This formula is executed once for an assignment. If the Assignment is not eligible for the Ladder, the process does not evaluate the grades and steps. This is the First formula which gets executed at the person Level processing.


Input Values
Types
CMP_IV_GRADE_LADDER_ID
Number
CMP_IV_GRADE_LADDER_NAME
Text

Eligibility of Grade.
The formula is attached with the Grade eligibility profile and is executed for every person. The grade is not eligible then the Steps are not processed. The process is intelligent enough to process the grades that are above the current grade of the person and it continues the process till it finds the first ineligible grade.

Input Values
Types
CMP_IV_GRADE_LADDER_ID
Number
CMP_IV_GRADE_LADDER_NAME
Text
CMP_IV_GRADE_ID
Number
CMP_IV_GRADE_NAME
Text

Eligibility Step.

Steps are processed very similar to the grades.

Input Values
Types
CMP_IV_GRADE_LADDER_ID
Number
CMP_IV_GRADE_LADDER_NAME
Text
CMP_IV_GRADE_ID
Number
CMP_IV_GRADE_NAME
Text
CMP_IV_STEP_ID
Number
CMP_IV_STEP_NAME
Text
Use Case: To demonstrate the Eligibility formula, we used a hypothetical Use Case, in this Use Case, the Ladder has two Grades and each Grade has four Steps.
The Eligibility is attached at Step level. No eligibility is defined at Grade Level or Ladder Level.
The person will move to next step for every process only when the person worked more than a year in the Organization. In case, if the person has worked more than three years in the Organization, then he is eligible for third step (Skip one step). The person is eligible for only one step in a process.


Create an eligibility profile with formula. (Formula is created before the eligibility profile)





Create Steps rule with eligibility profile





Formula text of Eligibility.



/*

Formula Type: Participation and Rate Eligibility

*/

/* DBI Used in the FF */

DEFAULT FOR PER_PER_LATEST_REHIRE_DATE IS '1900/01/01 00:00:00'(date)
DEFAULT FOR PER_GRADE_STEP_NAME IS '-1'

/* Input Values */

INPUTS ARE CMP_IV_GRADE_LADDER_ID(NUMBER), CMP_IV_GRADE_ID (NUMBER), CMP_IV_STEP_ID(NUMBER),
CMP_IV_GRADE_LADDER_NAME (TEXT), CMP_IV_GRADE_NAME (TEXT),CMP_IV_STEP_NAME (TEXT)

L_temp = ESS_LOG_WRITE('***Entering Tilak_Lakshmi_Eligbility_Elig_FF***')

/* Get context Values */

L_PERSON_ID = GET_CONTEXT(PERSON_ID, -1)
L_ASG_ID = GET_CONTEXT(HR_ASSIGNMENT_ID, -1)
L_EFF_DATE = get_context(EFFECTIVE_DATE, '1900/01/01 00:00:00' (date))
/* Local Variables */
L_1_ANIV = ADD_DAYS(PER_PER_LATEST_REHIRE_DATE, 365)
L_3_ANIV = ADD_DAYS(PER_PER_LATEST_REHIRE_DATE, 1095 )
L_ELIG = 'N'
ELIGIBLE = 'N'


L_temp = ESS_LOG_WRITE('Person ID : ' + to_char(L_PERSON_ID) )
L_temp = ESS_LOG_WRITE('Asg ID : ' + to_char(L_ASG_ID) )
L_temp = ESS_LOG_WRITE('Effective date : ' + to_char(L_EFF_DATE) )
L_temp = ESS_LOG_WRITE('First Anniversary : ' + to_char(L_1_ANIV) )
L_temp = ESS_LOG_WRITE('Third Anniversary : ' + to_char(L_3_ANIV) )
L_temp = ESS_LOG_WRITE('Current Step : ' + PER_GRADE_STEP_NAME )
L_temp = ESS_LOG_WRITE('Validating STEP : ' + CMP_IV_STEP_NAME )

/* Get the value from WSA */
L_ELIG_ASG = WSA_GET('WSA_GSP_ELIG_PERSON', -1)
L_temp = ESS_LOG_WRITE('Elig ASG ID : ' + TO_CHAR( L_ELIG_ASG ) )

/* IF the asg already eligible */
IF (L_ELIG_ASG = L_ASG_ID ) THEN
(
L_temp = ESS_LOG_WRITE('Assignment is already eligible for a Step' )
L_ELIG = 'Y'
)

/* not eligible yet */
IF (L_ELIG = 'N') THEN
(
/* Three year anniversary passed */
IF (L_3_ANIV <= L_EFF_DATE ) THEN
(
L_temp = ESS_LOG_WRITE('Assignment has worked more then 3 years' )
IF (PER_GRADE_STEP_NAME = '1' AND CMP_IV_STEP_NAME = '3') THEN
(
ELIGIBLE = 'Y'
)ELSE (
   IF (PER_GRADE_STEP_NAME = '2' AND CMP_IV_STEP_NAME = '4') THEN
  (
    ELIGIBLE = 'Y'
  )
)
) ELSE
  (
/* One year anniversary */
   L_temp = ESS_LOG_WRITE('Assignment has worked more then 1 year' )
  IF (L_1_ANIV <= L_EFF_DATE ) THEN
  (
    IF (PER_GRADE_STEP_NAME = '1' AND CMP_IV_STEP_NAME = '2') THEN
  (
    ELIGIBLE = 'Y'
   )ELSE (
     IF (PER_GRADE_STEP_NAME = '2' AND CMP_IV_STEP_NAME = '3') THEN
    (
       ELIGIBLE = 'Y'
   ) ELSE (
      IF (PER_GRADE_STEP_NAME = '3' AND CMP_IV_STEP_NAME = '4') THEN
   (
     ELIGIBLE = 'Y'
  )
)
)
)
)
)

/* if eligible store the value */
IF (ELIGIBLE = 'Y' ) THEN
(
   WSA_SET('WSA_GSP_ELIG_PERSON', L_ASG_ID)
)
L_temp = ESS_LOG_WRITE('Leaving Tilak_Laskshmi_Eligbility_Elig_FF : ' + ELIGIBLE)
RETURN ELIGIBLE




Explanation of Formula.

/* DBI Used in the FF */
DEFAULT FOR PER_PER_LATEST_REHIRE_DATE IS '1900/01/01 00:00:00'(date)
DEFAULT FOR PER_GRADE_STEP_NAME IS '-1'
Initialized the DBI that is going to be used. The hiring date is used for calculating the Anniversary and Step name is used for comparing the steps to determine the eligible step.

/* Input Values */
INPUTS ARE CMP_IV_GRADE_LADDER_ID(NUMBER), CMP_IV_GRADE_ID (NUMBER), CMP_IV_STEP_ID(NUMBER),
CMP_IV_GRADE_LADDER_NAME (TEXT), CMP_IV_GRADE_NAME (TEXT),CMP_IV_STEP_NAME (TEXT)

Initialized the Input values. Though we do not use all the input values, we initialized all the Input values for our example.

/* Get context Values */
L_PERSON_ID = GET_CONTEXT(PERSON_ID, -1)
L_ASG_ID = GET_CONTEXT(HR_ASSIGNMENT_ID, -1)
L_EFF_DATE = get_context(EFFECTIVE_DATE, '1900/01/01 00:00:00' (date))


The variables are initialized from the context. We use effective date to calculate and compare the years of experience. The Assignment Id is used to find the previous eligibility.

/* Local Variables */
L_1_ANIV = ADD_DAYS(PER_PER_LATEST_REHIRE_DATE, 365)
L_3_ANIV = ADD_DAYS(PER_PER_LATEST_REHIRE_DATE, 1095 )
L_ELIG = 'N'
ELIGIBLE = 'N'





Required local variables are initialized or calculated. First year and Third year anniversary date are calculated from effective Date. L_elig is defaulted to ‘N’ and used to determine if the assignment is already eligible for a step and ELIGIBLE for returning the result (please note that this type of formula supports only the return variable ‘ELIGIBLE’).


/* Get the value from WSA */
L_ELIG_ASG = WSA_GET('WSA_GSP_ELIG_PERSON', -1)
L_temp = ESS_LOG_WRITE('Elig ASG ID : ' + TO_CHAR( L_ELIG_ASG ) )

/* IF the asg already eligible */
IF (L_ELIG_ASG = L_ASG_ID ) THEN
(
L_temp = ESS_LOG_WRITE('Assignment is already eligible for a Step' )
L_ELIG = 'Y'
)
/* not eligible yet */
IF (L_ELIG = 'N') THEN



To validate if a person is already eligible, we check the variable/value from WSA (to understand more about WSA please read out blog, Communicating between Fast Formulas), if the WSA variable matches with the assignment id, we set the l_elig variable to ‘Y’. Since the person is already eligible for a step, we do not validate further, we return the default value of ELIGIBLE that is ‘N’.

/* Three year anniversary passed */
IF (L_3_ANIV <= L_EFF_DATE ) THEN
(
L_temp = ESS_LOG_WRITE('Assignment has worked more then 3 years' )
IF (PER_GRADE_STEP_NAME = '1' AND CMP_IV_STEP_NAME = '3') THEN
(
ELIGIBLE = 'Y'
)ELSE (
IF (PER_GRADE_STEP_NAME = '2' AND CMP_IV_STEP_NAME = '4') THEN
(
ELIGIBLE = 'Y'
)
)


If the person has worked for more than 3 years, we check the person’s current step (DBI PER_GRADE_STEP_NAME) is ‘1’ and the Formula validates step (Input value, CMP_IV_STEP_NAME) is ‘3’ (third step from the current step ) or current step is 2. And the validated step is 4, then we set the ELIGIBLE variable to ‘Y’ (otherwise the default value, ‘N’).


IF (L_1_ANIV <= L_EFF_DATE ) THEN
(
IF (PER_GRADE_STEP_NAME = '1' AND CMP_IV_STEP_NAME = '2') THEN
(
ELIGIBLE = 'Y'
)ELSE (
IF (PER_GRADE_STEP_NAME = '2' AND CMP_IV_STEP_NAME = '3') THEN
(
ELIGIBLE = 'Y'
) ELSE (
IF (PER_GRADE_STEP_NAME = '3' AND CMP_IV_STEP_NAME = '4') THEN
(
ELIGIBLE = 'Y'
)
)
)

If the person worked more than 1 year and less than 3 years, we check the current step (DBI PER_GRADE_STEP_NAME) and the validated step (Input value, CMP_IV_STEP_NAME) is the next step (Example: Current step is 1 and next step is 2 ) then we set the ELIGIBLE variable to ‘Y’ (otherwise the default value, ‘N’).

/* if eligible store the value */
IF (ELIGIBLE = 'Y' ) THEN
(
WSA_SET('WSA_GSP_ELIG_PERSON', L_ASG_ID)
)

If the person is eligible then we set the WSA variable to the assignment id so that we do not need to validate other steps.

RETURN ELIGIBLE

In the End, We return the ELIGIBLE value (Y/N.





I don’t think logs need any explanation, please comment if you need any detail on the log .
Log of 1 year experienced Person, eligible for Step 2 .



***Entering Tilak_Lakshmi_Eligbility_Elig_FF***

Person ID : 300100167151081

Asg ID : 300100167151144

Effective date : 2015-07-23T00:00:00.000Z

First Anniversary : 2015-07-23T00:00:00.000Z

Third Anniversary : 2017-07-22T00:00:00.000Z

Current Step  : 1

Validating STEP  : 2

Elig ASG ID  : -1

Assignment has worked more then 1 year

Leaving  Tilak_Laskshmi_Eligbility_Elig_FF : Y

***Entering Tilak_Lakshmi_Eligbility_Elig_FF***

Person ID : 300100167151081

Asg ID : 300100167151144

Effective date : 2015-07-23T00:00:00.000Z

First Anniversary : 2015-07-23T00:00:00.000Z

Third Anniversary : 2017-07-22T00:00:00.000Z

Current Step  : 1

Validating STEP  : 3

Elig ASG ID  : 300100167151144

Assignment is already eligible for a Step

Leaving  Tilak_Laskshmi_Eligbility_Elig_FF : N

Ineligible assignment_id 300100167151144:  Reason ERL

***Entering Tilak_Lakshmi_Eligbility_Elig_FF***

Person ID : 300100167151081

Asg ID : 300100167151144

Effective date : 2015-07-23T00:00:00.000Z

First Anniversary : 2015-07-23T00:00:00.000Z

Third Anniversary : 2017-07-22T00:00:00.000Z

Current Step  : 1

Validating STEP  : 4

Elig ASG ID  : 300100167151144

Assignment is already eligible for a Step

Leaving  Tilak_Laskshmi_Eligbility_Elig_FF : N


Log of 3 year experienced Person, not eligible for step 2 but 3.



Processing Person  : FFTEST, Tilak-Lakshmi

***Entering Tilak_Lakshmi_Eligbility_Elig_FF***

Person ID : 300100167099668

Asg ID : 300100167099683

Effective date : 2015-07-23T00:00:00.000Z

First Anniversary : 2002-07-23T00:00:00.000Z

Third Anniversary : 2004-07-22T00:00:00.000Z

Current Step  : 1

Validating STEP  : 2

Elig ASG ID  : 300100167151144

Assignment has worked more then 3 years

Leaving  Tilak_Laskshmi_Eligbility_Elig_FF : N

Ineligible assignment_id 300100167099683:  Reason ERL

***Entering Tilak_Lakshmi_Eligbility_Elig_FF***

Person ID : 300100167099668

Asg ID : 300100167099683

Effective date : 2015-07-23T00:00:00.000Z

First Anniversary : 2002-07-23T00:00:00.000Z

Third Anniversary : 2004-07-22T00:00:00.000Z

Current Step  : 1

Validating STEP  : 3

Elig ASG ID  : 300100167151144

Assignment has worked more then 3 years

Leaving  Tilak_Laskshmi_Eligbility_Elig_FF : Y

***Entering Tilak_Lakshmi_Eligbility_Elig_FF***

Person ID : 300100167099668

Asg ID : 300100167099683

Effective date : 2015-07-23T00:00:00.000Z

First Anniversary : 2002-07-23T00:00:00.000Z

Third Anniversary : 2004-07-22T00:00:00.000Z

Current Step  : 1

Validating STEP  : 4

Elig ASG ID  : 300100167099683

Assignment is already eligible for a Step

Leaving  Tilak_Laskshmi_Eligbility_Elig_FF : N


This is end of the Eligibility formula. We will cover the Rate and Date formulas
in our next blog.
As usual, if you have any questions or suggestions, please feel free to comment.




You Tube Tutorial: GSP Person Selection Formula 1 - Oracle Fusion HCM Fast Formula Tutorial-8




/*

 Name :  GSP_PERSON_SELECTION

 Type. :  Compensation Person Selection

 Purpose : to filter the person sho are in probation period or already in step 5 or more


************************************************/

/* DBI */ 


DEFAULT FOR PER_GRADE_STEP_SEQUENCE IS -1 

DEFAULT FOR PER_ASG_DATE_PROBATION_END IS '1900/01/01 00:00:00' (date)


/* input */ 

INPUTS ARE CMP_IV_GRADE_LADDER_ID (NUMBER)



l_data = SET_LOG(' Entering GSP_PERSON_SELECTION')


RETVAL = 'Y' 

grade = GET_CONTEXT(GRADE_ID , -1) 

eDate = GET_CONTEXT(EFFECTIVE_DATE, '1900/01/01 00:00:00' (date) )



l_data = SET_LOG(' Grade ID ' || TO_CHAR(grade) )

l_data = SET_LOG(' EFF DATE  ' || TO_CHAR(eDate) )

l_data = SET_LOG(' STEP SEQ  ' || TO_CHAR(PER_GRADE_STEP_SEQUENCE) )

l_data = SET_LOG(' PROB DATE   ' || TO_CHAR(PER_ASG_DATE_PROBATION_END) )


/* step  is < 5 * */ 

IF (PER_GRADE_STEP_SEQUENCE >= 5  ) THEN (

   RETVAL = 'N' 

   l_data = SET_LOG(' Failed in step '  )

)


/* probation validation */ 

IF (RETVAL = 'Y' ) THEN (

   IF ( PER_ASG_DATE_PROBATION_END >=  eDate ) THEN (

       RETVAL = 'N' 

       l_data = SET_LOG(' Failed in prob '  )

   )


)



l_data = SET_LOG(' Leaving  GSP_PERSON_SELECTION ' || RETVAL )

RETURN RETVAL