English 中文(简体)
TIBCO - BusinessWorks - Get path of the process dynamically
原标题:

I am developing a process that will read and send an image in an e-mail. This image is a folder within this process.

The problem is: how do I get the path where the process is running?

Something like a Server.MapPath that returns the image path in the File System.

Thanks in advance.

最佳回答

If your images exist in a folder in your BW-project you can use the Retrieve Resource activity to get to the content.

You just have to set the resourcePath with the relative Path in your project and it will output the base64 data.

问题回答

SOAP RetrieveResources could be a good solution, but throws a NullPointerException for me on BW 5.4. Maybe it is a bug in this version.
The problem regarding getting a root path is that a deployed BW project does not keep its original folder/file structure - the deployer will not explode the EAR file. Therefore you won t find the image as a separate file on the BW server box.
There is a simple way to dynamically load XML files, by using the following XPath statement:

tib:render-xml(document( tibcr://path/to/file.xml ))

but it will obviously fail on binary files. My best guess for storing binary data inside a BW project would be to store it as a string constant in Base64 or Hex format.

In case someone comes across this question (as I did today), here s a way to get the absolute path of a file within the application. The following code can be used in a "Java Code" activity, for instance, being relativePath and absolutePath the input and output parameters, respectively:

absolutePath = com.tibco.pe.core.Engine.getRepoAgent().getAbsoluteURIFromProjectRelativeURI(relativePath);




相关问题
JMS error: can not send into foreign destinations

I use Spring-configured jms template with tibco jms library. I get jms connection factory and topic with JNDI and these objects are not null. But when I try to send message or add listener I get this ...

与春天混杂草

现在,我有一部 j瓦法,开始使用ti子,采取若干步骤:

Tibco Unit Testing tools [closed]

Does anyone know what unit testing tools are available when developing Tibco processes? In the next few months I ll be working on a Tibco project and I m trying to find any existing unit testing ...

Messaging pattern question

Process A is calculating values for objects a1, a2, a3 etc. and is sending results to the middleware queue (RabbitMQ). Consumers read the queue and process these results further. Periodically process ...

Tibco Businesswork, format timestamp in long to mm/dd/yyyy

I m trying to publish a XML message using the tibco adb adapter which monitors a table. There is a column in the table that stores a date as a long value in milliseconds- Is there a way we can ...

TIBCO - BusinessWorks - Get path of the process dynamically

I am developing a process that will read and send an image in an e-mail. This image is a folder within this process. The problem is: how do I get the path where the process is running? Something ...

热门标签