summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntje Fuhrmann2013-02-12 04:37:00 (EST)
committerSven Rottstock2013-03-11 04:54:23 (EDT)
commita97d56682f11f4340db43c1c814ac4a3c763c021 (patch)
tree1ab2c99ade1a20c69b7efe9c9ec80574ce850e87
parent5af87ca0035768b25a504916e712b6a178dc6733 (diff)
downloadorg.eclipse.stardust.engine-a97d56682f11f4340db43c1c814ac4a3c763c021.zip
org.eclipse.stardust.engine-a97d56682f11f4340db43c1c814ac4a3c763c021.tar.gz
org.eclipse.stardust.engine-a97d56682f11f4340db43c1c814ac4a3c763c021.tar.bz2
Jira-ID: CRNT-27825
ActivityInstanceQuery with ExcludeUserPolicy.EXCLUDE_USER applied still does perform extra SQL fetches for ProcessInstances if StructuredDataValue with XPath to primitive leaf node is used git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/engine@62919 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/utils/AbstractAuthorization2Predicate.java59
1 files changed, 34 insertions, 25 deletions
diff --git a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/utils/AbstractAuthorization2Predicate.java b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/utils/AbstractAuthorization2Predicate.java
index 67601c1..a56c707 100644
--- a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/utils/AbstractAuthorization2Predicate.java
+++ b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/utils/AbstractAuthorization2Predicate.java
@@ -539,6 +539,9 @@ public abstract class AbstractAuthorization2Predicate implements Authorization2P
if (!queryFilter.getParts().contains(filter))
{
queryFilter.and(filter);
+ }
+ if (!dataPrefetchHintFilter.containsKey(dataId))
+ {
dataPrefetchHintFilter.put(dataId, filter);
}
}
@@ -629,23 +632,22 @@ public abstract class AbstractAuthorization2Predicate implements Authorization2P
{
dataValueOid = dataValueOids.get(dataId);
}
- else if (PredefinedConstants.LAST_ACTIVITY_PERFORMER.equals(data.getId()))
+ if (PredefinedConstants.LAST_ACTIVITY_PERFORMER.equals(data.getId()))
{
IUser lastActivityPerformer = ActivityInstanceBean
.getLastActivityPerformer(processInstanceOID);
Object value = lastActivityPerformer != null
? lastActivityPerformer.getPrimaryKey()
: null;
- if (value instanceof UserPK)
- {
- try
- {
- dataValueOid = Long.parseLong(value.toString());
- }
- catch (NumberFormatException e)
- {
- }
- }
+ dataValueOid = getDataValueOid(value);
+ }
+ if (PredefinedConstants.STARTING_USER.equals(data.getId()))
+ {
+ IProcessInstance processInstance = ProcessInstanceBean
+ .findByOID(processInstanceOID);
+ IDataValue dataValue = processInstance.getDataValue(data);
+ Object value = dataValue.getValue();
+ dataValueOid = getDataValueOid(value);
}
boolean isPrimitiveStructType = false;
if (StructuredTypeRtUtils.isStructuredType(data.getType().getId()))
@@ -666,20 +668,7 @@ public abstract class AbstractAuthorization2Predicate implements Authorization2P
processInstance, null, null, null);
Object value = evaluator.evaluate(data, dataValue.getValue(),
dataPath, evaluationContext);
- if (value instanceof Long)
- {
- dataValueOid = (Long) value;
- }
- else if (value instanceof UserPK)
- {
- try
- {
- dataValueOid = Long.parseLong(value.toString());
- }
- catch (NumberFormatException e)
- {
- }
- }
+ dataValueOid = getDataValueOid(value);
}
if (currentPerformer == dataValueOid)
@@ -693,4 +682,24 @@ public abstract class AbstractAuthorization2Predicate implements Authorization2P
}
return false;
}
+
+ private long getDataValueOid(Object value)
+ {
+ long oid = 0;
+ if (value instanceof Long)
+ {
+ oid = (Long) value;
+ }
+ else if (value instanceof UserPK)
+ {
+ try
+ {
+ oid = Long.parseLong(value.toString());
+ }
+ catch (NumberFormatException e)
+ {
+ }
+ }
+ return oid;
+ }
} \ No newline at end of file