Close session of choice in unified service desk

238 Views Asked by At

We have multiple sessions i-e four sessions opened in USD. I need to close without clicking on 'X' on the session. Can it be possible to have 4 buttons on the toolbar and by clicking the third button will close the third session in USD?

1

There are 1 best solutions below

0
On

This should be possible provided that Microsoft's documentation is valid. Even if it is possible, it would be crude, limited, and difficult to implement/maintain without writing custom code. I highly recommend a "close current session" button that simply closes the foreground session. Through configuration however, here's how you could theoretically do what you're asking.

Create a Close button for each session, considering your max number of sessions, let's say 4. On start of a new session, a series of actions fires in an attempt to locate a Close button upon which to attach the session close command, based on logic like this:

Does Global Context variable Session1ID have data?
If not, place the new session ID in Session1ID.

Does Global Context variable Session2ID have data?  
Is the new session ID already stored in Session1ID?  
If not, place the new session ID in Session2ID.

Does Global Context variable Session3ID have data?
Is the new session ID already stored in Session1ID or Session2ID?
If not, place the new session ID in Session3ID.

Does Global Context variable Session4ID have data?
Is the new session ID already stored in Session1ID, Session2ID, or Session3ID?
If not, place the new session ID in Session4ID.

The buttons themselves could be made visible or enabled based on whether their Session ID is in Global Context.

On click of any of these buttons, let's say #3, the following would occur:

Close Session command using Session3ID
Nullify value of Session3ID, making it available for the next attempt to attach a session ID.

I foresee a few problems with this. You may encounter issues reading from and writing to Global Context variables while inside of a session. Furthermore, you may encounter issues with closing background sessions by their ID.

Further still, closing sessions out-of-sequence would cause new sessions to attach to buttons in a disorderly-looking fashion, creating a bad user experience. Let's say you need to start six sessions (A, B, C, D, E, and F). You have to close the two sessions in the middle (B and C) before starting the last two due to your limit of 4. With A on button 1 and D on button 4, you start sessions E and F which attach to buttons 2 and 3. Now your four buttons correspond to sessions A, E, F, and D, while the session tabs themselves are in the order that you opened them: A, D, E, F. This would be a bad user experience. (I don't believe that you can manipulate the order in which buttons appear using replacement parameters. Button Order is likely to be configuration integers only.)

Hopefully, this clarifies the elegance of a simpler solution: Create a "Close Current Session" button that is only enabled or visible while you have a session.