[jboss-user] [JBoss Seam] - SEAM and JBPM

heitmanm do-not-reply at jboss.com
Mon Nov 27 13:18:40 EST 2006


I have got a problem with jbpm-integration into seam. My application is very close to the dvd-seam sample. It was no problem to create the process but when I try to execute a task of my process-definition I get the message "Task null not found" on my xhtml-page.

Perhaps someone have any idea that can be helpful for me?

I will list some codepieces here for better understanding....

I have assigned a task to a user...

                     <h:dataTable value="#{pooledTaskInstanceList}"
  |                                  var="task"
  |                                  styleClass="dvdtable"
  |                                  headerClass="dvdtablehead"
  |                                  rowClasses="dvdtableodd,dvdtableeven"
  |                                  columnClasses="dvdtablecol">
  |                         <h:column>
  |                          
  |                         </h:column>
  |                         <h:column>
  |                             <f:facet name="header">Task</f:facet>
  |                             <h:outputText value="#{task.description}" />
  |                         </h:column>
  |                       
  |                         <h:column>
  |                             <s:link
  | action="#{pooledTask.assignToCurrentActor}" taskInstance="#{task}"
  |                                 value="Assign"/>
  |                         </h:column>
  |                     </h:dataTable>
  | 
  | 
  | now you should accept the task on an other xhtml.

<h:dataTable value="#{taskInstanceListForType['approve']}"
  |                                  var="task"
  |                                  styleClass="dvdtable"
  |                                  headerClass="dvdtablehead"
  |                                  rowClasses="dvdtableodd,dvdtableeven"
  |                                  columnClasses="dvdtablecol">
  |                         <h:column>
  |                             <f:facet name="header">credit Id</f:facet>
  |                             #{task.variables['creditId']}
  |                         </h:column>
  |                        
  |                            
  |                         <h:column>
  |                             <s:link action="#{accept.viewTask}" 
  | taskInstance="#{task}"
  |                                     value="Review"/>
  |                         </h:column>
  |                     </h:dataTable>
  |       

Here the content of the accept-page.....
                <h:form>
  |                     <h:commandButton action="#{accept.reject}" 
  | value="Reject credit" />
  |                     <h:commandButton action="#{accept.accept}" 
  | value="Accept Credit" />
  |                 </h:form>
  | ....

Using the commandButton lets the message "Task null not found" appear.

Accept-Class

  @Stateful
  | @Name("accept")
  | public class AcceptAction
  |     implements Accept,
  |                Serializable
  | {
  |     @In(value="currentUser")
  |     Admin admin;
  | 
  |     @PersistenceContext(type=PersistenceContextType.EXTENDED)
  |     EntityManager em;
  | 
  |     @Out(scope=ScopeType.CONVERSATION)
  |     Credit credit;
  |     
  |     @In
  |     Long creditId;
  | 
  |     @BeginTask
  |     public String viewTask() {
  |         .....
  |         return "accept";
  |     }
  | 
  |     @EndTask(transition="approve")
  |     public String accept() {
  |        .....
  |         return "admin";
  |     }
  | 
  |     @EndTask(transition="reject")
  |     public String reject() {
  |        ....
  |         return "admin";
  |     }
  | 
  |     @Destroy
  |     @Remove
  |     public void destroy() {}
  | }

Processdefinitions.

<?xml version="1.0"?>
  | 
  | <process-definition name="OrderManagement">
  | 
  |     <start-state name="start">
  |         <transition to="decide"/>
  |     </start-state>
  |    
  |     <decision name="decide" expression="#{orderApproval.howLargeIsOrder}">
  |         <transition name="large order" to="approval"/>
  |         <transition name="small order" to="process"/>
  |     </decision>
  | 
  |     <task-node name="approval" end-tasks="true">
  |         <task name="approve" description="Review order">
  |            <assignment pooled-actors="reviewers"/>
  |         </task>
  |         <transition name="cancel"  to="cancelled"/>
  |         <transition name="approve" to="process"/>
  |         <transition name="reject"  to="cancelled"/>
  |     </task-node>
  |    
  |     <task-node name="process">
  |         <task name="ship" description="Ship order">
  |            <assignment pooled-actors="#{shipperAssignment.pooledActors}" />
  |         </task>
  |         <transition name="shipped" to="complete">
  |             <action expression="#{afterShipping.log}"/>
  |         </transition>
  |     </task-node>
  |    
  |     <end-state name="complete"/>
  |     <end-state name="cancelled"/>
  |    
  | </process-definition>

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

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



More information about the jboss-user mailing list