5 Replies Latest reply on May 28, 2007 10:49 AM by naseem.k

    Task form cancel button not working

    naseem.k

      Hi,

      I am using jbpm 3.2 GA. I got an exeception when I clicked cancel button of a task form.

      Task form save button and transition buttons are working perfectly fine only cancel button is not working.

      Here is the stacktrace...

      javax.el.ELException: /main/task/view.xhtml @204,71 disabled="#{! processBean.hasProcessImage}": java.lang.NullPointerException
      at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
      at org.jbpm.webapp.tag.jbpm.ui.Tab.isDisabled(Tab.java:31)
      at org.jbpm.webapp.tag.jbpm.ui.TabSet.encodeBegin(TabSet.java:120)

      ...............

      Caused by: java.lang.NullPointerException
      at org.jbpm.webapp.bean.ProcessBean.getHasProcessImage(ProcessBean.java:104)
      at sun.reflect.GeneratedMethodAccessor220.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)

      ....



      Taskform buttons are as below...

      <!-- TASKFORM BUTTONS -->
       <tf:saveButton value="Save"/>
       <tf:cancelButton value="Cancel"/>
       <tf:transitionButton transition="Shipping" value="Shipping"/>
      



      It seems like problem is with rendering of process image when cancel button is clicked.

      I checked its tld as well, I did not get any tag handler class or tei class for this cancel tag.

      Functionalities in the Cancel button and SaveButton final clases are same as both extend the same abstract class AbstractTaskFormButton.

      Is anyone else faced this problem earlier.

      Thanks


        • 1. Re: Task form cancel button not working
          naseem.k

          Class TaskForm.java.

          If condition defined in the try block checks formButton an instance of CancelButton? If condition is true, then outcome is set to "cancel".

          public void processAction(ActionEvent actionEvent) throws AbortProcessingException {
          
          .....
          
           try {
           if (formButton instanceof CancelButton) {
          
           //formButton.setDisabled(true);
           log.debug("Cancel button was pressed");
           outcome = "cancel";
           if (creationLogsVar != null) {
           requestMap.put(creationLogsVar, Collections.EMPTY_LIST);
           }
           commit = true;
           return;
           }
           }
          
          ...
          }
          


          In the view.xhtml by <jbpm:outcome custom tag, there is a redirect. Task instance id query parameter is not submitted due to this redirect after a user click the cancel button. Therefore the custom tag which is responsible for rendering the process image tag throws NullPointerException.

          <jbpm:outcome outcome="cancel" type="redirect"/>


          Url of Task Instance View page before cancel button is clicked: http://localhost/main/task/view.html?tiid=11863

          Url of Task Instance View page after cancel button is clicked: http://localhost/main/task/view.html

          I managed to solve the NullpointerException problem by changing the type to "stay".

          Still I don't know what is the purpose of cancel task form button?

          Is this cancel button for stopping a process which you started?

          • 2. Re: Task form cancel button not working
            kukeltje

             


            Is this cancel button for stopping a process which you started?


            No, it is for saying: "I'm not going to work on this task now, put it back in my tasklist"

            • 3. Re: Task form cancel button not working
              naseem.k

               

              "kukeltje" wrote:

              No, it is for saying: "I'm not going to work on this task now, put it back in my tasklist"


              So it means if I write following code in the view.xhtml, this will work.

              <jbpm:outcome outcome="cancel" type="view" target="/search/tasks.xhtml"/>
              


              One more thing I want to know, if a user fills a task form and then she decides to click the cancel button, will jbpm store user entered values in database or not?

              Thanks


              • 4. Re: Task form cancel button not working
                kukeltje

                1: no idea, not used that before
                2: No, NOT going to work on it.... working on it but not finishing it is 'save'

                • 5. Re: Task form cancel button not working
                  naseem.k

                  Thanks Ronald for making things clear.

                  It seems like its a bug in the current jbpm-console web application which I am having. I don't know how many others get NullPointerException after clicking the cancel task form button.