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.  Redirect user to other page

    Posted Fri April 01, 2011 04:58 PM

    Hi,

    I have an action where I call a webservice and depending on the web service’s output I decide to redirect the user to one of two pages.
    I’ve tried the following but I’m getting an error:

    getFacesContext().getExternalContext().dispatch(“/secondPage”);

    java.lang.IllegalStateException: Must be a RenderRequest
    at com.webMethods.caf.faces.portlet.PortletFacesContext$PortletExternalContext.dispatch(PortletFacesContext.java:178)

    What am I doing wrong?

    Thanks
    Bruno


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


  • 2.  RE: Redirect user to other page

    Posted Fri April 01, 2011 09:51 PM

    I think you’ll want to use the gotoPage() API from the BasePortletPageBean class. (See http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite8-2_fcs/My_webMethods_and_Task_Engine/8-2_CAF_and_MWS_Java_API_Reference/index.html for CAF/MWS JavaDocs)

    The javadocs mention that this API must be invoked from an ActionRequest.

    Please let me know if this resolves the issue.

    Regards,
    –mark


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


  • 3.  RE: Redirect user to other page

    Posted Mon April 04, 2011 11:33 AM

    Hi,

    I’ve tried that but it failed with the error below.
    It seems this only works if the the “page” is really another view, which is not the case.

    java.lang.RuntimeException: [POP.016.0006] View source is not found: /NTT.view
    at com.webMethods.caf.faces.view.xml.XMLViewHandler.getInputSource(XMLViewHandler.java:83)
    at com.webMethods.caf.faces.view.xml.XMLViewHandler.createBuilder(XMLViewHandler.java:40)
    at com.webMethods.caf.faces.view.BaseViewHandler.createView(BaseViewHandler.java:86)
    at com.webMethods.caf.faces.bean.BasePortletPageBean.gotoPage(BasePortletPageBean.java:100)

    Thanks
    Bruno


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


  • 4.  RE: Redirect user to other page

    Posted Mon April 04, 2011 07:25 PM

    Ok, i made an assumption and i should’ve clarified first. Are you trying to redirect the user to a different Portal Page, a different view in the same web application, a different portlet, or something else?

    Thanks,
    –mark


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


  • 5.  RE: Redirect user to other page

    Posted Mon April 04, 2011 07:38 PM

    Hi,

    I’m trying to redirect the user into another Portal page, belonging to a different web application.

    Cheers,
    Bruno


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


  • 6.  RE: Redirect user to other page

    Posted Mon April 04, 2011 09:50 PM

    Here’s a good topic on Portlet URLs (http://tech.forums.softwareag.com/viewtopic.php?t=23645&highlight=portlet+url&sid=0e8e128ea29ac03f1be89419cf6d6e7b) which you’ll want to use to generate the URL.

    The API to invoke is FacesContext.getExternalContext().redirect(). (See Oracle Java Technologies | Oracle for javadocs)

    Additionally, this method (redirect) can’t be invoked from an async command method. It must be invoked from a normal (sync) command.

    Regards,
    –mark


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