webMethods

webMethods

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

Locale rule with resource-specific condition not working

  • 1.  Locale rule with resource-specific condition not working

    Posted Tue January 27, 2015 07:19 AM

    I have a working locale rule with a condition based on the user’s role:

    "foo" matches user.roleMembershipDNs

    When I add another condition based on the resource, the rule stops working:

    ("foo" matches user.roleMembershipDNs) && (portalResource isDescendant ("/portlet/myportletapplication___myportlet"))

    I would expect the rule to fire when accessing the portlet, but it doesn’t.

    Any idea why this happens? Help is much appreciated. :slight_smile:


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


  • 2.  RE: Locale rule with resource-specific condition not working

    Posted Tue January 27, 2015 01:38 PM

    The isDescendant operator works a little different that you may think. It is intended to work with folders. It is not recommended to navigate to the /portlet/myportletapplication___myportlet instance of your portlet directly. Normally you would create a folder, put a instance of that portlet in that folder, then use isDescendant on the alias of that folder (or one of it’s parent folders).


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


  • 3.  RE: Locale rule with resource-specific condition not working

    Posted Wed January 28, 2015 03:38 AM

    Thank you very much for your answer, Ron.

    Following your instructions, I created a folder “foo” under Public Folders and gave it the alias “bar”. I then added my portlet to it and changed the locale rule to say:

    ("foo" matches user.roleMembershipDNs) && (portalResource isDescendant ("bar"))

    Unfortunately, when I access the portlet instance inside the folder ([url]http://localhost:8585/meta/default/myportletapplication___myportlet/0000013230[/url]) it still has the wrong locale.

    Changing the rule back to only checking the role makes it work just fine. I tried some more and stumbled upon something quite interesting: If I use a condition that checks for a specific string in the request URL with “matches”, the rule works when I use the URL before login (being first redirected to the login page), but not when I access the login page first and then go to my URL.

    So it seems to me the rule is run only once after login (but before regarding the portal resource). The solution via the request URL is an acceptable workaround for me.

    I can offer a sample deployment package if anyone is interested …


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