1 Reply Latest reply on Dec 20, 2007 7:54 AM by pmuir

    fail to persiste taskinstance variables from xhtml page

      I initially post this to the jbpm forum but I think it is more related to the jboss seam forum. In the thread of the jbpm forum I have written to consider that entries closed since I planned to create this entry in the seam forum.

      I have modified the todo example to add an xhtml form for the todo task.
      The todoform.xhtml follows.

      When I submit the form with "Done command" button, the description of the taskinstance is persisted in the database but not the variable1. The variable1 is created in the jbpm_variableinstance table but there is no value set (null).

      So what I have done is to use the @In in the todolist component and then on the todolist.done method I save the variable using

      TaskInstance.instance().setVariable("variable1", comments);

      However, I don't think it is the way to do thing with jsf-seam-jbpm integration. That is why even if I have found a workaround I am asking the question.


      Do you have an answer for that?

      Thanks

      Phong

      Here is my xhtml file that is that save de taskintance.description but not the taskInstance.variables['variable1'].


      <!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"
      xmlns:rich="http://richfaces.org/rich">

      Todo List


      <f:view>
      <h:form id="list">
      <h:messages/>

      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="#{taskInstance.variables['variable1']}" style="width: 400"/>


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