IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Share session object between portlets of different CAF packages

  • 1.  Share session object between portlets of different CAF packages

    Posted Wed July 20, 2016 12:40 AM

    Hi Guys,

    I have a custom java object. Once user logs into application I need to keep it in browser’s HTTP session. That session scoped object should then be shared/accessible between portlets of two different CAF packages.

    Can you please advise which API to be used to implement the above use case?

    Environment details -
    webMethods 9.8, Two MWS servers clustered in active passive mode.


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 2.  RE: Share session object between portlets of different CAF packages

    Posted Mon July 25, 2016 11:03 AM

    Hi Raja,

    How big is the data you want to carry across session ?
    If its not huge, go for cookies.

    Below link should guide you with the session implementation you are looking for

    http://techcommunity.softwareag.com/web/guest/pwiki/-/wiki/Main/Managing+Session+State+Between+Views+in+a+Web+Application

    Thanks
    Abdul Bari Khan


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 3.  RE: Share session object between portlets of different CAF packages

    Posted Mon July 25, 2016 03:29 PM

    @Raja

    Are both portlet types involved here within the same CAF application?

    If both portlet types are within the same webapp (aka servlet context) then the portlet specification supplies a mechanism to access the per-portlet-application (APPLICATION_SCOPE) session-attribute map by casting the ExternalContext’s session property to a PortletSession (see [url]http://portals.apache.org/pluto/portlet-1.0-apidocs/javax/portlet/PortletSession.html[/url]). All objects stored in the session using the APPLICATION_SCOPE must be available to all the portlets, servlets and JSPs that belongs to the same portlet application and that handles a request identified as being a part of the same session. Objects stored in the session using the PORTLET_SCOPE must be available to the portlet during requests for the same portlet window that the objects where stored from.

    For example:

    PortletSession portletSession = (PortletSession)getFacesContext().getExternalContext().getSession(true);
    Object myAttribute = portletSession.getAttribute("myAttribute", PortletSession.APPLICATION_SCOPE); 

    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 4.  RE: Share session object between portlets of different CAF packages

    Posted Wed August 03, 2016 11:35 PM

    Hi Eric,

    The portlets are from two different CAF applications.


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS