Search in sources :

Example 11 with TaskSummary

use of org.jbpm.task.query.TaskSummary in project jBPM5-Developer-Guide by Salaboy.

the class TaskListJFrame method refreshTable.

private void refreshTable() {
    List<TaskSummary> tasks = TaskClientHelper.getInstance().getAssignedTasksByUser("salaboy");
    DefaultTableModel tableModel = new javax.swing.table.DefaultTableModel(new String[] { "Id", "Task Name" }, 0) {

        Class[] types = new Class[] { java.lang.Number.class, java.lang.String.class };

        public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
        }
    };
    int i = 0;
    for (TaskSummary task : tasks) {
        String name = task.getName();
        tableModel.addRow(new Object[] { task.getId(), name });
    }
    tasksjTable.setModel(tableModel);
}
Also used : DefaultTableModel(javax.swing.table.DefaultTableModel) TaskSummary(org.jbpm.task.query.TaskSummary)

Aggregations

TaskSummary (org.jbpm.task.query.TaskSummary)11 LocalTaskService (org.jbpm.task.service.local.LocalTaskService)7 ArrayList (java.util.ArrayList)5 Test (org.junit.Test)4 HashMap (java.util.HashMap)3 KnowledgeBase (org.drools.KnowledgeBase)3 KnowledgeBuilder (org.drools.builder.KnowledgeBuilder)3 KnowledgeBuilderError (org.drools.builder.KnowledgeBuilderError)3 ClassPathResource (org.drools.io.impl.ClassPathResource)3 ProcessInstance (org.drools.runtime.process.ProcessInstance)3 ContentData (org.jbpm.task.service.ContentData)3 Person (com.salaboy.model.Person)2 EntityManagerFactory (javax.persistence.EntityManagerFactory)2 StatefulKnowledgeSession (org.drools.runtime.StatefulKnowledgeSession)2 LocalHTWorkItemHandler (org.jbpm.process.workitem.wsht.LocalHTWorkItemHandler)2 Task (org.jbpm.task.Task)2 TaskService (org.jbpm.task.TaskService)2 DetailedTaskSummariesModel (com.salaboy.jbpm5.dev.guide.tablemodel.DetailedTaskSummariesModel)1 SimpleTaskSummariesModel (com.salaboy.jbpm5.dev.guide.tablemodel.SimpleTaskSummariesModel)1 InitialContext (javax.naming.InitialContext)1