summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2011-12-07 19:16:28 (EST)
committerRoberto E. Escobar2011-12-12 15:54:11 (EST)
commit7919b33af301551e435a13d14c6f07a4633b5e63 (patch)
treedcfda450ced051194de0836cb30300238dbc7608
parent3ce798f368456e1657f55f02d7193ed2e16edde5 (diff)
downloadorg.eclipse.osee-7919b33af301551e435a13d14c6f07a4633b5e63.zip
org.eclipse.osee-7919b33af301551e435a13d14c6f07a4633b5e63.tar.gz
org.eclipse.osee-7919b33af301551e435a13d14c6f07a4633b5e63.tar.bz2
feature[ats_5FF7X]: Metrics - implement TaskArt.getLogItemAsOfDate
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/task/TaskArtifact.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/task/TaskArtifact.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/task/TaskArtifact.java
index 1051a6c..8df5e59 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/task/TaskArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/task/TaskArtifact.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.core.task;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Date;
import java.util.List;
import org.eclipse.osee.ats.core.team.TeamState;
import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact;
@@ -23,6 +24,8 @@ import org.eclipse.osee.ats.core.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.workflow.EstimatedHoursUtil;
import org.eclipse.osee.ats.core.workflow.PercentCompleteTotalUtil;
import org.eclipse.osee.ats.core.workflow.StateManager;
+import org.eclipse.osee.ats.core.workflow.log.AtsLog;
+import org.eclipse.osee.ats.core.workflow.log.LogItem;
import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.ats.core.workflow.transition.TransitionOption;
@@ -204,4 +207,20 @@ public class TaskArtifact extends AbstractWorkflowArtifact implements IATSStateM
return est - ((est * percent) / 100.0);
}
+ public LogItem getLogItemAsOfDate(Date date) throws OseeCoreException {
+ LogItem retLogItem = null;
+ AtsLog atsLog = getLog();
+ List<LogItem> logItems = atsLog.getLogItems();
+ for (LogItem logItem : logItems) {
+ Date logItemDate = logItem.getDate();
+ if (logItemDate.after(date)) {
+ break;
+ } else {
+ retLogItem = logItem;
+ }
+ }
+
+ return retLogItem;
+ }
+
}