The TIBCO Platform is a real-time, composable data platform that will bring together an evolving set of your TIBCO solutions - and it's available now!
A chart showing the TIBCO Platform vision
Jump to content
Forums
Ask questions and gain insight from discussions

How to refer the path of a file Stored in a folder e.g the file is stored in BEProject/SharedResources/StaticData folder. It is accessed from TIbcoBEProject/RuleFunctions/Admin/XXRulefunction


Recommended Posts

Posted
The file is read from a rule function. The file is stored inside one of the folders in tibcoBE project.I can not give the complete path as after the deployment there is no fixed name for one of the folders as it keeps changing whenever the instance is created. So decided to store in one of the tibco BE project folders (similar to schema file). But having problem in accessing it. Tried by referring ./SharedResources/StaticData. But the file is not picked up. Can someone help in this.
  • 9 months later...
Posted

Set the working directory to the location of the project. Now you can create a custom function that returns the current working directory and read the file from here.

eg:

String sPath=GetCurrPath.getCurrPath();

String sContent = File.readFileAsString(sPath+"/SharedResources/testInput.txt");

System.debugOut("### File contents is: " + sContent);

Attached a sample project.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...