Introducing the all-new TIBCO Community site!

For current users, please click "Sign In" to reset your password and access the enhanced features. If you're a first-time visitor, we extend a warm welcome—click "Sign Up" to become a part of the TIBCO Community!

If you're seeking alternative community sites, explore ibi, Jaspersoft, and Spotfire.

Jump to content

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

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.
Link to comment
Share on other sites

  • 9 months later...

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.

Link to comment
Share on other sites

×
×
  • Create New...