Yes this can be done, and its not difficult, however the part I hesitate is where the credentials are presented. I have not done this or even know if it is possible.
So the simplest example is if there is a FTP node/virtual directory/share called X. The FTP Fileset configuration will specify the server/IP address of your FTP site. It will also specify the userid and password. In the simplest scenario, none of these change. Your three destinations are sub folders – A, B & C, all under the parent folder X. The tcl code examines the message content or message header, possibly performs some logic and determines that the message should go to X/B, for example. The TCL code has logic like this:
set driverctl [msgmetaget $mh DRIVERCTL]
keylset driverctl FILESET.OBFILE “$filename”
msgmetaset $mh DRIVERCTL “$driverctl”
It is up to you to set $filename. It will look like “X/B/filename”.
As you think about it, you will realize, at least for Windows, you probably have one “corporate FTP site” and under the root level are all the folders you probably have to get to, as long as your credentials are granted access to the particular folders. So even if the FTP Fileset configuration specifies a certain folder and subfolder, you can change that in TCL code in real time.
But UNIX is different – if you have some flavor of UNIX, each UNIX server will have its own FTP server, and you will have to use different credentials for each UNIX server. If the three output threads you have in your diagram have a mix of Windows and UNIX, you will need different credentials for one server vs. another. I don’t know a way to change credentials in real time using TCL code. If one of the copies of your file goes to Windows and another copy goes to UNIX, you will need at least two output threads.
If you want to send the same file to three target threads, use TCL code in the source thread to create two more copies:
set driverctl [msgmetaget $mh DRIVERCTL]
keylset driverctl FILESET.OBFILE “$filename1”
msgmetaset $mh DRIVERCTL “$driverctl”
lappend dispList “CONTINUE $mh”
set newmh2 [msgcopy $mh]
keylset driverctl FILESET.OBFILE “$filename2”
msgmetaset $newmh2 DRIVERCTL “$driverctl”
lappend dispList “CONTINUE $newmh2”
set newmh3 [msgcopy $mh]
keylset driverctl FILESET.OBFILE “$filename3”
msgmetaset $newmh3 DRIVERCTL “$driverctl”
lappend dispList “CONTINUE $newmh3”
return $dispList