it is time to end the summer break and add again some value to the community 😉
The Customer Problem
In the meantime some customers are using the parallel data source execution (Design Studio 1.5: View on Parallel Data Source Execution) and are facing a question on how to logoff the user and release the sessions.
Of course user logoff means, it is not possible to navigate any more in the application, but for many scenarios where you want to have quick access to the data and then stay on the “static” display – the logoff is acceptable.
Technically, the application in the browser is holding the session as long one of those 2 events will occur.
* session timeout on server side (eg. BIP is 30 minutes)
* user actively ends up the browser session (eg. closing the browser)
The solution will address the second part – in quite simple way – using a timer and logging off the user when the timer gets to 0. I know this procedure from some online banking implementations. it means, the user has the information that the session gets expired in some time and gets extended when user refresh the counter or makes some navigation on the app.
We have already in the scn repository a component “TIMEOUT”, created by Martin Pankraz. The component has the ability to count down and triggers event on timeout.
I have used the component and made 2 extensions on it:
* implemented a visualization (counter eg 00:10) in seconds (must be activated in properties)
* added a function “logoff()”
– the first change is just to show the timer and inform the user that the session will end up in some time
– the second change is not dependent on the first one, so having the TIMEOUT component in the app you can use only the “timeout()” function.
How Does It Work?
The logoff is using only the “unload()” function from the browser – this function will be triggered explicitly, and this causes an event to design studio which is sending special request to the server logging off current session.
Important: if the user disconnects the network – the logoff will not work!
in addition, the ajax function which is responsible for sending more requests to the server will be overwritten to show a popup with custom text to the user. If the text is empty (you can change in properties) then the popup will be not shown. This is required to avoid any more communication from the app to the server as any try to connect the server will ed up in exception.
In short, the user can make all actions in the app – as long the action does not require server communication. One working action is fe. changing the pages of a pagebook, so for dashboarding you still have some freedom in looking at the data.
Here is the first scenario – logoff triggered by timer
behind the “Start” button, the time will be “restarted”.
The user can always trigger it explicitly.
You can also to place the code in some events (like onResultSetChanged() event) to trigger it also in other actions – if you want.
Here is the second scenario – logoff and change of pagebook.
What is the Effect?
You can see the effect in BW system, you go to SM04 and then see the sessions of your user. When logoff is executed, the session is deleted. It means, you can see it in 2 places:
* the Design Studio session in the Java stack will be closed
* the corresponding RFC connections in ABAP (SM04) are closed.
What is NOT intended to happen?
This logoff is not logging of the frontend side – BIP session or NetWeaver session. It is targetting only release of the resources on the server (APS; NW Java) and the source systems (BW, HANA, Universe). Especially BW, as there the session are statefull and occupy memory.
At the end, how does it look at the server? Of course the user will be logged off – and this is a standard procedure – the server will close the session, close all sessions on any backend systems – like BW or HANA.
I think some of you can make a use of this component and reduce the memory load on the servers. At least for many dashboard scenarios.
Help / API Specification
Go directly to the help site and find the component: Component List – SCN Design Studio Community
Download & Use
This component is available on the community package
- go to Component List – SCN Design Studio Community
- for download use the button on right upper side “Free Download”
More information on the SCN community package in blog SCN Design Studio SDK Development Community
Example as BIAPP:
feel free to add as usual…
if you have good ideas (to those who would like to contribute but cannot code…) – place an “issue” with tag “enhancement” under Issues · org-scn-design-studio-community/sdkpackage · GitHub