4 Replies Latest reply on Mar 6, 2008 8:22 AM by Kamlesh Shah

    jbpm variables not saved

    apdo Newbie

      As an exercise, from the todo example, I have create a form page where variable can be set. the description is save in the database by clicking on the update button. however, the process variable "summary" and task variable "variable1" are not saved. I have modify the todo process description to add the variable1 in the default controler.

      Do you have an idea why the variables are not saved?

      I have try to have an idea how it is working by downloading and tracing into the seam code. Saving only using the commandButton button is real magic. Is there design document available?

      This is basic stuff but I am really unable to make it work. I am using jboss 4.2.2 GA and jboss 2.0.0 GA.

      Phong

      Here is my form page todoform.xhtml that follow:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">

      Todo List


      <f:view>
      <h:form id="list">
      id: <h:outputText value="#{taskInstance.id}"></h:outputText>

      name: <h:outputText value="#{taskInstance.name}"></h:outputText>

      description:<h:inputText value="#{taskInstance.description}" style="width: 400"/>

      summary:<h:inputText value="#{processInstance.contextInstance.variables['summary']}" style="width: 400"/>



      comments:<h:inputText value="#{taskInstance.variables['variable1']}" style="width: 400"/>

      <h:commandButton value="Update Items" action="update"/>
      <s:button action="#{todoList.done}" taskInstance="#{taskInstance}" value="Done"/>
      </h:form>
      </f:view>

        • 1. Re: jbpm variables not saved
          apdo Newbie

          I continue my experimentation and here is my obervations.

          using the following method to display the form I am able to set variable values. the form is open with these value however only the description is saved when submiting the form. I think it is more a seam issue or probably misunderstanding. I will probably post something related to this in the seam forum. I think we can consider this discussion close in the context of jbpm.

          thanks,

          @StartTask
          public String displayForm() {
          org.jboss.seam.bpm.BusinessProcess process = org.jboss.seam.bpm.BusinessProcess.instance();
          org.jbpm.graph.exe.ProcessInstance pinstance = org.jboss.seam.bpm.ProcessInstance.instance();
          org.jboss.seam.bpm.TaskInstance.instance().setVariable("variable1", "my comments");
          pinstance.getContextInstance().createVariable("summary", "sum value");
          System.out.println("APD displayForm called");
          return "/todoform.xhtml";
          }

          • 2. Re: jbpm variables not saved
            Kamlesh Shah Newbie

            Hi....

            I was facing same problem of not saving 'Name' and 'Mapped Name' in jBPM..

            During n...n number of tries, it saved for one instance of 'Name', but I could not figure it out - HOW.

            Now I have solution ... !!!

            After you type new name or a mapped name, press instead of any thing else.

            enjoy jBPM...

            Regards

            Kamlesh Shah
            pitcom@vsnl.com

            • 3. Re: jbpm variables not saved
              Kamlesh Shah Newbie

              Kamlesh again.....


              oh..!!! I typed < e n t e r > but got vaniced.....


              Please read my previous post with correction as ....

              press enter instead of anything else

              Regards

              Kamlesh Shah
              pitcom@vsnl.com

              • 4. Re: jbpm variables not saved
                Kamlesh Shah Newbie

                Press 'enter' as terminator for value you type in. It will be saved...

                Good luck!!!!

                Regards

                Kamlesh Shah