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.  Understanding the Initialize Method

    Posted Sat April 04, 2009 04:14 PM


  • 2.  RE: Understanding the Initialize Method

    Posted Mon April 06, 2009 08:06 PM

    Initialize method is invoked every time page bean is created. When you switch between custom inbox and task details because it stays within a scope of the same web application (both custom inbox and task details portlets are defined in the same app) you task details page bean never expires and thus leading to case you have described.

    We already have an SR opened on this issue because it is a common problem, but we don’t offer a solution just yet.

    The way to workaround this on your side would be to test “taskID” preference and invoke web service if it changed in beforeRenderResponse() method. You can use the same place to refresh any internal providers which also might be cached and cause old data to show up in the ui:

    String taskID = “”;

    protected void beforeRenderResponse() {
    super.beforeRenderResponse();
    String newTaskID = (String) resolveExpression(“#{activePreferencesBean.taskID}”);
    if (!taskID.equals(newTaskID)) {
    // call web service
    }
    }


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


  • 3.  RE: Understanding the Initialize Method

    Posted Tue April 07, 2009 03:06 PM

    You can use the other methods:

    public void beforeRestoreView()
    public void afterRestoreView()
    public void beforeRenderResponse()
    public void beforeApplyRequestValues()
    public void afterApplyRequestValues()
    public void beforeProcessValidations()
    public void afterProcessValidations()
    public void beforeUpdateModelValues()
    public void afterUpdateModelValues()
    public void beforeInvokeApplication()
    public void afterInvokeApplication()

    They are executed in the following order:

    *** Executing BEFORE RESTORE VIEW
    *** Executing AFTER RESTORE VIEW
    *** Executing BEFORE APPLY REQUEST VALUES
    *** Executing AFTER APPLY REQUEST VALUES
    *** Executing BEFORE PROCESS VALIDATIONS
    *** Executing AFTER PROCESS VALIDATIONS
    *** Executing BEFORE UPDATE MODEL VALUES
    *** Executing AFTER UPDATE MODEL VALUES
    *** Executing BEFORE INVOKE APPLICATION
    *** Executing AFTER INVOKE APPLICATION

    Edgardo


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


  • 4.  RE: Understanding the Initialize Method

    Posted Tue April 07, 2009 10:37 PM

    Hi,

    I tried the following in my class DefinicionesInicialesViewDefaultviewView which extends BaseTaskDetailsPageBean.

    protected void beforeRenderResponse()
    {
    //execute original beforeRenderResponse
    super.beforeRenderResponse();

      //get new task Id 
    String newTaskID = (String) resolveExpression("# {activePreferencesBean.taskID}"); 
    
    //check if we are in a new task
    if (!this.definicionesInicialesViewDefaultviewView.definicionesIniciales.getTaskID().equals(newTaskID)) 
    { 
    
    //instantiate web service object
    FljBuscaDefinInicialInfo objSvc = getFljBuscaDefinInicialInfo();
    
    //set input parameters
    objSvc.getParameters().setP_NUM_SINI (this.definicionesInicialesViewDefaultviewView.definicionesIniciales.getTaskData().getClaimsDocument().getExpediente_Doc().getExpediente_doc().getNum_sini());
    
    objSvc.getParameters().setP_NRO_EXPED(this.definicionesInicialesViewDefaultviewView.definicionesIniciales.getTaskData().getClaimsDocument().getExpediente_Doc().getExpediente_doc().getNro_exped());
    
    //execute web service
    objSvc.refresh();
    
    //set values to business data  
    this.definicionesInicialesViewDefaultviewView.definicionesIniciales.getTaskData().getClaimsDocument().getExpediente_Doc().getExpediente_doc().setNegligencia(objSvc.getResult().getNEGLIGENCIA());
    this.definicionesInicialesViewDefaultviewView.definicionesIniciales.getTaskData().getClaimsDocument().getExpediente_Doc().getExpediente_doc().setMto_danos_prop(java.lang.Double.parseDouble(objSvc.getResult().getMTO_DANOS_PROP()));
    }
    

    }

    But I’m getting the following error:

    [POP.001.0002] A “javax.portlet.PortletException” occurred with the Message “com.webMethods.portal.bizPolicy.BizException: [POP.001.0002] A “javax.portlet.PortletException” occurred with the Message “at com.webMethods.caf.faces.portlet.FacesPortlet.render(FacesPortlet.java:460)””

    java.lang.NullPointerException
    at com.webMethods.caf.definicionesinicialesview.DefinicionesInicialesViewDefaultviewView.beforeRenderResponse(DefinicionesInicialesViewDefaultviewView.java:78)
    at com.webMethods.caf.faces.bean.BaseViewBean.beforePhase(BaseViewBean.java:85)
    at com.webMethods.caf.faces.bean.FacesBeanPhaseListener.beforePhase(FacesBeanPhaseListener.java:30)
    at com.webMethods.caf.faces.portlet.PortletLifecycle.phase(PortletLifecycle.java:241)


    I’m executing correctly the web service?

    Thanks


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


  • 5.  RE: Understanding the Initialize Method

    Posted Wed April 08, 2009 02:32 AM

    use this.definicionesIniciales.getTaskData()…

    instead of

    this.definicionesInicialesViewDefaultviewView.definicionesIniciales…

    and that solve it

    Thanks


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