AnsweredAssumed Answered

Starting a fully automated flow

Question asked by rsaunder on Apr 10, 2015
Latest reply on Apr 14, 2015 by rsaunder
I have a simple process consisting of a start task, two script tasks in sequence, and an end tasks. Both script tasks make the trivial assignment "a=1;". I start the process, then query to see what ran. Whether I query processes or tasks, the list comes back empty. Do I need to do something else to start this task, since the system has no users at all, it's just a REST service? Or is there something wrong with the query?

ProcessInstance processInstance = processEngine.getRuntimeService().startProcessInstanceByKey("myProcess",instanceVars);
       List<HistoricTaskInstance> tasks =
             processEngine.getHistoryService().createHistoricTaskInstanceQuery().processInstanceId("myProcess").list();
      System.out.println((Integer.toString(tasks.size())));
      HistoricTaskInstance task;
      for (Iterator<HistoricTaskInstance> iter = tasks.iterator(); iter.hasNext();) {
         task = (HistoricTaskInstanceEntity) iter.next();
         System.out.println(task.getName());

Outcomes