I don't see what is wrong in there if you have make sure that you created a "market" group with a "test1" user that belong to it !
Here is something equivalent that work with JBPM4.4 (and i gess worked with 4.3):
TaskList l = ...getTaskService().CreateQuery.candidate("test1").list()
same would work with assignee("test1") instead of candidate("test1") after you explicitely "taken" the task or if you use [assignee ="test1"] instead of [candidate-groups="marker"]
Before the execution of this sample process, I do have created a "market" group, a user "test1", and created the membership.
When this process is executed until this task, I wonder the way to acquire the current running task's taskId.
It was mentioned through this way, we can get a taskList, then further to get specific taskId. However this taskList.size() always be 0. I don't understand...
List<Task> taskList = taskService.findGroupTasks("test1");
Besides I tried your way, also get the 0 result...
List<Task> taskList2 = taskService.createTaskQuery().candidate("test1").list();
System.out.println("taskList2.size(): " + taskList2.size());
By the way
List<Task> taskList3 = taskService.createTaskQuery().assignee("test1").list();
this is clear to understand, since there is a "jbpm4_task" table, the relationship is obvious. The things which i don't understand is the candidates...
User candidate to a task is just as you though : if a user "test1" membership to a group "market" and if candidate-groups="market" is set for the task node into the process declarartion then you shoud be able to query test1 as candidate for that that task !
Please make sure that you do not use version number into your process declaration (<process name="NAME" version="INTVALUE" xmlns="http://jbpm.org/4.4/jpdl">). And if so try to increase by one the version number. This is because unless you destroy the db on each run, the process with the non increased version number might have been deployed time ago. It would be possible that you did it with different attribute in the task node than candidate-group.... Who knows !
The only other thing i could recommend would be to go to JBPM4.4 there is no difficulty with the source code. However for the database you will have to check the migration procedure.
I got it....
As you mentioned, it's because of the process declaration...
Thank you so much for your patience and help