VLFOne - Active Menu Options

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
dhunt
Posts: 65
Joined: Fri Feb 08, 2019 3:06 am

VLFOne - Active Menu Options

Post by dhunt »

Is there a way to find out ALL active business objects regardless of what application it is under? Right now if you look at the menu options you don't know without opening each application which ones are active but if there is a limit, say 6 that can be active at a time, you don't know which application to go to, to remove some business objects. It also prevents log off if a business object is tied to logging out.
rgjohnson
Posts: 17
Joined: Thu May 26, 2016 12:42 am

Re: VLFOne - Active Menu Options

Post by rgjohnson »

I am adding more detail to this post in hopes of generating an answer as this has become one of the main complaints from users of our VLF-One application.

The attached screenshot shows one active session from our system. This is a business object names Sales Orders that contains about 30 different options. The toolbar at the top shows that I currently have two business objects open, so two RAMP sessions are active within this Customer Services application. Our system has 29 different applications defined in the menu tree with anywhere from 1 to 20 business objects defined within each application. Each business object can then have from 1-40 options similar to the options in the screenshot provided.

A power user of our system may move around 10-15 different applications over the course of a day. Users leave as many sessions open as their company allows as this allows them to move from option to option very quickly and lets them work very fast throughout the day.

The problem occurs when a user has reached the limit of sessions allowed and receives an error message stating they must close a session before they can access a new option and create another session. If they happen to be in an application that already has sessions open as in my screenshot, they can choose one of those sessions and close it. If , however, the application they are in has no open sessions, the user must open the menu tree and start opening every application in the menu tree searching for business objects that are (OPEN) so they can select one, close it, and then go back to the option they were trying to open in the first place.

Needless to say this is a very cumbersome and aggravating process for users.

We have a very workable solution to this that would allow us to present ALL active sessions to the user instead of only the ones in a specific application. This would give the user immediate access to their sessions and simplify management of this process. To make this work though, our reuseable part must be able to retrieve the list of open business objects in exactly the same manner as is used by the framework now when it displays (OPEN) business objects in the menu tree.

Is this possible? Is there any way for our reuseable part to retrieve a list of all open business objects and see the exact same business object the framework would display in the toolbar at the top of my screenshot?
Attachments
Screenshot
Screenshot
Vlf-One sessions.jpg (265.97 KiB) Viewed 50978 times
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: VLFOne - Active Menu Options

Post by MarkD »

This example command handler will enumerate all open panes.
It might give you something to start with:

Code: Select all

Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #VF_AC010O) Layoutmanager(*NULL) Width(425) Height(313)

Define_Com Class(#PRIM_MD.RaisedButton) Name(#Button) Caption('Enumerate Open Panes') Displayposition(1) Left(70) Parent(#COM_OWNER) Tabposition(1) Themedrawstyle('MediumTitle') Top(48) Width(195)


* --------------------------------------------------------------------------
Evtroutine Handling(#Button.Click)
#COM_OWNER.EnumerateOpenPanes
Endroutine

* --------------------------------------------------------------------------
Mthroutine Name(EnumerateOpenPanes)

Define_Com Class(#VF_UI004O) Name(#FrameworkTabFoldertManager) Reference(*DYNAMIC)

#FrameworkTabFoldertManager <= #USYSTEM.FrameworkTabFoldertManager

For Each(#VF_UI002OChild) In(#FrameworkTabFoldertManager.VF_UI002OChildren)
For Each(#VF_Ac005OChild) In(#VF_UI002OChild.AC005ObjectCollection)
If (#VF_Ac005OChild.NominalVF_AC009OOwner *IsNot *null)

* The pane belongs to a framework level command
If (#VF_Ac005OChild.NominalVF_AC009OOwner *Is #VF_FP001O)
#SYS_WEB.Alert Caption("Framework level pane associated with '" + #VF_Ac005OChild.NominalVF_AC009OOwner.uCaption + "' is open, but it may not be visible.")
Continue
Endif

* The pane belongs to an application level command
If (#VF_Ac005OChild.NominalVF_AC009OOwner *Is #VF_FP002O)
#SYS_WEB.Alert Caption("Application level pane associated with '" + #VF_Ac005OChild.NominalVF_AC009OOwner.uCaption + "' is open, but it may not be visible.")
Continue
Endif

* The pane belongs to a business object level command
If (#VF_Ac005OChild.NominalVF_AC009OOwner *Is #VF_FR003O)
#SYS_WEB.Alert Caption("Business object level pane associated with '" + #VF_Ac005OChild.NominalVF_AC009OOwner.uCaption + "' is open, but it may not be visible.")
Continue
Endif

Endif
Endfor
Endfor


#FrameworkTabFoldertManager <= *NULL

Endroutine
End_Com 
mwilliams
Posts: 36
Joined: Sat May 28, 2016 1:45 am

Re: VLFOne - Active Menu Options

Post by mwilliams »

I've tried using your sample code and it seems to work well. I did have a couple of questions. First, it looks like if I select a business object from the menu and then select a option from the instance list which starts a ramp session, two objects show up in the collection after I run you code. I'm assuming one is for when I selected the BO and one was when I selected an item from the instance list. Is there a way to tell the difference between the two? Second, is there a way to select one of the options from the collection of open sessions and have it display. Meaning, if I had a list of all the open business objects and I wanted to jump between them, how would I do that?
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: VLFOne - Active Menu Options

Post by MarkD »

The code counts "panes" - so often a business object would have at least 2 and sometimes 3.
e.g. A pane containing the filter and instance list and the pane containing the command handler tabs would be the most common scenario for 2 panes.

You probably could tell the difference between a filter pane and command handler pane - but I don't think that matters.

If you make a unique list of the NominalVF_AC009OOwner properties that are #VF_FR003O references then you have a unique list of the business objects with one or more open panes. These would be the ones that you would add into your selection list?
Last edited by MarkD on Mon Apr 27, 2020 3:15 pm, edited 3 times in total.
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: VLFOne - Active Menu Options

Post by MarkD »

To switch to any business object (open or not) use

#AVFRAMEWORKMANAGER.avSwitch Caller(#COM_OWNER) Toobjectnamed(XXXXXXXX)

where XXXXXXXXX is the user object name assigned to the business object.

If you have a #VF_FR003O business object reference then the user object name is in the uUserObjectType property, so you would use something like:

#AVFRAMEWORKMANAGER.avSwitch Caller(#COM_OWNER) Toobjectnamed(#MyVF_FR003OReference.uUserObjectType)
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: VLFOne - Active Menu Options

Post by MarkD »

PS: If you make a temporary collection if VF_FR003O references don't forget to clear it at the appropriate time.
Post Reply