Get Logged in MWS User Model in AngularJS based TASK Portlet

Hi,

We have a BPM Process with Human tasks designed in CAF. To retrieve logged-in User details we were using USER-Model available in the CAF palette. User are from Active Directory with SSO using Kerberos all of which configured in MWS.

Now we are in process of converting the CAF portlets to openCAF, and using AngularJS Angular-Route at client side. Now when we try reading the User-Model it always return sysadmin irrespective of the logged-in user.

How can we retrieve MWS logged in user details in our AngularJS Portlet?

Thanks,

Rohit Joshi

It sounds like your angular requests may not be getting routed through the MWS servlet context. If the address of those requests causes them to be dispatched to some other servlet context then it may not know the identity of the user as has not passed through the MWS dispatcher that would have associated the user context with the current request.

You may want to review the address of the http requests that your custom code is making.

Thanks Eric,

Yes we are using AngularJS Route to switch between pages. We have defined a Shell Page containing all the required Tabs and the respective Tab pages gets injected in “ng-view” using Angular Route. Tasks pages are injected in similar fashion. Is there a way we can use MWS dispatcher given the routing is via Angular Route?

Thanks,

Rohit Joshi

Well, I’m not an angularjs expert so I can’t provide you with any specific recommendations.

You should be able to inspect the http traffic going back and forth to the browser via the debugging tools built into all the modern browsers to see what the addresses of the requests were.

If the addresses it is loading are something like http://host:port/wm_your_app_name/page_name.xhtml then that suggests that those requests would be dispatched directly to the servlet context of the “wm_your_app_name” web application and would bypass MWS completely.

In general, a request from a portlet should use a “portlet url” style address to ensure that your portlet doesn’t interfere with any other portlets on the same page. For example, see the addresses returned from the createRenderUrl() or createActionUrl() methods of a CAF page bean for the basic address that could then be further customized to suit your needs.

If there is not a compelling reason to use angularjs, you can just use OpenCAF directly instead as it should be able to do pretty much everything angularjs can do.

Hi Rohit,

Have you tried using Business Console Gadgets? They have been built to support AngularJS as of now. If you are on 9.10 and above go to the Appspaces section in Business Console. http://localhost:8585/business.console. The Gadget dev guide is @ http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite9-12/Business_Console/9-12_Developing_Gadgets_for_webMethods_Business_Console.pdf