I find that we can do this when the task is not finished by calling taskService.createTaskQuery().taskCandidateOrAssigned, however, there is no such method for running and historic tasks all together. I may do this by querying all running and historic respectively and manage them via java code, but I consider it is not a very good idea and it surely will comsume a lot of resources.
Could you give me some advice? Thanks.