summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntje Fuhrmann2013-03-26 04:02:11 (EDT)
committer Sven Rottstock2013-03-26 04:02:11 (EDT)
commit55c8ecfd2e138d5d28f6ff63863dfc78c9a1c944 (patch)
treeb88296a5efe4eee375bb467eeb5a8a30e59ae7f6
parent596e4ca40ddfee31e1aefc81d49911fe52ac3864 (diff)
downloadorg.eclipse.stardust.engine-55c8ecfd2e138d5d28f6ff63863dfc78c9a1c944.zip
org.eclipse.stardust.engine-55c8ecfd2e138d5d28f6ff63863dfc78c9a1c944.tar.gz
org.eclipse.stardust.engine-55c8ecfd2e138d5d28f6ff63863dfc78c9a1c944.tar.bz2
Jira-ID: CRNT-28519
Exclude user filter: Portal displays "strange" numbers for participants worklists git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/engine@63947 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/QueryUtils.java26
-rw-r--r--stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/RuntimeInstanceQueryEvaluator.java29
-rw-r--r--stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/WorklistQueryEvaluator.java14
3 files changed, 38 insertions, 31 deletions
diff --git a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/QueryUtils.java b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/QueryUtils.java
index 0a1ef23..6aca63f 100644
--- a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/QueryUtils.java
+++ b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/QueryUtils.java
@@ -29,6 +29,7 @@ import org.eclipse.stardust.engine.core.persistence.jdbc.SessionFactory;
import org.eclipse.stardust.engine.core.runtime.beans.*;
import org.eclipse.stardust.engine.core.runtime.beans.removethis.KernelTweakingProperties;
import org.eclipse.stardust.engine.core.runtime.beans.removethis.SecurityProperties;
+import org.eclipse.stardust.engine.core.runtime.utils.AbstractAuthorization2Predicate;
import org.eclipse.stardust.engine.core.runtime.utils.DepartmentUtils;
@@ -867,4 +868,29 @@ public class QueryUtils
}
}
}
+
+ public static long getTotalCountThreshold(FetchPredicate fetchPredicate)
+ {
+ long totalCountThreshold = Long.MAX_VALUE;
+ if (Parameters.instance().getBoolean(
+ KernelTweakingProperties.ENGINE_EXCLUDE_USER_EVALUATION, false)
+ && hasDataPrefetchHintFilter(fetchPredicate))
+ {
+ totalCountThreshold = Parameters.instance().getLong(
+ KernelTweakingProperties.EXCLUDE_USER_MAX_WORKLIST_COUNT, 100);
+ }
+ return totalCountThreshold;
+ }
+
+ private static boolean hasDataPrefetchHintFilter(FetchPredicate fetchPredicate)
+ {
+ boolean hasDataPrefetchHints = false;
+ if ((fetchPredicate instanceof AbstractAuthorization2Predicate)
+ && ((AbstractAuthorization2Predicate) fetchPredicate)
+ .hasDataPrefetchHintFilter())
+ {
+ hasDataPrefetchHints = true;
+ }
+ return hasDataPrefetchHints;
+ }
} \ No newline at end of file
diff --git a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/RuntimeInstanceQueryEvaluator.java b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/RuntimeInstanceQueryEvaluator.java
index 8cf0619..70be4a2 100644
--- a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/RuntimeInstanceQueryEvaluator.java
+++ b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/RuntimeInstanceQueryEvaluator.java
@@ -263,7 +263,7 @@ public class RuntimeInstanceQueryEvaluator implements QueryEvaluator
authPred.setSelectionExtension(size, selectExtension);
}
- long totalCountThreshold = getTotalCountThreshold(fetchPredicate);
+ long totalCountThreshold = QueryUtils.getTotalCountThreshold(fetchPredicate);
final long totalCount = countImplicitly
? result.getTotalCount()
@@ -285,19 +285,6 @@ public class RuntimeInstanceQueryEvaluator implements QueryEvaluator
}
}
- private long getTotalCountThreshold(FetchPredicate fetchPredicate)
- {
- long totalCountThreshold = Long.MAX_VALUE;
- if (Parameters.instance().getBoolean(
- KernelTweakingProperties.ENGINE_EXCLUDE_USER_EVALUATION, false)
- && hasDataPrefetchHintFilter(fetchPredicate))
- {
- totalCountThreshold = Parameters.instance().getLong(
- KernelTweakingProperties.EXCLUDE_USER_MAX_WORKLIST_COUNT, 100);
- }
- return totalCountThreshold;
- }
-
private long getExplicitTotalCount(QueryExtension queryExtension,
FetchPredicate fetchPredicate, boolean useCasePolicy, long totalCountThreshold)
{
@@ -312,19 +299,7 @@ public class RuntimeInstanceQueryEvaluator implements QueryEvaluator
totalCountThreshold);
}
}
-
- private boolean hasDataPrefetchHintFilter(FetchPredicate fetchPredicate)
- {
- boolean hasDataPrefetchHints = false;
- if ((fetchPredicate instanceof AbstractAuthorization2Predicate)
- && ((AbstractAuthorization2Predicate) fetchPredicate)
- .hasDataPrefetchHintFilter())
- {
- hasDataPrefetchHints = true;
- }
- return hasDataPrefetchHints;
- }
-
+
private static void applyDistinctOnQueryExtension(QueryExtension queryExtension,
SqlBuilder.ParsedQuery parsedQuery)
{
diff --git a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/WorklistQueryEvaluator.java b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/WorklistQueryEvaluator.java
index 680755a..2d7fa80 100644
--- a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/WorklistQueryEvaluator.java
+++ b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/WorklistQueryEvaluator.java
@@ -128,7 +128,7 @@ public class WorklistQueryEvaluator
&& query.getUserGroupContributions().isEmpty())
{
// no contributions, return empty worklist
- return createUserWorklist(subsetPolicy, Collections.EMPTY_LIST, null);
+ return createUserWorklist(subsetPolicy, Collections.EMPTY_LIST, null, Long.MAX_VALUE);
}
collectParticipantInfos(modelParticipantInfos, userGroupRtOids, allCollectors);
@@ -233,6 +233,7 @@ public class WorklistQueryEvaluator
// Read values for each worklist and ignore workitems whose activities are
// restricted for the current user.
+ long totalCountThreshold = QueryUtils.getTotalCountThreshold(authorizationPredicate);
long totalCount = 0;
try
{
@@ -271,6 +272,11 @@ public class WorklistQueryEvaluator
}
}
}
+ if (totalCount > totalCountThreshold)
+ {
+ totalCount = Long.MAX_VALUE;
+ break;
+ }
}
}
catch (SQLException e)
@@ -292,16 +298,16 @@ public class WorklistQueryEvaluator
subWorklists.add(participantWorklist);
}
- return createUserWorklist(subsetPolicy, subWorklists, new Long(totalCount));
+ return createUserWorklist(subsetPolicy, subWorklists, new Long(totalCount), totalCountThreshold);
}
private UserWorklist createUserWorklist(SubsetPolicy subsetPolicy, List subWorklists,
- Long totalCount)
+ Long totalCount, long totalCountThreshold)
{
final UserInfo owner = DetailsFactory.create(context.getUser(), IUser.class,
UserInfoDetails.class);
return new UserWorklist(owner, query, subsetPolicy, Collections.EMPTY_LIST, false,
- subWorklists, totalCount);
+ subWorklists, totalCount, totalCountThreshold);
}