Friday, April 8, 2016

Fast Formula - Functions

Fast Formula and Functions


Fast Formula allows executing a PL/SQL Function through Fast Formula function definitions.

Fast Formula function is an interface between Fast Formula engine and the PL/SQL functions.
Each product that uses Fast Formula has seeded various Functions that can be used in the Fast Formula.
Fast Formula Functions is one of the most used features in EBS, especially in Oracle Benefit and Oracle Compensation. In EBS, the developer can write any function in PL/SQL and define that as Fast Formula Function and this function can be executed in the application via the Fast Formula.  EBS has even provided an UI to define the Fast Formula Functions.


But in Fusion, unless it is an onsite implementation, the user does not have access to the database. Therefore, it is not possible for the user to create PL/SQL Function.
Since there is no option to define the Fast Formula Function, we are not going into the details of defining the Fast Formula Function. If your implementation is onsite, you can follow the EBS documents. Only difference from the EBS days is that the Fast Formula is executed in a different schema. So, you need to create synonyms and provide proper grants to execute the functions.
In this section, we will explain the different components of the Fast Formula Functions and how it is used in Fast Formula from a user point of view.
Components of Fast Formula:
1)       PL/SQL Function
2)       Return Type
3)       Context
4)       Parameters

PL/SQL Function: Fast Formula does not support any PL/SQL function that uses an array or any other collection as a parameter or return value. The name of the PL/SQL Function does not have to necessarily match the Fast Formula Function names. Function overloads are allowed.

Return Type: Return Type should be one of the simple data types – Text, Number or Date. The return type must match with what is returned by the PL/SQL Function.

Context:  This is a hidden part of the Fast Formula Function. Some parameter values in the PL/SQL Function are passed by the Fast Formula engine from the Context values. This way the user does not have to worry about these parameters. For example, to get the currency conversion rate, we use the Function GET_RATE and we pass parameters: From Currency, To Currency, Conversion Rate Type and Default value. We do not pass the date when the currency conversion is extracted and it is passed from the EFFECTIVE_DATE Context. You might have noticed that we never pass the person id or the assignment id or the effective date to the Fast Formula Functions because these values are passed from the Context behind the scenes. If the Context is not available in your Fast Formula Type then you will notable to use the Function in your Fast Formula.

Parameter: Parameter needs to be one of the basic types (Text, Date, or Number). It can be optional or required and it can be IN or OUT or Both. The Fast Formula developer needs to pass the values to these parameters. It is always passed in sequential order. I have never tried the Named Parameter. When I try this option, I will update the section. Usually the optional parameters are defined at the end and therefore, you do not need to worry about the Named Parameter. Sometimes they define the same function with different parameters for overloading. For example, TO_CHAR is an overloaded function with different parameter type. This is for date and number.

Example:

L_DATA = ESS_LOG_WRITE( 'BEGIN MY_FIRST_CWB_DEFAULT_FF' ) 

Ess_Log_write is a Fast Formula Function with 1 parameter and returns a Text Value.

L_date = ADD_MONTHS(L_PL_START_DATE, 1)
This is another Fast Formula Function with 2 parameters, 1 with Date, another with Number and returns a Date value.

We have tried to list all the available Fusion Functions below. You can always approach the Oracle team for further explanation. Some functions may be obsolete or not available in your release. Please check with the documentation or with the Oracle support.

 Function List

No comments:

Post a Comment