-
1. Re: Acess Task variables and show them with task list
gavin.king Dec 12, 2006 2:34 PM (in response to sxj)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 Dec 12, 2006 2:56 PM (in response to 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 Dec 12, 2006 11:36 PM (in response to sxj)#{task.variables['orderId']}
-
4. Re: Acess Task variables and show them with task list
sxj Dec 13, 2006 3:37 PM (in response to 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 Dec 13, 2006 3:50 PM (in response to sxj)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.