Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)

124236 amorarasu: Merged 5.0.N (5.0.4) to 5.1.N (5.1.2) (PARTIAL MERGE)
      124190 amorarasu: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4)
         124132 arebegea: MNT-15573 : Site finder slow for a user who's member of many sites
            - added a new method to InvitationService to make use of the limit in the searchInvitation
            - sent and used the 200 limit from the site-finder.get.js in the script/ScriptInvitationService.java and passed the new parameter
            - for searchModeratedInvitations and searchNominatedInvitations methods of InvitationServiceImpl.java I added the use of the limit parameter
            - added some comments on ActivitiWorkflowEngine.java and TaskComponent.java to inform developers about the performance issues and possible improvement
            - added junit tests


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@124277 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-03-21 11:05:59 +00:00
parent d20141eb13
commit 741769a993
6 changed files with 162 additions and 26 deletions

View File

@@ -73,11 +73,16 @@ public interface TaskComponent
/**
* Query for tasks
*
* @param query the filter by which tasks are queried
* @param sameSession indicates that the returned {@link WorkflowTask} elements will be used in
* the same session. If {@code true}, the returned List will be a lazy loaded list
* providing greater performance.
* @return the list of tasks matching the specified query
* Hint: use {@link WorkflowTaskQuery} setLimit() method to limit the number
* of processed items if you don't really need to go through all of them
*
* @param query
* the filter by which tasks are queried
* @param sameSession
* indicates that the returned {@link WorkflowTask} elements will
* be used in the same session. If {@code true}, the returned
* List will be a lazy loaded list providing greater performance.
* @return the list of tasks matching the specified query
*/
public List<WorkflowTask> queryTasks(final WorkflowTaskQuery query, boolean sameSession);

View File

@@ -1238,8 +1238,15 @@ public class ActivitiWorkflowEngine extends BPMEngine implements WorkflowEngine
}
/**
* Converts the given list of {@link Task}s to a list of {@link WorkflowTask}s
* that have a valid domain.
* Converts the given list of {@link Task}s to a list of
* {@link WorkflowTask}s that have a valid domain.
*
* Note that this method is not very performant. It will do many DB queries
* for each of the Task item in the list of tasks as parameter. Make sure
* that you limit the size of the tasks list depending on your needs. Hint:
* use the WorkflowTaskQuery query parameter setLimit() method to limit the
* number of Tasks to process
*
* @param tasks List<Task>
*/
private List<WorkflowTask> getValidWorkflowTasks(List<Task> tasks)