[jboss-user] [JBoss Seam] - Re: Seam jBPM: use annotation or pages.xml to get next task?

avbentem do-not-reply at jboss.com
Thu Mar 22 05:09:52 EDT 2007


Actually, I think one day I also might want to start a task as soon as one assigns it to oneself, and show the appropriate page right away. In the DVD Store example the following is used:
<h:dataTable value="#{pooledTaskInstanceList}" var="task">
  |     :
  |     <s:button action="#{pooledTask.assignToCurrentActor}"
  |         taskInstance="#{task}" value="Assign"/>
  |     :
  | </h:dataTable>

After clicking the button above, the new assigned task is listed in #{taskInstanceListForType['approve']}, and can then be started. But how to start the task right away, so as soon as the task is assigned to oneself?

I could rewrite this to:

<s:button action="#{taskSelector.assignToCurrentActor}"
  |         taskInstance="#{task}" value="Assign"/>

using
@Name("taskSelector")
  | public class TaskSelector {
  |     @In TaskInstance taskInstance;
  |     @In Actor actor;
  |     :
  |     public String assignToCurrentActor(){
  |         taskInstance.setActorId(actor.getId());
  | 
  |         // Or maybe one should use the following?
  |         // jbpmContext.getTaskMgmtSession().loadTaskInstance(taskId)
  |         //      .assign(actor.getId());	
  | 
  |         return taskInstance.getName();
  |     }
  |     :

This allows me to go to a task-specific page right away, but at that point the task has not been started yet. So this needs something more...

Thanks for any thoughts,
Arjan.



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

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



More information about the jboss-user mailing list