Adding and using a static data file from within a Tibco BusinessWorks project
Facts - Tibco
Monday, 17 November 2014 13:18

This note has been tested with Businessworks 5.8.

BusinessWorks can use static resources such as files. For instance it can read a file from disk. In that case that file, containing the static data, has to be present and its location has to be known in BusinessWorks. This can be achieved by manually copying the file to a directory specified by a global variable in BusinessWorks. The disadavantage of this approach is that the file usually has to be copied for each environment, Dev, Test, Acc and Prod, which can be easily forgotten.

To overcome this disadvantage there is a way to include static data inside the BusinessWorks project itself. That data shouldn't change often since when included inside the BusinessWorks project changing it implies a redeployment of the ear-file.

To include a file within your project go to the Enterprise Archive Resource in the BW project. Then choose Shared Archive, go to the tab Resources and add a file from within the BW project there.

To use such a local file within a BW process refer to it in the XPATH mappings as in the example XPATH expression below:

tib:render-xml(document("tibcr://Resources/XML/mystatic.xml"))

So in this example the file mystatic.xml should be inside directory Resources/XML within your BW project.