Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2014-11-05 22:30:49 +0000
committerRoberto Escobar2014-11-06 00:21:47 +0000
commitc9e9497b96201925323732c9780ed910e7b40963 (patch)
tree653f9975a62b6dbea068b86c848ffca200c12e24
parent17ffebafe7e3ab7bd1e5c53cbcacbcce0811ed51 (diff)
downloadorg.eclipse.osee-0.19.0.v201411060103_RC.tar.gz
org.eclipse.osee-0.19.0.v201411060103_RC.tar.xz
org.eclipse.osee-0.19.0.v201411060103_RC.zip
bug[ats_ATS137028]: Action ATS123813 showing 99 percent when it is completed0.19.0.v201411060103_RC
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/PercentCompleteTotalUtil.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/PercentCompleteTotalUtil.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/PercentCompleteTotalUtil.java
index e90d4f8d85e..5806680c225 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/PercentCompleteTotalUtil.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/PercentCompleteTotalUtil.java
@@ -41,12 +41,13 @@ public class PercentCompleteTotalUtil {
// Calculate total percent using configured weighting
for (IAtsStateDefinition stateDef : workItem.getWorkDefinition().getStates()) {
if (!stateDef.getStateType().isCompletedState() && !stateDef.getStateType().isCancelledState()) {
- double stateWeightInt = stateDef.getStateWeight();
- double weight = stateWeightInt / 100;
- int percentCompleteForState = getPercentCompleteSMAStateTotal(workItem, stateDef, services);
- percent += weight * percentCompleteForState;
+ percent = addStatePercentWithWeight(services, percent, workItem, stateDef);
}
}
+ if (workItem.getStateMgr().getStateType().isCompleted()) {
+ IAtsStateDefinition stateDef = workItem.getStateDefinition();
+ percent = addStatePercentWithWeight(services, percent, workItem, stateDef);
+ }
} else {
percent = getPercentCompleteSMASinglePercent(workItem, services);
if (percent == 0) {
@@ -70,6 +71,14 @@ public class PercentCompleteTotalUtil {
return percent;
}
+ private static int addStatePercentWithWeight(IAtsServices services, int percent, IAtsWorkItem workItem, IAtsStateDefinition stateDef) {
+ double stateWeightInt = stateDef.getStateWeight();
+ double weight = stateWeightInt / 100;
+ int percentCompleteForState = getPercentCompleteSMAStateTotal(workItem, stateDef, services);
+ percent += weight * percentCompleteForState;
+ return percent;
+ }
+
private static boolean isAnyStateHavePercentEntered(IAtsWorkItem workItem) throws OseeCoreException {
for (String stateName : workItem.getStateMgr().getVisitedStateNames()) {
if (workItem.getStateMgr().getPercentComplete(stateName) != 0) {

Back to the top