Connect back into existing Terminal Connection after exception is thrown

I am using Terminal Activities(Version 2.2.0) to automate AS 400 application.

When a particular transaction faces a business exception, terminal connection is lost for the next transaction item. Is there any possible solution to solve this and retain the existing connection even though a business exception is thrown in RE framework?

2 Likes

Hey @Janet_Caroline1

You need to keep the Terminal session variable as ‘Global’ in the Main file.

Hope that helps.

Thanks
#nK


Hi Nithin… I have kept the scope of this variable in general business to make it available for all the states. Do i need to do anything additional to this?

2 Likes

Yes, this looks perfect.

But please tell me one thing from which workflow this variable getting its value for the first time.

Thanks
#nK

This value would be coming out from Init state. Value is passed as out argument in init and then assigned to variable which will be sent as in argument for process state. transaction works perfectly until it faces business exception.

1 Like

Hey @Janet_Caroline1

Now there shouldn’t be issue.

Kindly check and let me know.

Thanks
#nK

I have tested more than 10 times and still facing issue. thats y i posted here :slight_smile:

1 Like

there was a post already for the same issue.

Solution was given but i cant figure it out how it can be used.

Can u help me out from this above screenshot?

1 Like

Hey @Janet_Caroline1

So the terminal connection object becoming null in that case ?

Thanks
#nK

Yes… The value becomes null for the 2nd transaction when 1st transaction has a business exception

1 Like

Hey @Janet_Caroline1

Just try this as below,

  1. Create one more global variable as backup_TerminalConnection

  2. Now at the starting point of the process block, just do one more assign

backup_TerminalConnection = new TerminalConnection(Original_TerminalConnection.ConnectionString)
  1. Now pass the backup_TermConn as in argument to process block.

Also change your current variable name to a bit diff name as I can see you are using the object type itself as name which may also cause some issues

Now try the same scenario, Hope this helps.

Thanks
#nK

ok… sure let me try

1 Like

Hi Nithin…

TerminalConnection { Connected=true, ConnectionString=“{‘AttachExisting’:false,‘ConnectionProtocol’:0,‘ConnectionType’:2,‘EhllBasicMode’:false,‘EhllDll’:‘C:\Program Files (x86)\IBM\Client Access\Emulator\pcshll32.dll’,‘EhllEnhanced’:true,‘EhllFunction’:‘hllapi’,‘EhllSession’:‘A’,‘EnableSSL’:false,‘Host’:null,‘InProcessMode’:false,‘Mode’:1,‘Port’:23,‘Profile’:null,‘ProviderType’:4,‘ShowTerminal’:true,‘TerminalType’:0}” }

the above is the valid connection string. but the connection is showing as False when i do the assign to new variable. please check the below result i get after the assign.

TerminalConnection { Connected=false, ConnectionString=“{‘AttachExisting’:false,‘ConnectionProtocol’:0,‘ConnectionType’:2,‘EhllBasicMode’:false,‘EhllDll’:‘C:\Program Files (x86)\IBM\Client Access\Emulator\pcshll32.dll’,‘EhllEnhanced’:true,‘EhllFunction’:‘hllapi’,‘EhllSession’:‘A’,‘EnableSSL’:false,‘Host’:null,‘InProcessMode’:false,‘Mode’:1,‘Port’:23,‘Profile’:null,‘ProviderType’:4,‘ShowTerminal’:true,‘TerminalType’:0}” }

1 Like

Hi Nithin… I am still facing this issue…

1 Like

Hey @Janet_Caroline1

You need to deep copy the object & store it in a backup variable.

Thanks
#nK