Mantaining the string value from task to task
vanz Sep 18, 2010 9:51 AMI've got a process with three tasks and I'm not able to associate to it an ID string.
Inside the file todoDoc.java I defined it in the field description
but its value is not mantained and disappears when I switch from the first task to the following one.
I want that the value, that I input at the beginning of the process, will be mantained till the end of it.
Since I have different processes I want the value of the ID string to be different for every process.
Right now when I switch from the first task to the second one when I display the string the result is alwasy #{todoDoc.description}.
Where am I mistaking?
documentoList.xhtml
<ui:define name="body"> <rich:panel> <f:facet name="header">Crea nuovo task</f:facet> <h:form id="description"> <div>Description:<h:inputText id="description" value="#{todoDoc.description}" style="width: 400" /> <h:commandButton value="Ciclo 3 step (RVA)" action="#{todoDoc.createTodo}" /> <h:commandButton value="Ciclo 2 step (RA)" action="#{todoDoc2.createTodo2}" /> </div> </h:form> </rich:panel> <br /> <br /> <rich:panel> <f:facet name="header">Lista dei task propri</f:facet> <div id="list"><h:form id="list"> <div><h:outputText value="Nessun task presente." rendered="#{empty taskInstancePriorityList}" /> <h:dataTable value="#{taskInstancePriorityList}" var="task" rendered="#{not empty taskInstancePriorityList}"> <h:column> <f:facet name="header"> <h:outputText value="Description task" /> </f:facet> <h:inputText value="#{task.description}" style="width: 400" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Fase" /> </f:facet> <h:inputText value="#{task.name}" style="width: 400" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Created" /> </f:facet> <h:outputText value="#{task.taskMgmtInstance.processInstance.start}"> <s:convertDateTime type="date" /> </h:outputText> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Priority" /> </f:facet> <h:inputText value="#{task.priority}" style=" width : 99px;" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Due Date" /> </f:facet> <h:inputText value="#{task.dueDate}" style="width: 100"> <s:convertDateTime type="date" dateStyle="short" /> </h:inputText> </h:column> <h:column> <s:button action="#{todoDoc.conferma}" taskInstance="#{task}" value="Documento Accettato" /> </h:column> <h:column> <s:button action="#{todoDoc.rifiuta}" taskInstance="#{task}" value="Documento Rifiutato" /> </h:column> </h:dataTable></div> <div><h:commandButton value="Update Items" rendered="#{not empty taskInstanceList}" /></div> </h:form></div> </rich:panel> <br /> <br /> <rich:panel> <f:facet name="header">Lista dei task divisi per gruppo</f:facet> <div id="list"><h:form id="list2"> <div><h:outputText value="Nessun task presente." rendered="#{empty pooledTaskInstanceList}" /> <h:dataTable value="#{pooledTaskInstanceList}" var="task" rendered="#{not empty pooledTaskInstanceList}"> <h:column> <f:facet name="header"> <h:outputText value="Description task" /> </f:facet> <h:inputText value="#{task.description}" style="width: 400" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Fase" /> </f:facet> <h:inputText value="#{task.name}" style="width: 400" /> </h:column> <h:column> <s:button action="#{pooledTask.assignToCurrentActor}" value="Assegna" taskInstance="#{task}" /> </h:column> </h:dataTable></div> </h:form></div> </rich:panel> </ui:define> </ui:composition>
todoDoc.java
package org.domain.docmanager.session; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.bpm.CreateProcess; import org.jboss.seam.annotations.bpm.EndTask; import org.jboss.seam.annotations.bpm.StartTask; @Name("todoDoc") public class TodoDoc { private String description; public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @CreateProcess(definition="todo") public void createTodo() { } @StartTask @EndTask public void conferma() {} @StartTask @EndTask(transition="rifiuta") public void rifiuta() { } }
todo.jpdl.xml
<process-definition name="todo" xmlns="urn:jbpm.org:jpdl-3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/xsd/jpdl-3.2.xsd"> <start-state name="start"> <transition to="Redazione"> </transition> </start-state> <task-node name="Redazione"> <task name="redazione" description="#{todoDoc.description}"> <assignment actor-id="#{actor.id}" /> </task> <transition to="Verifica"></transition> </task-node> <task-node name="Verifica"> <task name="verifica" description="#{todoDoc.description}"> <assignment pooled-actors="verificatore"/> </task> <transition to="Approvazione"></transition> <transition to="Redazione" name="rifiuta"></transition> </task-node> <task-node name="Approvazione"> <task name="approvazione" description="#{todoDoc.description}"> <assignment pooled-actors="approvatore"/> </task> <transition to="done"></transition> <transition to="Redazione" name="rifiuta"></transition> </task-node> <end-state name="done" /> </process-definition>