5 Replies Latest reply on Dec 13, 2006 3:50 PM by gavin.king

    Acess Task variables and show them with task list

    sxj

      Hi,
      I have a workflow whic takes in the value for 2 variables in first step. I want to show these variables and values along with task list on the home page from next task. I have tried getting the taskFromparameters but am not able to get it to show it. Please suggest what I can do.
      Thanks
      sxj

        • 1. Re: Acess Task variables and show them with task list
          gavin.king

          An example in the DVD demo:



          <h:dataTable value="#{pooledTaskInstanceList}"
           var="task"
           styleClass="dvdtable"
           headerClass="dvdtablehead"
           rowClasses="dvdtableodd,dvdtableeven"
           columnClasses="dvdtablecol">
           <h:column>
           <f:facet name="header">Order Id</f:facet>
           #{task.variables['orderId']}
           </h:column>
           <h:column>
           <f:facet name="header">Task</f:facet>
           <h:outputText value="#{task.description}" />
           </h:column>
           <h:column>
           <f:facet name="header">Order Amount</f:facet>
           <h:outputText value="#{task.variables['amount']}">
           <f:convertNumber type="currency" currencySymbol="$" />
           </h:outputText>
           </h:column>
           <h:column>
           <f:facet name="header">Customer</f:facet>
           <h:outputText value="#{task.variables['customer']}" />
           </h:column>
           <h:column>
           <s:button action="#{pooledTask.assignToCurrentActor}" taskInstance="#{task}"
           value="Assign"/>
           </h:column>
           </h:dataTable>
          


          • 2. Re: Acess Task variables and show them with task list
            sxj

            Thanks for the reply.
            I'm not sure how to get the list of the variables. I tried to get the variables from taskInstance but I got an error abt value not found. Please suggest

            Thanks

            • 3. Re: Acess Task variables and show them with task list
              gavin.king

               

              #{task.variables['orderId']}


              • 4. Re: Acess Task variables and show them with task list
                sxj

                Thanks for the reply. It works now.

                Is there a variable that I can set at process level to be associated witha process instance? Is that different from task variables ? I'm not sure if this is correct forum to ask this query . Any help will be appreciated.Thanks

                • 5. Re: Acess Task variables and show them with task list
                  gavin.king

                  There are various kinds of variable scopes in jBPM, and Seam does not take advantage of all of them.

                  When a task is created, it gets a "copy" of all the process variables. When you write to a variable inside the scope of a task, it remains scoped to the task until the task ends, a which point it gets copied back to the process variable of the same name.