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

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2014 10:44 AM
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?
Thanks in advance.
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.
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2014 01:42 AM
Any kind of meaningful input / response on this query would be greatly appreciated. Thanks.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2014 03:52 AM
Hi Shankar,
Did you try to get user tasks for process instance? (or assigned to kermit?) (CandidateUser selects tasks for which the given user is a candidate. )
Regards
Martin
Did you try to get user tasks for process instance? (or assigned to kermit?) (CandidateUser selects tasks for which the given user is a candidate. )
Regards
Martin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2014 03:59 AM
Hi Martin,
I tried to retrieve the list of User Tasks assigned to kermit. I believe the following line of code (in my code snippet) should fetch the same.
<java>
List<Task> taskList = taskService.createTaskQuery()
.taskCandidateUser("kermit").list();
</java>
Is there anything wrong / missing in my initial post?
I tried to retrieve the list of User Tasks assigned to kermit. I believe the following line of code (in my code snippet) should fetch the same.
<java>
List<Task> taskList = taskService.createTaskQuery()
.taskCandidateUser("kermit").list();
</java>
Is there anything wrong / missing in my initial post?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2014 04:42 AM
Hi,
create and share jUnit test.
Regards
Martin
create and share jUnit test.
Regards
Martin
