Question Krishnaveni Kapu · Sep 21, 2024

fileName in an FTP out

Hi All ,

I would like to add session ID to the fileName in an FTP out pass thru business operation.
How can I do that ?

<Setting Target="Host" Name="Filename">SessionID_%f_%Q.txt</Setting>

Comments

Enrico Parisi · Sep 22, 2024

Can you provide more details?

It seems you are using an FTP Outbound adapter, but EnsLib.FTP.OutboundAdapter does not have a property/setting called "Filename".

General answer would be: set the Filename property in you Business Operation code, there you can set it to whatever value you need.

0
Jeffrey Drumm · Sep 22, 2024

While the EnsLib.FTP.OutboundAdapter class has no Filename property, the FTP Operation classes do. The problem is you can't obtain the Session Id in the ISC-supplied operation classes, but you can insert it in the message Source property (or OriginalFilename property of Ens.StreamContainer) via a DTL or other Business Process. That value is what the %f token uses to provide the filename in those Operations.

The mechanism to obtain the Session Id differs by the process used; In a DTL, the macro $$$JobSessionId should work. In a BPL, ..%PrimaryRequestHeader.SessionId should provide the same.

If you're building your own Operation class and are, for example, subclassing EnsLib.FTP.PassthroughOperation, you can override OnMessage() and prepend $$$JobSessionId to the filename variable passed to ..Adapter.PutStream().

0