We have been receiving queries if we can add custom function libraries to Oracle Flow Builder, the answer would be a straight yes. In this article we will walk you through the steps as how we can add custom function library to Oracle Flow Builder.
Create function library and export the function library
- Create a function library in openscript , to know more in detail check out how to create function library in openscript?
- Click File > Export.
- Specify a file name for the zip file.
- Clear the check box option “Create self-contained” zip.
- Under Additional files to export, clear the Recorded Data, Playback Results and Error Log options.
- Click OK to save the file.
Steps to import custom function library in to Oracle Flow builder
- Login in to Oracle Flow Builder with Administrator privileges.
- Click on Administration main menu,
- On the left side under “Setup” section, click on function library,
- Click on “Add New Library”.
- Browser your exported custom function library.
- Enter ebs-function-libs in “Location in Repository” field.
- Click Import Functions button.
Once the import process is successful, one can start using the functions while creating the components. Also all the functions written in the custom function library will be available.
How to execute the scripts with custom function library?
Though we could successfully upload the custom function library, there are few steps to be performed which will let us to execute the scripts properly. In the machine where end user plans to have script execution need to have a Repository by name “OATS” , this is the path where we need to extract the function-libs.zip file which is given by Oracle Flow Builder. On unzipping we get a folder by name ebs-function-libs, which contains all the default function libraries given by Oracle Flow Builder. We need to have all our custom library function libraries in the same location for the script to execute successfully.
Other important notes
- Once the function library is added, we will not be able add any additional functions to the function library. Oracle Flow Builder currently does not support to do the same from front end.
- Once the function library is added, we cannot delete them from Oracle Flow Builder, Oracle Flow builder currently does not support his functionality from front end.
May be they would come in later versions of Oracle Flow Builder.
Please feel ask your queries in the comments area, I would try my best to find an answer for you.
Founder of TestingTools.co, constantly shares knowledge on different test automation tools. Has experience in building proof of concepts, solutions, frameworks, platforms & implementation of test automation projects.
In pursuit of building a platform with inbuilt framework and reusable components for Oracle Cloud applications ( Oracle HCM, CX, SCM, Financials clouds, Salesforce and other cloud applications )
Major accomplishments in his career:
- Product architect and development manager for test automation platforms
- Oracle Flow Builder @ Oracle
- CloudTestr @ Suneratech
- 2 times to oracle open world
- More than 20 successful POCs ( Proof of concepts )
- 100 demos
- Designed pricing models.
- Trained more than 50 members.
- Built more than 100 re-usable functions.
Worked with tools:
Thanks a lot for adding this info .
Recently I was able to add a function setURL to function library GENLIB from back end . Please find below the steps.
CAUTION : Please try this in your test Instance of OFB before doing it in Prod. Also try this on a custom function . I am showing this on Seeded function GENLIB.
1. Create a function “setURL” in the library “GENLIB” with the parameters as “urlType” and “instanceUrl”
by opening GENLIB from ebs-function-libs folder using OpenScript
2. In OFB Database Insert the function “setURL” into “functions” database table as below.
INSERT INTO FUNCTIONS (FUNCID, FUNCNAME, PARAMCOUNT, COMMENTS, OBJID, PARAMS, TESTPLANDESCF) VALUES (‘380’, ‘setURL’, ‘1’, ‘urlType,instanceUrl’, ’62’, ‘@caption,@param1’, ‘Sets instance URL for type @caption value is @param1’)
FUNCID : In this case it is 380 . Please find the available FUNCID by checking the last function in the FUNCTIONS table
OBJID: If you want to update this function under GENLIB Function Library . Each Function Library will have an Object ID .In this case for GENLIB it is 62 Identify the Object ID and use it in the above statement
3.You can use the new function setURL from GENLIB while building the component.
Please be aware that there are few more dependencies in case you are going ahead with this approach.
Consider below factors:
I was able to successfully import custom fun lib and use the function in component,
Build flow, download the script and run it using openscript
That’s good to know, Were you able to run the script directly? i.e. without updating the function library on the server side and not opening the script in openscript at least once?
Also the things which I mentioned earlier will cause issue in future, that is about hard coding the primary key value directly in your insert command.
Yes I did not copy the new function lib at the server
But copied on my local machine in the ebs…. Folder
It gave me problem initially . But when I
Opened the custom fun lib in open script
And navigates to assets tab of the downloaded script it cleared the errors.
Did not try inserting a new function and inserting function in OFB DB . I will do it tomorrow .
ok cool, do share me your observations.
I inserted a new function into new function library . This function library is already imported into OFB using UI.
I inserted a new function SetURLNew into the OFB Db using the followig statement.
INSERT INTO FUNCTIONS (FUNCID, FUNCNAME, PARAMCOUNT, COMMENTS, OBJID, PARAMS, TESTPLANDESCF) VALUES (‘100000186’, ‘setURLNew’, ‘1’, ‘instanceUrl’, ‘100000000’, ‘@caption,@param1’, ‘Sets instance URL for type @caption value is @param1’)
Note : I chose the Function ID as the last Unused Function ID number in the FUNCTIONS table.100000186 was free so I used it.
OBJID : Each Function Library has a number assigned to it in the data base . In my it is 100000000.
Once done I am able to search for the new Function SetURLNew from OFB UI.
Also I created a component using new function.
Created a flow.
Updated the Function Library file on the local machine with the new function.
Downloaded the script.
Opened it in OpenScript.
Went to assets tab and selected the new function Lib from the local machine.
Ran the code.
When we import the custom function Library from OFB front end . Will it not copy it to the desired location on the server ?
Will it not create entries into FUNCTION table in OFB Database ?
I tried inserting a new function to the existing function library and the used Insert command on to the data base and was able to use it in component.
This Function Library was already present in the server but the code corresponding to the new function was not updated in the function library at the Server side , still it managed to give me OFT code.
So I think In addition to importing the Custom Func Library we should keep it on the Server side .
When we import function library from UI it will take care of storing that library in server side and also adds records to database.
It will generate the code, but actually it will not be compiled by default in this specific case. It will compile only when we open the scripts in openscript and then execute.
But in case of adding an additional function in to existing library from back end, we should take care of adding that code in to server in the specific library and also take good care with the values you are inserting in to database table.
its great to see your article in internet
The article looking interesting , can you provide step by step in detail like when we go for custom library.
please explain in detail like what is file extension for function library file and Location in Repository PATH (how to set this,is it local dependant or server)
Happy to know that you found my article interesting, regarding your queries.
When we create lot of test automation assets, we would navigate through different screens of the application under test , but some times some of the functionalities are common for different test scenarios, so in those instead of having separate automation code for each of the test scenario, it would be good to have some common methods written and stored in a custom library, so that they could be used in different scenarios. This avoids duplication of work, attaining re usability and tomorrow if any changes needed, if we modify in one library it would reflect in all the places where ever it is been used.
Some of the places where re usable functions or custom library makes sense are as below:
There are many more places where we can come up with re usable functions with respect to Oracle EBS Automation testing.
Regarding the extension, this is same as any Openscript Script but in addition you will see one “lib” folder where the classes are defined based on the class name and package name specified when creating the function library. The reason for these additional files is that, earlier we used to have a cumbersome way of calling functions from any script but now we can call with user friendly way i.e. like eBSLIB.navigate(‘url’); where eBSLIB is the alias name of the function library and navigate is the method written in this library and url is the parameter to be passed.
These classes, will allow to make those user friendly code to call any re usable methods of function or custom library.