Connecting to existing Terminal session: Attachmate reflection

Hi Experts,
I have a situation where when the bot is triggered for the first time it needs to login into a terminal(TN3270) and process the transaction. For remaining transactions it should use the existing terminal session , this is to ensure we do not spend too much time logging in, for each transaction.

My idea was to store the connection string in the OutputConnection variable(terminal session activity) and bounce it around so that my workflow latches to the same terminal each time. However i noticed the OutputConnection variable does not capture any value. I have defined it correctly.I am using attachmate reflections as the provider. I read in uipath documentation that attach to existing session is only available while using IBM EEHL standards
Section: 2.1.3
How can i achieve this when using attachmate reflection, Would love to here your thoughts .

Hi @Sshankar
sorry for a late response.

What you will want to do is create a Library package so you can share terminal tasks between all your projects. The package will include a Signon xaml, a Close xaml, and a xaml for each application you interact with in your terminal environment.

The Signon xaml should check if the session argument is nothing. If it is nothing, then call the Close xaml (which exits screens to prevent locking things up), then prep any profile configurations / keymapping needed for the applications in your terminal environment.

At the end it should return the session back as an IN/OUT argument. This allows you to call this at the start of each xaml so it can Login if necessary and return the session connection.

If the session argument is not nothing, then it just navigates back to the main menu.

My experience is with EhllSession, where the session connection can be outputting. I am not sure how you would do this without being able to output the session connection. This is because, you must perform the terminal actions inside a Terminal Session, otherwise, you need to use keystrokes, which I don’t recommend except for some things. For example, we do F1-F12 and Enter Command as Send Hotkey cause our terminal emulator is not fully compatible.


Hey Clayton, thanks for the detailed response! I just wanted to confirm – do you know if only the EhllSession will output a TerminalConnection value? I am trying to create a Library Package like you mentioned with Reflection for UNIX; however, the OutputConnection is always ‘null’, as such I cannot connect to an existing instance of the terminal. Any insights you have would be helpful!

I have used ‘Reflection for IBM’ a while back and it worked for me. You did place the variable in the Terminal Session activity?

It might be helpful if you posted images of your code or something. And what you have tried to identify that the variable is null. Also, check the “ContinueOnError”, because sometimes by default it’s “True” so any errors will be ignored.

Hi Clayton, thanks for getting back to me so soon. But yeah, I tested it with a variable and argument (out_tc_TerminalSessionConnection), and even while I am performing actions in the terminal window, the OutputConnection is null. As such, when I pass it to another Terminal Session activity it will error out because no connection is established. The “ContinueOnError” was set to False. Below are some screenshots of the code.

Just wanted to pick your brain incase you did anything different than just passing the Terminal Connection variable.

Hi, Thanks for providing some images.
In the first image that shows the variable as null, I see the yellow box is in an outside scope from the Terminal session activity. It will get set to something after the yellow is inside the Terminal session activity or after it. Can you provide some screenshots of your code after the Terminal session where it is null?

Also, if you have it set as an OUT argument, the connection variable will get reset to null again at the start of that workflow.


Hi @Sshankar,

Did you find any workaround for that?