cancel
Showing results for 
Search instead for 
Did you mean: 

using a variable in communication channel

Former Member
0 Kudos

Hi,

I have a lot of Communication Channels looking for files in the same directory. This directory's path will be changed soon and so I assume I'll have to change all my Communication Channels.

I was wondering whether there was a means of using a variable for the Source Directory in order to just have to change its value where it is defined and not every where it is used...

Regards

Yann

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

In the sender file comm chan config, under the "File Access Parameters" section, there is an option "Advanced Selection for Source File". By selecting this option, you can enter additional source file directory/names.

Enter your new directory and file in this section. The original directory you had will be ignored if it does not exist.

Regards,

Bill

henrique_pinto
Active Contributor
0 Kudos

I've used links in Unix (Solaris).

It works ok.

Henrique.

stefan_grube
Active Contributor
0 Kudos

In a Windows system I have already tested with system variables. That works well. But you have to change the environment variables in the server directly.

For Unix you should test if system variables can be used as well.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

Just to precise things :

- in the "Source Directory", you directly put MY_WINDOW_VARIABLE

- on your windows server, you create a MY_WINDOW_VARIABLE environment variable pointing to the aimed directory

Is that the right way?

regards

Yann

stefan_grube
Active Contributor
0 Kudos

For windows you have to use a delimiter, I am not sure which, maybe %.

So you can say:

Source directory: %MY_FOLDER%\subfolder

MY_FOLDER has to be defined on the server, where XI (or the adapter engine) runs.

When XI runs on Unix, it might be different.

Regards

Stefan

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Is this a sender file adapter? or a receiver file adapter?

You can make a change / make the receiver file adapter's directory dynamic by setting the value during runtime in the mapping.

Use this blog and the code in the blog to acheive this,

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

Sender File adapter, I dont think this is possible.

Regards,

Bhavesh

Former Member
0 Kudos

Unfortunately, it is a sender file adapter...

We thought about using a symbolic link on the Unix server where the directory is, and if XI can't do it, maybe it is a good solution.

Cheers.

Yann

bhavesh_kantilal
Active Contributor
0 Kudos

hmm.. dats unfortunate..

AM not an UNIX guy at all, and so didnt get the solution you suggested .

><i>We thought about using a symbolic link on the Unix server where the directory is</i>

Can you explain what this implies?

Regrads,

Bhavesh

Former Member
0 Kudos

You create a link (with the ln command) that appears as a directory in the fileSystem. When you make actions on it, these actions are actually redirected to the true directory the link points to.

So when you want to change the directory name or path, you just have to make the change in the link aim, not to all the stuff that use the link.

The only drawback I see is that it means configuration outside XI.