AnsweredAssumed Answered

Empty User Task List (for kermit), though workflow spec has numerous

Question asked by sankarts on Dec 11, 2014
Latest reply on Dec 12, 2014 by martin.grofcik
In my workflow spec i.e. "my_bpmn.bpmn20.xml"
a) There are more than one User Task
b) Every User Task has been assigned to "kermit"

But, when I try to retrieve the list of user tasks assigned to "kermit", it returns empty list. The code snippet is as below.

Queries:
1) Why the task list for "kermit" is empty? Is anything missing / misconfigured in the code snippet?
2) How to verify the deployment and starting process instance were successful?
3) Can I make use of Activity Exploer only for viewing the deployments, running process instances and the current state of each instance? (Deployment, starting instance, completing task etc would be programmatic)
4) How to complete my User Task (which is HTML form)? How to say that this HTML file should get launched for a User Task?


ProcessEngine processEngine = ProcessEngineConfiguration
            .createStandaloneInMemProcessEngineConfiguration()
            .buildProcessEngine();
      
      runtimeService = processEngine.getRuntimeService();
      
      RepositoryService repositoryService = processEngine.getRepositoryService();
      
      IdentityService identityService = processEngine.getIdentityService();
      TaskService taskService = processEngine.getTaskService();
            
      repositoryService.createDeployment()
            .addClasspathResource("my_bpmn.bpmn20.xml").
            deploy();
      
      
      Map<String,Object> variables = new HashMap<String, Object>();
      variables.put("abc", "xyz");
      
      identityService.setAuthenticatedUserId("kermit");
      
      ProcessInstance processInstance =
            runtimeService.startProcessInstanceByKey("my_process", generateWorkOrderId(), variables);
            if(null == processInstance.getId() )
               System.out.println("Null Process Instance ID");
            System.out.println("id " + processInstance.getId() + " " +
            processInstance.getProcessDefinitionId());
            
      List<Task> taskList = taskService.createTaskQuery()
            .taskCandidateUser("kermit").list();
      System.out.println("Task List Size: " + taskList.size());
      System.out.println("found task " + taskList.get(0).getName());
      taskService.complete(taskList.get(0).getId());


Thanks in advance.

Outcomes