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
  • 1.  Portlet Finish URL

    Posted Wed June 27, 2012 05:19 PM

    Hi,
    I’m sending one url to the portlet using finishUrl parameter. When I tried to use the redirect to the url that I send in finishURL parameter, I saw that the &wmp_rt=render is removed from my URL, this and all the parameters that I sent after the taskId.

    Example:
    URL sent in finishUrl parameter by my application:
    http://localhost:8585/meta/default/wm_xt_fabricfolder/0000068242?wmp_tc=68243&wmp_rt=render

    URL received in portlet, using finishUrl parameter:
    http://localhost:8585/118A315A-109C-479A-118C-724B9DD8C744.task.app.details.page?wmp68512.requestID=0.10169666576726621&wmp68512.currentTab=TaskData&wmp68512.taskID=69727

    Can you help me on this?

    Regards,


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


  • 2.  RE: Portlet Finish URL

    Posted Thu June 28, 2012 04:41 AM

    Hi Jose,

    Can you please provide more details about how you build your Porttlet URL.

    Ex:

        IPortletURL finishURL = createActionUrl();
    finishURL.clearParameters();
    finishURL.clearState();
    // call action when navigation
    finishURL.setTargetAction("#{activePageBean.refresh}");
    finishURL.setBaseURL(...);
    finishURL.setPortlet(...);
    finishURL.setParameter(...);
    finishURL.setParameter(...);

    br,
    Vlad


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


  • 3.  RE: Portlet Finish URL

    Posted Thu June 28, 2012 07:35 AM

    Hi Vlad,
    This is the code that I’m using to generate the portlet URL:
    com.webMethods.caf.portlet.IPortletURL portletURL = createRenderUrl();

    	portletURL.clearParameters();
    String aux= ((HttpServletRequest)this.getFacesContext().getCurrentInstance().getExternalContext().getRequest()).getServerName();
    int aux2=((HttpServletRequest)this.getFacesContext().getCurrentInstance().getExternalContext().getRequest()).getServerPort();
    
    portletURL.clearState();
    
    
    portletURL.setParameter("showUnderAdmin", showUnderAdminInput);
    
    return portletURL.toString();
    

    If I print the portletURL content, I’m able to see “&wmp_rt=render” and “showUnderAdmin” parameter. Also, I can see both parameters in the browser when I do the redirect. My problem is that when I try to get the URL in the portlet side, both parameters (“&wmp_rt=render” and “showUnderAdmin”) are missing from the URL.

    Regards,


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


  • 4.  RE: Portlet Finish URL

    Posted Thu June 28, 2012 10:20 AM

    Hi Jose,

    I have not seen in any of your two URLs posted in the first comment the “showUnderAdmin” parameter.

    Just to be clear about the steps you have done:

    1. you have created the finishURL instance
      protected IPortletURL createFinishURL() throws Exception {
    IPortletURL finishURL = createActionUrl();
    finishURL.clearParameters();
    finishURL.clearState();
    // call action when navigation
    finishURL.setTargetAction("#{activePageBean.refresh}");
    finishURL.setBaseURL(...);
    finishURL.setPortlet(...);
    finishURL.setParameter(...);
    finishURL.setParameter(...);
    
    return finishURL;
    }
    1. you have created a PortletURL instance on which you perform the actual redirect:
    IPortletURL portletURL = createRenderUrl();
    portletURL.clearParameters();
    portletURL.clearState();
    portletURL.setBaseURL(...);
    portletURL.setPortlet(...);
    
    portletURL.setParameter("cancelUrl", createCancelURL().toString());
    //see finishURL initialization above
    portletURL.setParameter("finishUrl", createFinishURL().toString());
    portletURL.setParameter("currentTab", "TaskData");
    
    getFacesContext().getExternalContext().redirect(portletURL.toString());

    As you can see the finishUrl is sent as an actual parameter.

    Also, please not that the “showUnderAdmin” parameter must be defined as a Portlet Preference on the target portlet.

    br,
    Vlad


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


  • 5.  RE: Portlet Finish URL

    Posted Thu June 28, 2012 11:28 AM

    Hi Vlad,
    My problem, is not the url construction, but why the “&wmp_rt=render” and all the parameters after taskId are being removed from the url.
    For clarification, this are all the steps that I’m doing:

    1.Building the url inside a portlet, this url has the finishUrl parameter, that looks like this:
    http://localhost:8585/meta/default/wm_xt_fabricfol...242?wmp_tc=68243&wmp_rt=render&showUnderAdmin=true

    2.Doing the redirect to the previous url - This url represents one task;

    3.Inside the task, get the finishUrl parameter, that was sent in the URL built in 1, if the user chooses to “complete” or “return” task. When I get the URL, this is what I’m getting:
    http://localhost:8585/118A315A-109C-479A-118C-724B...TaskData&wmp68512.taskID=69727

    All this steps are working fine, my problem is in step 3,when I get the url sent in finishUrl parameter, all the parameters after the taskid are missing.

    Regards,


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


  • 6.  RE: Portlet Finish URL

    Posted Fri June 29, 2012 05:53 AM

    Hi Jose,

    I have tried to add all kind of parameters and it worked fine for me.

    If you provide more details (code) about how you build the finishURL and redirectURL then maybe someone on the forum will spot the problem.

    PS:
    I can see that you do not set the BaseURL and Portlet parameters. Also, the host and port (http://localhost:8585) should not be present in the finish URL, the relative URL is enough.

    br,
    Vlad


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


  • 7.  RE: Portlet Finish URL

    Posted Wed July 11, 2012 08:39 AM

    Hi Vlad,
    Sorry for take so long to answer.
    My problem was that I wasn’t using the setTargetAction method when building my url. Thanks to your example I was able to fix it.

    Regards,


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