[jboss-user] [JBoss Seam] - problem with seam and jbpm

kgoedert do-not-reply at jboss.com
Mon Jun 25 08:53:26 EDT 2007


Hi,

I´m new to seam and jbpm and trying to work out my first example.
My problem is that it seems data is not being bound to the process.

Here is my code:

In this page I create a request


       
         Nova Requisição
       
         
           
             Pedido:
             <h:inputText value="#{request.content}"/>
           
           
             Hospedagem:
             <h:selectOneRadio value="#{request.hasOvernight}">
             	<f:selectItems value="#{request.overnight}"/>
             </h:selectOneRadio>
           
         

         
            <h:commandButton type="submit" value="Nova Requisição" action="#{requestSystem.newRequest}"/>
         

That is represented by this object:

@Name("request")
@Intercept(InterceptionType.NEVER)
@Scope(ScopeType.BUSINESS_PROCESS)
public class Request implements Serializable {
	private static final long serialVersionUID = 1643984518635043124L;
	private String content;
	private int hasOvernight;
	private static int YES = 1;
	private static int NO = 0;
	private static SelectItem[] overnight = new SelectItem[]{
		new SelectItem(new Integer(YES), "Sim"),
		new SelectItem(new Integer(NO), "Não")
	};
	
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public int getHasOvernight() {
		return hasOvernight;
	}
	public void setHasOvernight(int hasOvernight) {
		this.hasOvernight = hasOvernight;
	}
	public SelectItem[] getOvernight() {
		return overnight;
	}
	
	public String whereToGo() {
		return hasOvernight == 1 ? "yes" : "no";
	}

The object that creates the process is this one:

@Stateless
@Name("requestSystem")
public class RequestSystemAction implements RequestSystem {
	@In
	@Out(scope = ScopeType.BUSINESS_PROCESS, required = false)
	Request request;

	@CreateProcess(definition = "RequestProcess")
	public String newRequest() {
		System.out.println("Nova requesicao");
		return "home";
	}

	@BeginTask
	@EndTask
	public String managerApproval() {
		System.out.println("Aprovado pelo gerente");
		return "home";
	}

}

And the problem is that when in the following page, I try to retrieve the information of the Request I created, everything is set to the default values


         <h:dataTable value="#{pooledTaskInstanceList}" var="task">
           <h:column>
           	<h:outputText value="#{task.description}"/> 
           </h:column>
           <h:column>
             <h:outputText value="#{request.content}"/> 
             <h:outputText value="#{request.hasOvernight}"/> 
             
             <h:commandLink action="#{requestSystem.managerApproval}"> 
               <h:commandButton value="Aprovar"/>
               <f:param name="taskId" value="#{task.id}"/>
             </h:commandLink>
           </h:column>                 
         </h:dataTable>

         
           <h:commandLink action="home" value="Go back home"/>
         
       

Thanks for any help

Kelly

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057330#4057330

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057330




More information about the jboss-user mailing list