avPrivateConnect and avConnectFiles

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
dhnaigles
Posts: 56
Joined: Wed Feb 03, 2016 1:34 am
Location: Marlborough, MA, USA

avPrivateConnect and avConnectFiles

Post by dhnaigles »

Are avConnectFiles and avDisconnectFiles invoked if you are using avPrivateConnect?
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: avPrivateConnect and avConnectFiles

Post by MarkD »

It depends what you do in your custom avPrivateConnect method.

If you make your own low level BIF calls like CONNECT_SERVER, etc, then the answer is no. You would have to call it yourself.

However - if you iterate through the collection of VF_FP007 (VLF server definitions), select one and use the #VF_FP007Instance.uConnect method then the answer is yes.
dhnaigles
Posts: 56
Joined: Wed Feb 03, 2016 1:34 am
Location: Marlborough, MA, USA

Re: avPrivateConnect and avConnectFiles

Post by dhnaigles »

Mark,
The #VF_FP007Instance.uConnect method??? Is there a sample of IIP code that shows how it is used. We are using iAM from Chronologique for our change management and the tool "forces" a restart of the VLF when core elements (XML definition files, the IIP, etc) of the VLF are included in the update package. I have built functionality to not only restart the VLF, but to remember the User ID, password (encrypted) and server that were used in the initial signon and to use avPrivateConnect to alleviate the user from having to put his password in again. I was using the BIFs for this, but it sounds like the method is much more integrated into VLF.

If I use the method, I would gather I still need to do a #VF_FP007Instance.uDisconnect. Will these methods, then, use the avConnectFiles and avDisconnectFiles methods?

If you have a sample of code, I would be most appreciative.
dhnaigles
Posts: 56
Joined: Wed Feb 03, 2016 1:34 am
Location: Marlborough, MA, USA

Re: avPrivateConnect and avConnectFiles

Post by dhnaigles »

Never mind, Mark. I figured it out. If anyone is interested in restarting VLF and not having to log in again, attached are the pieces to change in the IIP.
Attachments
restart VLF code.rtf
(4.12 KiB) Downloaded 874 times
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: avPrivateConnect and avConnectFiles

Post by MarkD »

I think it uDisconnect will get called for you, but there’s no harm in calling it more than once.

Also, VL issues a warning and automatically closes down any super-server sessions that you leave open at shutdown.

This is the code to iterate the defined server list:

Code: Select all

* Use VL's F2 feature help to see all properties exposed by this server object 
Define_Com Class(#VF_FP007) Name(#Server) Reference(*dynamic)

* Get the first server
Invoke Method(#uSystem.uServerContainer.uFirstServer) Userverref(#Server) Ucursor(#vf_elnum) Ureturncode(#vf_elretc)
Dowhile Cond(#vf_elretc = ok)

* The VF_FP007 server object has a set of properties that define the server. 
* These properties are READ ONLY in this context and must never be updated. 
* For example ..

Use message_box_add ('Caption' #Server.uCaption)
Use message_box_add ('Type'    #Server.uServerType)
Use message_box_add ('LU Name' #Server.uServerLUName)
Use Message_box_show (ok ok info)

* Get the next server 
Invoke Method(#uSystem.uServerContainer.uNextServer) Userverref(#Server) Ucursor(#vf_elnum) Ureturncode(#vf_elretc)
Endwhile

Post Reply