"[EMAIL PROTECTED]" wrote : 
  | No. Follow the example apps and the reference documentation. Don't try and 
invent new ways of doing things until you really understand how the standard 
way works.

What are standart ways? TODO sample app? But what if I need to assign task firs 
and than start it? Well, actually, I sloved that problem, but I dont like my 
suggestion. First of all I made 2 tables
1)
<h:dataTable value="#{pooledTaskInstanceList}"
    var="task" 
    styleClass="dvdtable" 
    headerClass="dvdtablehead"
    rowClasses="dvdtableodd,dvdtableeven"
    columnClasses="dvdtablecol">
..........................................
    <h:column>
             <s:link action="#{pooledTask.assignToCurrentActor}"    
taskInstance="#{task}"      value="Pick task" linkStyle="button"/>
      </h:column>
..........................................
</h:dataTable>
2)
<h:dataTable value="#{taskInstanceList}"
        var="task" 
        styleClass="dvdtable" 
        headerClass="dvdtablehead"
        rowClasses="dvdtableodd,dvdtableeven"
        columnClasses="dvdtablecol">
................................................
        <h:column>
                <s:link action="#{taskManager.startTask}" 
taskInstance="#{task}"        value="Start task" linkStyle="button"/>
        </h:column>
        <h:column>
                <s:link action="#{taskManager.endTask}" taskInstance="#{task}"  
value="end task" linkStyle="button"/>
        </h:column>
..................................................
</h:dataTable>

then I modified TaskManagerImpl

@Name("taskManager")
public class TaskManagerImpl {

        @Logger
        Log log;
        
        public String getTest() {
                return "test";
        }
        
        public void startTask() {
                
                String taskId = (String) 
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("taskId");
                System.out.println("taskId is " + taskId);
            TaskInstance taskInstance = (TaskInstance) 
ManagedJbpmContext.instance().getTaskMgmtSession().loadTaskInstance( 
Long.parseLong(taskId) );
            taskInstance.start();
                
        }

        public void endTask() {
                
                String taskId = (String) 
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("taskId");
                System.out.println("taskId is " + taskId);
            TaskInstance taskInstance = (TaskInstance) 
ManagedJbpmContext.instance().getTaskMgmtSession().loadTaskInstance( 
Long.parseLong(taskId) );
            taskInstance.end();

        }

}

It works now, but it looks ugly/ Are there any other ways?


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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974148
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to