mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 23:13:10 +00:00
[DS-90] Workflow doesn't skipped if the wf group contains empty subgroups
git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@3587 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -1051,19 +1051,29 @@ public class Group extends DSpaceObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if group has no members
|
||||
* Return true if group has no direct or indirect members
|
||||
*/
|
||||
public boolean isEmpty()
|
||||
{
|
||||
loadData(); // make sure all data is loaded
|
||||
|
||||
if ((epeople.size() == 0) && (groups.size() == 0))
|
||||
|
||||
// the only fast check available is on epeople...
|
||||
boolean hasMembers = (epeople.size() != 0);
|
||||
|
||||
if (hasMembers)
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
// well, groups is never null...
|
||||
for (Group subGroup : groups){
|
||||
hasMembers = !subGroup.isEmpty();
|
||||
if (hasMembers){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return !hasMembers;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user