summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-03-04 05:27:04 (EST)
committerSven Rottstock2013-03-11 06:38:39 (EDT)
commitede91c09133add0a1fa1584d20cf678129da0dc3 (patch)
tree5635e2ab13211aa4b308ee706f931d1c42c7a14b
parent6bbdb0956a76c8927a0aeca67e5daf2dfa13bba2 (diff)
downloadorg.eclipse.stardust.ui.web-ede91c09133add0a1fa1584d20cf678129da0dc3.zip
org.eclipse.stardust.ui.web-ede91c09133add0a1fa1584d20cf678129da0dc3.tar.gz
org.eclipse.stardust.ui.web-ede91c09133add0a1fa1584d20cf678129da0dc3.tar.bz2
Jira-ID: CRNT-28091
Added code to prevent change of totalCount when totalCount = LONG.MAX_VALUE in SpecialWorklistCacheManager.java,ProcessWorklistCacheManager.java,ParticipantWorklistCacheManager.java handleActivityEvent method. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@63435 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheManager.java6
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheManager.java7
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/SpecialWorklistCacheManager.java16
3 files changed, 17 insertions, 12 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheManager.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheManager.java
index df762b8..a20e7f8 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheManager.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheManager.java
@@ -112,7 +112,7 @@ public class ParticipantWorklistCacheManager implements InitializingBean, Serial
return cacheEntry.getTotalCountThreshold();
}
- return 0;
+ return Long.MAX_VALUE;
}
/**
@@ -166,7 +166,7 @@ public class ParticipantWorklistCacheManager implements InitializingBean, Serial
{
ParticipantWorklistCacheEntry oldEntry = participantWorklists.get(new ParticipantInfoWrapper(oldAi
.getCurrentPerformer()));
- if (null != oldEntry)
+ if (null != oldEntry && oldEntry.getCount() < oldEntry.getTotalCountThreshold())
{
oldEntry.setCount(oldEntry.getCount() - 1);
}
@@ -178,7 +178,7 @@ public class ParticipantWorklistCacheManager implements InitializingBean, Serial
{
ParticipantWorklistCacheEntry newEntry = participantWorklists.get(new ParticipantInfoWrapper(newAi
.getCurrentPerformer()));
- if (null != newEntry)
+ if (null != newEntry && newEntry.getCount() < Long.MAX_VALUE)
{
newEntry.setCount(newEntry.getCount() + 1);
}
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheManager.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheManager.java
index 38b964a..57aa5fa 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheManager.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheManager.java
@@ -124,7 +124,7 @@ public class ProcessWorklistCacheManager implements InitializingBean
return processWorklistCacheEntry.getTotalCountThreshold();
}
- return 0;
+ return Long.MAX_VALUE;
}
/**
@@ -181,14 +181,15 @@ public class ProcessWorklistCacheManager implements InitializingBean
if (ActivityEvent.ACTIVATED.equals(event.getType()))
{
// oldAi can be null if it's the first AI of PI is Activated
- if (null == oldAi)
+ if (null == oldAi && entry.getCount() < Long.MAX_VALUE)
{
entry.setCount(entry.getCount() + 1);
}
}
else if (ActivityEvent.ABORTED.equals(event.getType()) || ActivityEvent.COMPLETED.equals(event.getType()))
{
- entry.setCount(entry.getCount() - 1);
+ if (entry.getCount() < entry.getTotalCountThreshold())
+ entry.setCount(entry.getCount() - 1);
}
}
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/SpecialWorklistCacheManager.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/SpecialWorklistCacheManager.java
index a5bfc44..791c22d 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/SpecialWorklistCacheManager.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/SpecialWorklistCacheManager.java
@@ -134,9 +134,11 @@ public class SpecialWorklistCacheManager implements InitializingBean, Serializab
// oldAi can be null if it's the first AI of PI is Activated
if (null == oldAi)
{
- allActivities.setCount(allActivities.getCount() + 1);
-
- if (isActivityCritical(event.getActivityInstance()))
+ if (allActivities.getCount() < Long.MAX_VALUE)
+ {
+ allActivities.setCount(allActivities.getCount() + 1);
+ }
+ if (isActivityCritical(event.getActivityInstance()) && criticialActivities.getCount() < Long.MAX_VALUE)
{
criticialActivities.setCount(criticialActivities.getCount() + 1);
}
@@ -144,9 +146,11 @@ public class SpecialWorklistCacheManager implements InitializingBean, Serializab
}
else if (ActivityEvent.ABORTED.equals(event.getType()) || ActivityEvent.COMPLETED.equals(event.getType()))
{
- allActivities.setCount(allActivities.getCount() - 1);
-
- if (isActivityCritical(oldAi))
+ if (allActivities.getCount() < Long.MAX_VALUE)
+ {
+ allActivities.setCount(allActivities.getCount() - 1);
+ }
+ if (isActivityCritical(oldAi) && criticialActivities.getCount() < Long.MAX_VALUE)
{
criticialActivities.setCount(criticialActivities.getCount() - 1);
}