1 Reply Latest reply on Dec 29, 2008 11:05 AM by c0upal

    JBPM taskInstance variable is null when navigating to another page.

    c0upal

      I have a JBPM application. I have homepage that lists Students waiting for approval to be enrolled. 


      homepage is like this:


      <h:dataTable value="#{taskInstanceListForType['StudApprove']}" var="task"...>
      <h:column>
        <s:link value="#{task.variables['studentname']"} link="tempStudentEntry.xhtml" taskInstane="{task}" />
      </h:column>
      </h:dataTable>
      




      now the tempStudentEntry.xhtml is like this



      <h:form>
      <h:inputText value="#{taskInstance.taskInstance.variable['studAddress']}"
      ...
      ...
      
      <h:commandButton value="Approve" ... />
      <h:commandButton value="Deny" ... />
      </h:form>
      



      Now, when the tempStudentEntry.xhtml, there is no value in the inputText that I assigned to one of the variables of the taskInstance.  I assumed the value of the taskInstance variable is the one i previously selected/clicked from the homepage.xhtml.  But it seems i am wrong with my assumptions.


      I can always resort to having an EntityBean for the jbpmtaskInstance table but i think i am not utilizing what is built-in with seam.


      any ideas?


      regards,


      Anton



        • 1. Re: JBPM taskInstance variable is null when navigating to another page.
          c0upal

          Apparently, a task needs to be started(begin) first before accessing its variables. Why? Explanations please? :D


          What I did was on the s:link tag on homepage, i had the action property equals to a method on a bean with a @BeginTask annotation.


          and then also on the tempStudentEntry, I changed the value from
          "taskInstance.taskInstance.variables['studAddress']"
          to just taskInstance.variables, the code-suggest function of Eclipse, is offering a different taskInstance class.


          Could someone please explain why does a task need to be started before accessing its variables or properties?


          thanks and best regards,


          Anton