AnsweredAssumed Answered

[Urgent]All completed task dashlet (specify workflow)

Question asked by leyer on Mar 8, 2010
Latest reply on Apr 8, 2014 by lucille.arkenstone
Hello everyone,
I try to create a dashlet with the jbpm diagramme.
But i have a probleme, i need all completed task but with the javascript workflow api i have only the active task.
How can i do to all tasks ?


        var list = new Array();
   var name= url.templateArgs.name;
   var selectedworkflow;
   var tasks = new Array();
   var works = workflow.getDefinitionByName("jbpm$workflowname").getActiveInstances();
  
   for each(single in works)
   {
      if(single.description == name){
         selectedworkflow = single.getPaths();
         for each(path in selectedworkflow){
            tasks=path.getTasks();
               for each(task in tasks){
                  list.push(task);
               }
         }
      }
   }
   model.tasklist = list;
   model.work = works;
   model.name = name;

Outcomes