1 Reply Latest reply on Dec 4, 2006 12:20 AM by Joseph Nusairat

    Seam + jBPM cant get it to work

    Joseph Nusairat Newbie

      Ok i have lookd at this for a while and maybe i am just not getting it. thought i was .... but i cant seem to get the tasks to show up.

      I have this business process definition -

      <?xml version="1.0"?>
      
      <process-definition name="TicketingSystem">
      
       <start-state name="start">
       <transition to="waiting"/>
       </start-state>
      
       <task-node name="waiting" end-tasks="true">
       <task name="task-assignment" description="Tasks waiting for assignment">
       <assignment pooled-actors="ticket-user"/>
       </task>
      
       <transition name="cancel" to="cancelled"/>
       </task-node>
      
       <task-node name="working" end-tasks="true">
       <task name="task-working" description="Tasks are rassigned to be workable">
       <assignment actor-id="user"/>
       </task>
      
       <transition name="done" to="finished"/>
       <transition name="done" to="finished"/>
       <transition name="cancel" to="cancelled"/>
       </task-node>
      
       <end-state name="finished"/>
       <end-state name="cancelled"/>
      </process-definition>
      
      


      I have this code creating my process
      
       @Out(scope=ScopeType.BUSINESS_PROCESS, required=false)
       long ticketId;
       @Out(scope=ScopeType.BUSINESS_PROCESS, required=false)
       String owner;
      
       @CreateProcess(definition="TicketingSystem")
       public String createTicket() {
       log.info("TicketSystem - create - #{ticket}");
       log.info("Using actor - #{actor} ");
      
       // ticket is not complete cause we just started it.
       ticket.setTicketComplete(false);
      
       em.persist(ticket);
      
       // save the fields
       ticketId = ticket.getTicketId();
       owner = ticket.getOwner();
      
       return "/ticket_list.xhtml";
       }
      


      So i login .... set an actor id to "user" ... then submit the ticket.


      and i have the xhtml ...

      <h1>Tasks</h1>
       <h2>Task Assignment</h2>
       <c:choose>
       <c:when test="#{empty pooledTaskInstanceList}">
       <p>There are no pooled tasks to be assigned.</p>
       </c:when>
       <c:otherwise>
       <h:dataTable value="#{pooledTaskInstanceList}"
       var="task"
       styleClass="dvdtable"
       headerClass="dvdtablehead"
       rowClasses="dvdtableodd,dvdtableeven"
       columnClasses="dvdtablecol">
       <h:column>
       <f:facet name="header">Ticket Id</f:facet>
       #{task.variables['ticketId']}
       </h:column>
       <h:column>
       <f:facet name="header">Name</f:facet>
       <h:outputText value="#{task.name}" />
       </h:column>
       <h:column>
       <f:facet name="header">Owner</f:facet>
       #{task.variables['owner']}
       </h:column>
       <h:column>
       <s:link action="#{pooledTask.assignToCurrentActor}" taskInstance="#{task}"
       value="Assign" linkStyle="button"/>
       </h:column>
       </h:dataTable>
       </c:otherwise>
       </c:choose>
      
       <h2>Task Assignment</h2>
       <c:choose>
       <c:when test="#{empty pooledTaskInstanceList}">
       <p>There are no pooled tasks to be assigned.</p>
       </c:when>
       <c:otherwise>
       <h:dataTable value="#{taskInstanceList}"
       var="task"
       styleClass="dvdtable"
       headerClass="dvdtablehead"
       rowClasses="dvdtableodd,dvdtableeven"
       columnClasses="dvdtablecol">
       <h:column>
       <f:facet name="header">Ticket Id</f:facet>
       #{task.variables['ticketId']}
       </h:column>
       <h:column>
       <f:facet name="header">Name</f:facet>
       <h:outputText value="#{task.name}" />
       </h:column>
       <h:column>
       <f:facet name="header">Owner</f:facet>
       #{task.variables['owner']}
       </h:column>
       <h:column>
       <s:link action="#{pooledTask.assignToCurrentActor}" taskInstance="#{task}"
       value="Assign" linkStyle="button"/>
       </h:column>
       </h:dataTable>
       </c:otherwise>
       </c:choose>
      
       <h2>Order Acceptance</h2>
       <c:choose>
       <c:when test="#{empty taskInstanceListForType['approve']}">
       <p>There are no orders to be accepted.</p>
       </c:when>
       <c:otherwise>
       <h:dataTable value="#{taskInstanceListForType['approve']}"
       var="task"
       styleClass="dvdtable"
       headerClass="dvdtablehead"
       rowClasses="dvdtableodd,dvdtableeven"
       columnClasses="dvdtablecol">
       <h:column>
       <f:facet name="header">Ticket Id</f:facet>
       #{task.variables['ticketId']}
       </h:column>
       <h:column>
       <f:facet name="header">Name</f:facet>
       <h:outputText value="#{task.name}" />
       </h:column>
       <h:column>
       <f:facet name="header">Owner</f:facet>
       <h:outputText value="#{task.owner}" />
       </h:column>
       <h:column>
       <s:link action="#{accept.viewTask}" taskInstance="#{task}"
       value="Review" linkStyle="button"/>
       </h:column>
       </h:dataTable>
       </c:otherwise>
       </c:choose>
      
      
      </body>
      


      Now shouldnt something show up there???