cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving CandidateGroup Task

frankee787
Champ on-the-rise
Champ on-the-rise
Dear All,
  I understand , inorder to retrieve Task assigned to single "CandidateGroup"…you can use the API as follows

     getTaskService().createTaskQuery().taskCandidateGroup("candidateGroup").list();

However, if a task is assigned to multiple "CandidateGroup"…you would have to use the API probably in a loop as follows

for loop

getTaskService().createTaskQuery().taskCandidateGroup("candidateGroup"+).list();

end loop;

Is there a better way to do this , where in which it queries in one hit to the database ?

Regards,
Franklin
6 REPLIES 6

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Create your own query? And I do not mean with the query api, but in the mybatis config file, or even plain jdbc

frankee787
Champ on-the-rise
Champ on-the-rise
Thanks Ronald.

I really didn't think about that possibility.

However, is this a common use case?

Would it be worthwhile for it to be part the API?

I have also noticed that a similar situations with Task assignment where each entity in the assignment takes a roundtrip to the DB(Correct me if my understanding is wrong).

Regards,
Franklin

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
However, is this a common use case?
yes and no… at least in my case. Yes, retrieving multiple group lists is, but in my case it is limited to 5 and I need the lists separated after retrieval, since I want to display them per group. Adding this additional logic which might require additional queries to the db (not sure, but it might) for me did not outway the 1 query to retrieve all

Would it be worthwhile for it to be part the API?
Yes and no (yes and not sure actually), see the answer before

I have also noticed that a similar situations with Task assignment where each entity in the assignment takes a roundtrip to the DB(Correct me if my understanding is wrong)
I recall something like this yes, but thought it was fixed (check Jira)

frankee787
Champ on-the-rise
Champ on-the-rise
yes and no… at least in my case. Yes, retrieving multiple group lists is, but in my case it is limited to 5 and I need the lists separated after retrieval, since I want to display them per group. Adding this additional logic which might require additional queries to the db (not sure, but it might) for me did not outway the 1 query to retrieve all
If you were going to display the lists as separate groups then there is no reason to query them together and then separate them, atleast thats what I believe.


I recall something like this yes, but thought it was fixed (check Jira)
I believe this is still there. The method signature is getTaskService().saveTask(task) So I am assuming it will do it as different db statements. Anyways, I shall skim through the JIRA and see.


Thanks a lot,
Franklin

tstephen
Champ on-the-rise
Champ on-the-rise
I created http://jira.codehaus.org/browse/ACT-796 in April, which I believe is what you are looking for. There is a patch attached but it doesn't look like anyone has gotten to it yet.

Tim

frankee787
Champ on-the-rise
Champ on-the-rise
Thats exactly what I am looking for.

Thanks,
Franklin