Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-09-16 13:21:37 -0400
committerdonald.g.dunne2016-10-10 16:14:31 -0400
commit1ee2741ee727d4647d643deedd819e8fe599d6e9 (patch)
tree2553606dae1fb597205be6169ccdd052fea3cd05
parentf31ad32d1daa61e0f3622ee9ff911f21883107d7 (diff)
downloadorg.eclipse.osee-1ee2741ee727d4647d643deedd819e8fe599d6e9.tar.gz
org.eclipse.osee-1ee2741ee727d4647d643deedd819e8fe599d6e9.tar.xz
org.eclipse.osee-1ee2741ee727d4647d643deedd819e8fe599d6e9.zip
feature[ats_ATS315180]: Provide sprint burndown rest endpoint
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/AgileBurndown.java113
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/AgileBurndownDate.java84
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/AgileEndpointApi.java10
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/IAgileService.java2
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsAttributeTypes.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManager.java7
-rw-r--r--plugins/org.eclipse.osee.ats.rest/OSEE-INF/support/OSEE_Sprint_Burndown.iqy11
-rw-r--r--plugins/org.eclipse.osee.ats.rest/OSEE-INF/support/OSEE_Sprint_Burndown.xlsbin0 -> 54784 bytes
-rw-r--r--plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.rest.application.xml1
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java8
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/AgileEndpointImpl.java45
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/AgileService.java19
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/SprintBurndownDataBuilder.java294
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/SprintBurndownPageBuilder.java178
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/model/WorkItem.java10
-rw-r--r--plugins/org.eclipse.osee.ats/support/OseeTypes_ATS.osee27
-rw-r--r--plugins/org.eclipse.osee.ats/support/WorkDef_Sprint.ats142
17 files changed, 879 insertions, 75 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/AgileBurndown.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/AgileBurndown.java
new file mode 100644
index 00000000000..a05e27fe538
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/AgileBurndown.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.agile;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AgileBurndown {
+
+ private String agileTeamName;
+ private String sprintName;
+ private Date startDate;
+ private Date endDate;
+ private List<Date> holidays;
+ private String pointsAttrTypeName;
+ private Integer plannedPoints;
+ private Integer unPlannedPoints;
+ private List<AgileBurndownDate> dates = new ArrayList<AgileBurndownDate>();
+ private String error;
+
+ public String getAgileTeamName() {
+ return agileTeamName;
+ }
+
+ public void setAgileTeamName(String agileTeamName) {
+ this.agileTeamName = agileTeamName;
+ }
+
+ public String getSprintName() {
+ return sprintName;
+ }
+
+ public void setSprintName(String sprintName) {
+ this.sprintName = sprintName;
+ }
+
+ public Date getStartDate() {
+ return startDate;
+ }
+
+ public void setStartDate(Date startDate) {
+ this.startDate = startDate;
+ }
+
+ public Date getEndDate() {
+ return endDate;
+ }
+
+ public void setEndDate(Date endDate) {
+ this.endDate = endDate;
+ }
+
+ public List<Date> getHolidays() {
+ return holidays;
+ }
+
+ public void setHolidays(List<Date> holidays) {
+ this.holidays = holidays;
+ }
+
+ public String getPointsAttrTypeName() {
+ return pointsAttrTypeName;
+ }
+
+ public void setPointsAttrTypeName(String pointsAttrTypeName) {
+ this.pointsAttrTypeName = pointsAttrTypeName;
+ }
+
+ public Integer getPlannedPoints() {
+ return plannedPoints;
+ }
+
+ public void setPlannedPoints(Integer plannedPoints) {
+ this.plannedPoints = plannedPoints;
+ }
+
+ public Integer getUnPlannedPoints() {
+ return unPlannedPoints;
+ }
+
+ public void setUnPlannedPoints(Integer unPlannedPoints) {
+ this.unPlannedPoints = unPlannedPoints;
+ }
+
+ public List<AgileBurndownDate> getDates() {
+ return dates;
+ }
+
+ public void setDates(List<AgileBurndownDate> dates) {
+ this.dates = dates;
+ }
+
+ public String getError() {
+ return error;
+ }
+
+ public void setError(String error) {
+ this.error = error;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/AgileBurndownDate.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/AgileBurndownDate.java
new file mode 100644
index 00000000000..d3ae20f58e2
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/AgileBurndownDate.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.agile;
+
+import java.util.Date;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AgileBurndownDate {
+
+ private Date date;
+ private Double completedPoints = new Double(0);
+ private Double completedPlannedPoints = new Double(0);
+ private Double completedUnPlannedPoints = new Double(0);
+ private Double inCompletedUnPlannedPoints = new Double(0);
+ private Double goalPoints = new Double(0);
+ private Double unRealizedWalkup = new Double(0);
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ public Double getCompletedPoints() {
+ return completedPoints;
+ }
+
+ public void setCompletedPoints(Double completedPoints) {
+ this.completedPoints = completedPoints;
+ }
+
+ public Double getCompletedPlannedPoints() {
+ return completedPlannedPoints;
+ }
+
+ public void setCompletedPlannedPoints(Double completedPlannedPoints) {
+ this.completedPlannedPoints = completedPlannedPoints;
+ }
+
+ public Double getCompletedUnPlannedPoints() {
+ return completedUnPlannedPoints;
+ }
+
+ public void setCompletedUnPlannedPoints(Double completedUnPlannedPoints) {
+ this.completedUnPlannedPoints = completedUnPlannedPoints;
+ }
+
+ public Double getGoalPoints() {
+ return goalPoints;
+ }
+
+ public void setGoalPoints(Double goalPoints) {
+ this.goalPoints = goalPoints;
+ }
+
+ public Double getUnRealizedWalkup() {
+ return unRealizedWalkup;
+ }
+
+ public void setUnRealizedWalkup(Double unRealizedWalkup) {
+ this.unRealizedWalkup = unRealizedWalkup;
+ }
+
+ public Double getInCompletedUnPlannedPoints() {
+ return inCompletedUnPlannedPoints;
+ }
+
+ public void setInCompletedUnPlannedPoints(Double inCompletedUnPlannedPoints) {
+ this.inCompletedUnPlannedPoints = inCompletedUnPlannedPoints;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/AgileEndpointApi.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/AgileEndpointApi.java
index 02c88615d3a..54b69e2b960 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/AgileEndpointApi.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/AgileEndpointApi.java
@@ -74,6 +74,16 @@ public interface AgileEndpointApi {
public Response getSprintSummary(@PathParam("teamUuid") long teamUuid, @PathParam("sprintUuid") long sprintUuid);
@GET
+ @Path("team/{teamUuid}/sprint/{sprintUuid}/burndown")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response getSprintBurndown(@PathParam("teamUuid") long teamUuid, @PathParam("sprintUuid") long sprintUuid);
+
+ @GET
+ @Path("team/{teamUuid}/sprint/{sprintUuid}/burndown/ui")
+ @Produces(MediaType.TEXT_HTML)
+ public Response getSprintBurndownUi(@PathParam("teamUuid") long teamUuid, @PathParam("sprintUuid") long sprintUuid);
+
+ @GET
@Path("team/{teamUuid}/sprint/{sprintUuid}/world")
@Produces(MediaType.APPLICATION_JSON)
public Collection<IAtsWorkItem> getSprintItems(@PathParam("teamUuid") long teamUuid, @PathParam("sprintUuid") long sprintUuid);
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/IAgileService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/IAgileService.java
index 963af817466..abaf1df6b7b 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/IAgileService.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/agile/IAgileService.java
@@ -78,4 +78,6 @@ public interface IAgileService {
IAttributeType getAgileTeamPointsAttributeType(IAgileTeam team);
+ Collection<IAgileItem> getItems(IAgileSprint sprint);
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsAttributeTypes.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsAttributeTypes.java
index 1babeb442d0..0e30f6d6053 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsAttributeTypes.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsAttributeTypes.java
@@ -118,6 +118,9 @@ public final class AtsAttributeTypes {
public static final IAttributeType State = createType(0x10000000000000D7L, "State", "States of workflow state machine.");
public static final IAttributeType StateNotes = createType(0x10000000000000E3L, "State Notes");
public static final IAttributeType StartDate = createType(0x1000000000000196L, "Start Date");
+ public static final IAttributeType Holiday = createType(0x1000666112340FBL, "Holiday");
+ public static final IAttributeType UnPlannedPoints = createType(0x03F1DFF4832FE702L, "Un-Planned Points");
+ public static final IAttributeType PlannedPoints = createType(0x033B418311442956L, "Planned Points");
public static final IAttributeType EndDate = createType(0x1000000000000197L, "End Date");
public static final IAttributeType SwEnhancement = createType(0x10000000000000FBL, "SW Enhancement");
public static final IAttributeType TeamDefinition = createType(0x10000000000000E1L, "Team Definition");
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManager.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManager.java
index 157180d4496..14357b57661 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManager.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManager.java
@@ -177,11 +177,8 @@ public class StateManager implements IAtsStateManager {
@Override
public StateType getStateType() throws OseeCoreException {
- IAtsStateDefinition stateDefinition = workItem.getStateDefinition();
- if (stateDefinition == null) {
- return null;
- }
- return stateDefinition.getStateType();
+ return StateType.valueOf(services.getAttributeResolver().getSoleAttributeValue(workItem,
+ AtsAttributeTypes.CurrentStateType, StateType.Working.name()));
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.rest/OSEE-INF/support/OSEE_Sprint_Burndown.iqy b/plugins/org.eclipse.osee.ats.rest/OSEE-INF/support/OSEE_Sprint_Burndown.iqy
new file mode 100644
index 00000000000..072b9364d06
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/OSEE-INF/support/OSEE_Sprint_Burndown.iqy
@@ -0,0 +1,11 @@
+WEB
+1
+http://a5481444.sw.nos.boeing.com:8092/ats/agile/team/6915488/sprint/1226060751/burndown/ui
+
+Selection=AllTables
+Formatting=None
+PreFormattedTextToColumns=True
+ConsecutiveDelimitersAsOne=True
+SingleBlockTextImport=False
+DisableDateRecognition=False
+DisableRedirections=False
diff --git a/plugins/org.eclipse.osee.ats.rest/OSEE-INF/support/OSEE_Sprint_Burndown.xls b/plugins/org.eclipse.osee.ats.rest/OSEE-INF/support/OSEE_Sprint_Burndown.xls
new file mode 100644
index 00000000000..10bc765944c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/OSEE-INF/support/OSEE_Sprint_Burndown.xls
Binary files differ
diff --git a/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.rest.application.xml b/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.rest.application.xml
index 4715d64c385..a612a749ab5 100644
--- a/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.rest.application.xml
+++ b/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.rest.application.xml
@@ -8,4 +8,5 @@
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
<reference bind="setAtsServer" cardinality="1..1" interface="org.eclipse.osee.ats.rest.IAtsServer" name="IAtsServer" policy="static"/>
<reference bind="setCpaServiceRegistry" cardinality="1..1" interface="org.eclipse.osee.ats.rest.internal.cpa.CpaServiceRegistry" name="CpaServiceRegistry" policy="static"/>
+ <reference bind="setJdbcService" cardinality="1..1" interface="org.eclipse.osee.jdbc.JdbcService" name="JdbcService" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java
index b3e09af674b..c2f5aa77c6b 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java
@@ -44,6 +44,7 @@ import org.eclipse.osee.ats.rest.internal.workitem.StateResource;
import org.eclipse.osee.ats.rest.internal.world.WorldResource;
import org.eclipse.osee.framework.jdk.core.type.IResourceRegistry;
import org.eclipse.osee.framework.jdk.core.type.ResourceRegistry;
+import org.eclipse.osee.jdbc.JdbcService;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.template.engine.OseeTemplateTokens;
@@ -60,6 +61,7 @@ public class AtsApplication extends Application {
private OrcsApi orcsApi;
private IAtsServer atsServer;
private CpaServiceRegistry cpaRegistry;
+ private JdbcService jdbcService;
public void setOrcsApi(OrcsApi orcsApi) {
this.orcsApi = orcsApi;
@@ -73,6 +75,10 @@ public class AtsApplication extends Application {
this.atsServer = atsServer;
}
+ public void setJdbcService(JdbcService jdbcService) {
+ this.jdbcService = jdbcService;
+ }
+
public void setCpaServiceRegistry(CpaServiceRegistry cpaRegistry) {
this.cpaRegistry = cpaRegistry;
}
@@ -104,7 +110,7 @@ public class AtsApplication extends Application {
singletons.add(new WorldResource(atsServer));
// Endpoints
- singletons.add(new AgileEndpointImpl(atsServer, registry));
+ singletons.add(new AgileEndpointImpl(atsServer, registry, jdbcService));
singletons.add(new CountryEndpointImpl(atsServer));
singletons.add(new ProgramEndpointImpl(atsServer));
singletons.add(new InsertionEndpointImpl(atsServer));
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/AgileEndpointImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/AgileEndpointImpl.java
index 4369f948078..50e397f17d8 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/AgileEndpointImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/AgileEndpointImpl.java
@@ -25,6 +25,7 @@ import javax.ws.rs.core.UriInfo;
import org.codehaus.jackson.map.ObjectMapper;
import org.eclipse.nebula.widgets.xviewer.core.model.CustomizeData;
import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.agile.AgileBurndown;
import org.eclipse.osee.ats.api.agile.AgileEndpointApi;
import org.eclipse.osee.ats.api.agile.AgileItem;
import org.eclipse.osee.ats.api.agile.AgileUtil;
@@ -57,6 +58,7 @@ import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.jaxrs.OseeWebApplicationException;
+import org.eclipse.osee.jdbc.JdbcService;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.template.engine.PageCreator;
import org.eclipse.osee.template.engine.PageFactory;
@@ -71,10 +73,12 @@ public class AgileEndpointImpl implements AgileEndpointApi {
private final IAtsServer atsServer;
private final IResourceRegistry resourceRegistry;
private static ObjectMapper mapper;
+ private final JdbcService jdbcService;
- public AgileEndpointImpl(IAtsServer atsServer, IResourceRegistry resourceRegistry) {
+ public AgileEndpointImpl(IAtsServer atsServer, IResourceRegistry resourceRegistry, JdbcService jdbcService) {
this.atsServer = atsServer;
this.resourceRegistry = resourceRegistry;
+ this.jdbcService = jdbcService;
}
public void setUriInfo(UriInfo uriInfo) {
@@ -296,6 +300,45 @@ public class AgileEndpointImpl implements AgileEndpointApi {
return Response.ok().entity(result).build();
}
+ @Override
+ public Response getSprintBurndown(long teamUuid, long sprintUuid) {
+ if (teamUuid <= 0) {
+ throw new OseeWebApplicationException(Status.NOT_FOUND, "teamUuid is not valid");
+ }
+ if (sprintUuid <= 0) {
+ throw new OseeWebApplicationException(Status.NOT_FOUND, "sprintUuid is not valid");
+ }
+ ArtifactReadable sprintArt = getSprint(sprintUuid);
+ IAgileTeam agileTeam = atsServer.getAgileService().getAgileTeam(teamUuid);
+ IAgileSprint sprint = atsServer.getAgileService().getAgileSprint(sprintArt);
+
+ SprintBurndownDataBuilder builder = new SprintBurndownDataBuilder(agileTeam, sprint, atsServer, jdbcService);
+ AgileBurndown burndown = builder.get();
+
+ return Response.ok().entity(burndown).build();
+ }
+
+ @Override
+ public Response getSprintBurndownUi(long teamUuid, long sprintUuid) {
+ if (teamUuid <= 0) {
+ throw new OseeWebApplicationException(Status.NOT_FOUND, "teamUuid is not valid");
+ }
+ if (sprintUuid <= 0) {
+ throw new OseeWebApplicationException(Status.NOT_FOUND, "sprintUuid is not valid");
+ }
+ ArtifactReadable sprintArt = getSprint(sprintUuid);
+ IAgileTeam agileTeam = atsServer.getAgileService().getAgileTeam(teamUuid);
+ IAgileSprint sprint = atsServer.getAgileService().getAgileSprint(sprintArt);
+
+ SprintBurndownDataBuilder builder = new SprintBurndownDataBuilder(agileTeam, sprint, atsServer, jdbcService);
+ AgileBurndown burndown = builder.get();
+
+ SprintBurndownPageBuilder pageBuilder = new SprintBurndownPageBuilder(burndown);
+ String html = pageBuilder.getHtml();
+
+ return Response.ok().entity(html).build();
+ }
+
private ArtifactReadable getSprint(long sprintUuid) {
ArtifactReadable sprint = atsServer.getOrcsApi().getQueryFactory().fromBranch(CoreBranches.COMMON).andUuid(
new Long(sprintUuid).intValue()).getResults().getAtMostOneOrNull();
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/AgileService.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/AgileService.java
index a4b20571e18..bb5bb0af3b3 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/AgileService.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/AgileService.java
@@ -15,6 +15,7 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.agile.IAgileBacklog;
import org.eclipse.osee.ats.api.agile.IAgileFeatureGroup;
import org.eclipse.osee.ats.api.agile.IAgileItem;
@@ -37,6 +38,7 @@ import org.eclipse.osee.ats.rest.internal.agile.util.AgileFolders;
import org.eclipse.osee.ats.rest.internal.agile.util.AgileItemWriter;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.data.RelationTypeSide;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -304,20 +306,29 @@ public class AgileService implements IAgileService {
@Override
public Collection<IAgileItem> getItems(IAgileBacklog backlog) {
+ return getItems(backlog, AtsRelationTypes.Goal_Member);
+ }
+
+ private Collection<IAgileItem> getItems(IAtsObject backlogOrSprint, RelationTypeSide relationType) {
List<IAgileItem> items = new LinkedList<>();
- ArtifactReadable backlogArt = (ArtifactReadable) backlog.getStoreObject();
- for (ArtifactReadable art : backlogArt.getRelated(AtsRelationTypes.Goal_Member)) {
+ ArtifactReadable backlogArt = (ArtifactReadable) backlogOrSprint.getStoreObject();
+ for (ArtifactReadable art : backlogArt.getRelated(relationType)) {
if (art.isOfType(AtsArtifactTypes.AbstractWorkflowArtifact)) {
items.add(atsServer.getWorkItemFactory().getAgileItem(art));
} else {
- throw new OseeStateException("Inavlid artifact [%s] in backlog. Only workflows are allowed, not [%s]",
- art.toStringWithId(), art.getArtifactType().getName());
+ throw new OseeStateException("Inavlid artifact [%s] in [%s]. Only workflows are allowed, not [%s]",
+ art.toStringWithId(), backlogOrSprint, art.getArtifactType().getName());
}
}
return items;
}
@Override
+ public Collection<IAgileItem> getItems(IAgileSprint sprint) {
+ return getItems(sprint, AtsRelationTypes.AgileSprintToItem_AtsItem);
+ }
+
+ @Override
public Collection<IAgileFeatureGroup> getFeatureGroups(IAgileItem aItem) {
List<IAgileFeatureGroup> groups = new LinkedList<>();
ArtifactReadable itemArt = atsServer.getArtifact(aItem);
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/SprintBurndownDataBuilder.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/SprintBurndownDataBuilder.java
new file mode 100644
index 00000000000..b06fc4f9dcf
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/SprintBurndownDataBuilder.java
@@ -0,0 +1,294 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.agile;
+
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import org.eclipse.osee.ats.api.agile.AgileBurndown;
+import org.eclipse.osee.ats.api.agile.AgileBurndownDate;
+import org.eclipse.osee.ats.api.agile.IAgileItem;
+import org.eclipse.osee.ats.api.agile.IAgileSprint;
+import org.eclipse.osee.ats.api.agile.IAgileTeam;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.rest.IAtsServer;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.jdk.core.util.Collections;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jdbc.JdbcService;
+import org.eclipse.osee.jdbc.JdbcStatement;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SprintBurndownDataBuilder {
+
+ private static final String ART_ID_ADDED_TO_SPRINT_QUERY =
+ "select rel.B_ART_ID, rel.GAMMA_ID, txd.TIME from OSEE_RELATION_LINK rel, osee_txs " //
+ + "txs, osee_tx_details txd where rel.A_ART_ID = ? and rel.REL_LINK_TYPE_ID = 988214123009313457 and rel.B_ART_ID " //
+ + "in (ART_IDS) and txs.BRANCH_ID = ? and txs.TX_CURRENT = 1 and rel.GAMMA_ID = txs.GAMMA_ID and txs.TRANSACTION_ID = txd.TRANSACTION_ID";
+ private final IAtsServer atsServer;
+ private final IAgileSprint sprint;
+ private final IAgileTeam agileTeam;
+ private final JdbcService jdbcService;
+
+ public SprintBurndownDataBuilder(IAgileTeam agileTeam, IAgileSprint sprint, IAtsServer atsServer, JdbcService jdbcService) {
+ this.agileTeam = agileTeam;
+ this.sprint = sprint;
+ this.atsServer = atsServer;
+ this.jdbcService = jdbcService;
+ }
+
+ public AgileBurndown get() {
+ AgileBurndown burn = new AgileBurndown();
+ try {
+ ArtifactReadable sprintArt = (ArtifactReadable) sprint.getStoreObject();
+ burn.setSprintName(sprintArt.getName());
+ burn.setAgileTeamName(agileTeam.getName());
+ Date startDate = sprintArt.getSoleAttributeValue(AtsAttributeTypes.StartDate, null);
+ if (startDate == null) {
+ burn.setError("Start Date must be set on Sprint");
+ return burn;
+ }
+ startDate = clearTimeComponent(startDate);
+ burn.setStartDate(startDate);
+ Date endDate = sprintArt.getSoleAttributeValue(AtsAttributeTypes.EndDate, null);
+ if (endDate == null) {
+ burn.setError("End Date must be set on Sprint");
+ return burn;
+ }
+ endDate = clearTimeComponent(endDate);
+ burn.setEndDate(endDate);
+ burn.setHolidays(sprintArt.getAttributeValues(AtsAttributeTypes.Holiday));
+ Integer unPlannedPoints = sprintArt.getSoleAttributeValue(AtsAttributeTypes.UnPlannedPoints, 0);
+ burn.setUnPlannedPoints(unPlannedPoints);
+ Integer plannedPoints = sprintArt.getSoleAttributeValue(AtsAttributeTypes.PlannedPoints, 0);
+ burn.setPlannedPoints(plannedPoints);
+ burn.setPointsAttrTypeName(atsServer.getAttributeResolver().getSoleAttributeValue(agileTeam,
+ AtsAttributeTypes.PointsAttributeType, AtsAttributeTypes.Points.getName()));
+
+ int totalPoints = unPlannedPoints + plannedPoints;
+ long oneDay = 24 * 60 * 60 * 1000;
+ if (startDate != null && endDate != null) {
+ for (Date date = startDate; date.before(endDate) || date.equals(endDate); date =
+ new Date(date.getTime() + oneDay)) {
+ // Skip holidays and weekends
+ Calendar c = Calendar.getInstance();
+ c.setTime(date);
+ if (c.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || c.get(
+ Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || isHoliday(date, burn.getHolidays())) {
+ continue;
+ }
+ AgileBurndownDate bdDate = new AgileBurndownDate();
+ bdDate.setDate(date);
+ burn.getDates().add(bdDate);
+ }
+ }
+ Collection<IAgileItem> items = atsServer.getAgileService().getItems(sprint);
+ computeGoal(burn, totalPoints);
+
+ // compute total, unplanned and planned points
+ Date today = new Date();
+ Map<Long, Date> artIdToWalkupDate = retrieveWalkupAddedDate(sprint.getId(), items);
+ for (IAgileItem item : items) {
+ boolean completed = item.isCompletedOrCancelled();
+ boolean unPlanned =
+ atsServer.getAttributeResolver().getSoleAttributeValue(item, AtsAttributeTypes.UnPlannedWork, false);
+ Date completedCancelledDate = item.isCompleted() ? item.getCompletedDate() : item.getCancelledDate();
+ // loop through all dates and add points for dates after item was completed/cancelled
+ for (AgileBurndownDate dateBucket : burn.getDates()) {
+ if (completed) {
+ // all completed cells after today should be set to 0
+ if (completed && dateBucket.getDate().after(today)) {
+ dateBucket.setCompletedPlannedPoints(null);
+ dateBucket.setCompletedPoints(null);
+ dateBucket.setCompletedUnPlannedPoints(null);
+ }
+ // only get credit if completed after the date
+ else if (completed && dateBucket.getDate().after(completedCancelledDate)) {
+ double points = getPoints(burn, item);
+ if (unPlanned) {
+ // Only count walkup after the date it was added to the sprint
+ Date walkupAdded = artIdToWalkupDate.get(item.getId());
+ if (dateBucket.getDate().after(walkupAdded)) {
+ if (dateBucket.getCompletedUnPlannedPoints() != null) {
+ dateBucket.setCompletedUnPlannedPoints(dateBucket.getCompletedUnPlannedPoints() + points);
+ } else {
+ dateBucket.setCompletedUnPlannedPoints(points);
+ }
+ }
+ } else {
+ if (dateBucket.getCompletedPlannedPoints() != null) {
+ dateBucket.setCompletedPlannedPoints(dateBucket.getCompletedPlannedPoints() + points);
+ } else {
+ dateBucket.setCompletedPlannedPoints(points);
+ }
+ }
+ }
+ }
+ if (unPlanned) {
+ Date walkupAdded = artIdToWalkupDate.get(item.getId());
+ boolean walkupAddedBeforeDateBucket = walkupAdded.before(dateBucket.getDate());
+ boolean walkupCompletedAfterDateBucket =
+ completed ? completedCancelledDate.after(dateBucket.getDate()) : false;
+ // walkup was inWork at this date
+ if (walkupAddedBeforeDateBucket && (!completed || walkupCompletedAfterDateBucket)) {
+ double points = getPoints(burn, item);
+ if (dateBucket.getInCompletedUnPlannedPoints() != null) {
+ dateBucket.setInCompletedUnPlannedPoints(dateBucket.getInCompletedUnPlannedPoints() + points);
+ } else {
+ dateBucket.setInCompletedUnPlannedPoints(points);
+ }
+
+ }
+
+ }
+ }
+ }
+ computeCompleted(burn);
+ computeUnrealizedWalkup(burn);
+ } catch (Exception ex) {
+ burn.setError("Error generating burndown data: \n\n" + Lib.exceptionToString(ex));
+ }
+ return burn;
+ }
+
+ private void computeCompleted(AgileBurndown burn) {
+ for (AgileBurndownDate date : burn.getDates()) {
+ Double completedUnPlannedPoints = date.getCompletedUnPlannedPoints();
+ if (completedUnPlannedPoints == null) {
+ completedUnPlannedPoints = 0.0;
+ }
+ Double copmletedPlannedPoints = date.getCompletedPlannedPoints();
+ if (copmletedPlannedPoints == null) {
+ copmletedPlannedPoints = 0.0;
+ }
+ double completed = completedUnPlannedPoints + copmletedPlannedPoints;
+ if (completed < 0) {
+ completed = 0;
+ }
+ date.setCompletedPoints(completed);
+ }
+ }
+
+ private void computeUnrealizedWalkup(AgileBurndown burn) {
+ for (AgileBurndownDate date : burn.getDates()) {
+ Double completedUnPlannedPoints = date.getCompletedUnPlannedPoints();
+ if (completedUnPlannedPoints == null) {
+ completedUnPlannedPoints = 0.0;
+ }
+ Double inCompleteUnPlannedPoints = date.getInCompletedUnPlannedPoints();
+ if (inCompleteUnPlannedPoints == null) {
+ inCompleteUnPlannedPoints = 0.0;
+ }
+ double unRealizedWalkup = burn.getUnPlannedPoints() - completedUnPlannedPoints - inCompleteUnPlannedPoints;
+ if (unRealizedWalkup < 0) {
+ unRealizedWalkup = 0;
+ }
+ date.setUnRealizedWalkup(unRealizedWalkup);
+ }
+ }
+
+ private Map<Long, Date> retrieveWalkupAddedDate(Long sprintId, Collection<IAgileItem> items) {
+ List<Long> artIds = new LinkedList<>();
+ for (IAgileItem item : items) {
+ boolean unPlanned =
+ atsServer.getAttributeResolver().getSoleAttributeValue(item, AtsAttributeTypes.UnPlannedWork, false);
+ if (unPlanned) {
+ artIds.add(item.getId());
+ }
+ }
+ JdbcStatement chStmt = jdbcService.getClient().getStatement();
+ Map<Long, Date> artIdToWalkupDate = new HashMap<>();
+ String artIdsStr = Collections.toString(",", artIds);
+ try {
+ String query = ART_ID_ADDED_TO_SPRINT_QUERY.replaceFirst("ART_IDS", artIdsStr);
+ chStmt.runPreparedQuery(query, sprintId, atsServer.getAtsBranch().getId());
+ while (chStmt.next()) {
+ long artId = chStmt.getLong("B_ART_ID");
+ Date date = chStmt.getDate("time");
+ artIdToWalkupDate.put(artId, date);
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ } finally {
+ chStmt.close();
+ }
+ return artIdToWalkupDate;
+ }
+
+ private Date clearTimeComponent(Date date) {
+ Calendar cal = Calendar.getInstance(); // locale-specific
+ cal.setTime(date);
+ cal.set(Calendar.HOUR_OF_DAY, 23);
+ cal.set(Calendar.MINUTE, 59);
+ cal.set(Calendar.SECOND, 59);
+ cal.set(Calendar.MILLISECOND, 0);
+ cal.set(Calendar.AM_PM, Calendar.PM);
+ return cal.getTime();
+ }
+
+ private double getPoints(AgileBurndown burn, IAgileItem item) {
+ IAttributeType pointsType =
+ atsServer.getOrcsApi().getOrcsTypes().getAttributeTypes().getByName(burn.getPointsAttrTypeName());
+ String value = atsServer.getAttributeResolver().getSoleAttributeValueAsString(item, pointsType, "");
+ if (Strings.isNumeric(value)) {
+ return Double.valueOf(value);
+ }
+ return 0;
+ }
+
+ private void computeGoal(AgileBurndown burn, int totalPoints) {
+ int numDates = burn.getDates().size();
+ int count = 1;
+ int numWorkDays = numDates - 2;
+ double pointsPerDay = totalPoints / numWorkDays;
+ // set Goal value
+ for (AgileBurndownDate date : burn.getDates()) {
+ // first day is sprint planning; second gets no work done
+ if (count == 1 || count == 2) {
+ date.setGoalPoints(Double.valueOf(totalPoints));
+ }
+ // last day should be done
+ else if (count == numDates) {
+ date.setGoalPoints(Double.valueOf(0));
+ } else {
+ double goalPoints = totalPoints - (count * pointsPerDay);
+ if (goalPoints < 0) {
+ goalPoints = 0;
+ }
+ date.setGoalPoints(goalPoints);
+ }
+ count++;
+ }
+ }
+
+ private boolean isHoliday(Date date, List<Date> holidays) {
+ Calendar dateCal = Calendar.getInstance();
+ dateCal.setTime(date);
+ for (Date holiday : holidays) {
+ Calendar holCal = Calendar.getInstance();
+ holCal.setTime(holiday);
+ boolean sameDay = dateCal.get(Calendar.YEAR) == holCal.get(Calendar.YEAR) && dateCal.get(
+ Calendar.DAY_OF_YEAR) == holCal.get(Calendar.DAY_OF_YEAR);
+ if (sameDay) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/SprintBurndownPageBuilder.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/SprintBurndownPageBuilder.java
new file mode 100644
index 00000000000..9ca0162d227
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/SprintBurndownPageBuilder.java
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.agile;
+
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.api.agile.AgileBurndown;
+import org.eclipse.osee.ats.api.agile.AgileBurndownDate;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.jdk.core.util.DateUtil;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SprintBurndownPageBuilder {
+
+ private static final String N_A = "0";
+ private final AgileBurndown burn;
+
+ public SprintBurndownPageBuilder(AgileBurndown burn) {
+ this.burn = burn;
+ }
+
+ public String getHtml() {
+
+ Date today = new Date();
+
+ StringBuilder sb = new StringBuilder();
+ sb.append(AHTML.beginMultiColumnTable(95, 1));
+
+ // Add Sprint row
+ sb.append(AHTML.addRowMultiColumnTable("Sprint", burn.getSprintName()));
+
+ // Add Start row
+ sb.append(AHTML.addRowMultiColumnTable("Start", DateUtil.get(burn.getStartDate(), DateUtil.MMDDYY), "End",
+ DateUtil.get(burn.getEndDate(), DateUtil.MMDDYY), "", "Days", String.valueOf(burn.getDates().size()),
+ "Planned", String.valueOf(burn.getPlannedPoints().toString()), "Un-Planned",
+ String.valueOf(burn.getUnPlannedPoints().toString())));
+
+ // Add Holidays
+ List<String> holidays = new LinkedList<>();
+ holidays.add("Holidays");
+ for (Date holiday : burn.getHolidays()) {
+ holidays.add(DateUtil.get(holiday, DateUtil.MMDDYY));
+ }
+ sb.append(AHTML.addRowMultiColumnTable(holidays.toArray(new String[holidays.size()])));
+
+ // Add day number row
+ List<String> strs = new LinkedList<>();
+ strs.add("");
+ for (int count = 1; count <= burn.getDates().size(); count++) {
+ strs.add(String.valueOf(count));
+ }
+ sb.append(AHTML.addRowMultiColumnTable(strs.toArray(new String[strs.size()])));
+
+ // Add dates row
+ strs = new LinkedList<>();
+ strs.add("");
+ for (AgileBurndownDate date : burn.getDates()) {
+ strs.add(DateUtil.get(date.getDate(), DateUtil.MMDDYY));
+ }
+ sb.append(AHTML.addRowMultiColumnTable(strs.toArray(new String[strs.size()])));
+
+ // Add Total Points
+ strs = new LinkedList<>();
+ strs.add("Total Points");
+ for (int count = 1; count <= burn.getDates().size(); count++) {
+ strs.add(String.valueOf(burn.getPlannedPoints() + burn.getUnPlannedPoints()));
+ }
+ sb.append(AHTML.addRowMultiColumnTable(strs.toArray(new String[strs.size()])));
+
+ // Add Goal
+ strs = new LinkedList<>();
+ strs.add("Goal");
+ for (AgileBurndownDate date : burn.getDates()) {
+ strs.add(String.valueOf(date.getGoalPoints()));
+ }
+ sb.append(AHTML.addRowMultiColumnTable(strs.toArray(new String[strs.size()])));
+
+ // Add Planned Complete
+ strs = new LinkedList<>();
+ strs.add("Planned Complete");
+ for (AgileBurndownDate date : burn.getDates()) {
+ if (date.getDate().after(today)) {
+ strs.add(N_A);
+ } else {
+ strs.add(String.valueOf(date.getCompletedPlannedPoints()));
+ }
+ }
+ sb.append(AHTML.addRowMultiColumnTable(strs.toArray(new String[strs.size()])));
+
+ // Add Planned Remaining
+ strs = new LinkedList<>();
+ strs.add("Planned Remaining");
+ for (AgileBurndownDate date : burn.getDates()) {
+ if (date.getCompletedPlannedPoints() == null) {
+ strs.add(N_A);
+ } else {
+ strs.add(String.valueOf(burn.getPlannedPoints() - date.getCompletedPlannedPoints()));
+ }
+ }
+ sb.append(AHTML.addRowMultiColumnTable(strs.toArray(new String[strs.size()])));
+
+ // Add UnPlanned Complete
+ strs = new LinkedList<>();
+ strs.add("UnPlanned Complete");
+ for (AgileBurndownDate date : burn.getDates()) {
+ if (date.getCompletedUnPlannedPoints() == null) {
+ strs.add(N_A);
+ } else {
+ strs.add(String.valueOf(date.getCompletedUnPlannedPoints()));
+ }
+ }
+ sb.append(AHTML.addRowMultiColumnTable(strs.toArray(new String[strs.size()])));
+
+ // Add UnPlanned Incomplete
+ strs = new LinkedList<>();
+ strs.add("UnPlanned Incomplete");
+ for (AgileBurndownDate date : burn.getDates()) {
+ if (date.getCompletedUnPlannedPoints() == null) {
+ strs.add(N_A);
+ } else {
+ strs.add(String.valueOf(date.getInCompletedUnPlannedPoints()));
+ }
+ }
+ sb.append(AHTML.addRowMultiColumnTable(strs.toArray(new String[strs.size()])));
+
+ // Add UnPlanned Unrealized
+ strs = new LinkedList<>();
+ strs.add("UnPlanned Unrealized");
+ for (AgileBurndownDate date : burn.getDates()) {
+ if (date.getCompletedUnPlannedPoints() == null) {
+ strs.add(N_A);
+ } else {
+ strs.add(String.valueOf(date.getUnRealizedWalkup())); // TBD
+ }
+ }
+ sb.append(AHTML.addRowMultiColumnTable(strs.toArray(new String[strs.size()])));
+
+ // Add Total Completed
+ strs = new LinkedList<>();
+ strs.add("Total Completed");
+ for (AgileBurndownDate date : burn.getDates()) {
+ if (date.getCompletedPoints() == null) {
+ strs.add(N_A);
+ } else {
+ strs.add(String.valueOf(date.getCompletedPoints()));
+ }
+ }
+ sb.append(AHTML.addRowMultiColumnTable(strs.toArray(new String[strs.size()])));
+
+ // Add Total Remaining
+ strs = new LinkedList<>();
+ strs.add("Total Remaining");
+ for (AgileBurndownDate date : burn.getDates()) {
+ if (date.getDate().after(today)) {
+ strs.add(N_A);
+ } else {
+ strs.add(String.valueOf(
+ ((burn.getPlannedPoints() - date.getCompletedPlannedPoints()) + date.getUnRealizedWalkup() + date.getInCompletedUnPlannedPoints())));
+ }
+ }
+ sb.append(AHTML.addRowMultiColumnTable(strs.toArray(new String[strs.size()])));
+
+ sb.append(AHTML.endMultiColumnTable());
+ return AHTML.simplePage(sb.toString());
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/model/WorkItem.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/model/WorkItem.java
index 2001a360f8f..2cdd119e491 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/model/WorkItem.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/model/WorkItem.java
@@ -23,6 +23,7 @@ import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.eclipse.osee.ats.api.workdef.IWorkDefinitionMatch;
+import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workflow.IAtsAction;
import org.eclipse.osee.ats.api.workflow.IAtsGoal;
import org.eclipse.osee.ats.api.workflow.IAtsTask;
@@ -190,10 +191,11 @@ public class WorkItem extends AtsObject implements IAtsWorkItem {
@Override
public IAtsStateDefinition getStateDefinition() {
- if (getStateMgr().getCurrentStateName() == null) {
+ String currentStateName = getStateMgr().getCurrentStateName();
+ if (currentStateName == null) {
return null;
}
- return getWorkDefinition().getStateByName(getStateMgr().getCurrentStateName());
+ return getWorkDefinition().getStateByName(currentStateName);
}
public IAtsStateDefinition getStateDefinitionByName(String name) {
@@ -275,7 +277,7 @@ public class WorkItem extends AtsObject implements IAtsWorkItem {
@Override
public boolean isCompleted() {
- return getStateMgr().getStateType().isCompleted();
+ return artifact.getSoleAttributeValue(AtsAttributeTypes.CurrentStateType, "").equals(StateType.Completed.name());
}
@Override
@@ -285,7 +287,7 @@ public class WorkItem extends AtsObject implements IAtsWorkItem {
@Override
public boolean isCancelled() {
- return getStateMgr().getStateType().isCancelled();
+ return artifact.getSoleAttributeValue(AtsAttributeTypes.CurrentStateType, "").equals(StateType.Cancelled.name());
}
@Override
diff --git a/plugins/org.eclipse.osee.ats/support/OseeTypes_ATS.osee b/plugins/org.eclipse.osee.ats/support/OseeTypes_ATS.osee
index 014a9bbc0a2..1186caeb389 100644
--- a/plugins/org.eclipse.osee.ats/support/OseeTypes_ATS.osee
+++ b/plugins/org.eclipse.osee.ats/support/OseeTypes_ATS.osee
@@ -27,6 +27,9 @@ artifactType "Agile Feature Group" extends "ats.Ats Config Artifact" {
artifactType "Agile Sprint" extends "ats.State Machine" {
uuid 0x7E213FC7506C5E43
+ attribute "ats.Holiday"
+ attribute "ats.Planned Points"
+ attribute "ats.Un-Planned Points"
}
artifactType "Work Definition" extends "Artifact" {
@@ -308,6 +311,30 @@ oseeEnumType "enum.color.team" {
entry "Unspecified" entryGuid "74319308"
}
+attributeType "ats.Holiday" extends DateAttribute {
+ uuid 0x1000666112340FB
+ dataProvider DefaultAttributeDataProvider
+ min 0
+ max unlimited
+ mediaType "text/calendar"
+}
+
+attributeType "ats.Planned Points" extends IntegerAttribute {
+ uuid 0x033B418311442956
+ dataProvider DefaultAttributeDataProvider
+ min 0
+ max 1
+ mediaType "text/plain"
+}
+
+attributeType "ats.Un-Planned Points" extends IntegerAttribute {
+ uuid 0x03F1DFF4832FE702
+ dataProvider DefaultAttributeDataProvider
+ min 0
+ max 1
+ mediaType "text/plain"
+}
+
attributeType "ats.Work Type" extends StringAttribute {
uuid 0x1000555112340FB
dataProvider DefaultAttributeDataProvider
diff --git a/plugins/org.eclipse.osee.ats/support/WorkDef_Sprint.ats b/plugins/org.eclipse.osee.ats/support/WorkDef_Sprint.ats
index 95a28146b9e..5e64ddd0823 100644
--- a/plugins/org.eclipse.osee.ats/support/WorkDef_Sprint.ats
+++ b/plugins/org.eclipse.osee.ats/support/WorkDef_Sprint.ats
@@ -1,62 +1,84 @@
workDefinition "WorkDef_Sprint" {
- id "WorkDef_Sprint"
- startState "InWork"
-
- widgetDefinition "Title" {
- attributeName "Name"
- xWidgetName "XTextDam"
- option REQUIRED_FOR_TRANSITION
- }
-
- widgetDefinition "Description" {
- attributeName "ats.Description"
- xWidgetName "XTextDam"
- option FILL_VERTICALLY
- }
-
- widgetDefinition "Start Date" {
- attributeName "ats.Start Date"
- xWidgetName "XDateDam"
- option HORIZONTAL_LABEL
- }
-
- widgetDefinition "End Date" {
- attributeName "ats.End Date"
- xWidgetName "XDateDam"
- option HORIZONTAL_LABEL
- }
-
- widgetDefinition "XRunSprintReportButton" {
- xWidgetName "XRunSprintReportButton"
- }
-
- state "Cancelled" {
- type Cancelled
- ordinal 3
- to "InWork" OverrideAttributeValidation
- }
-
- state "InWork" {
- type Working
- ordinal 1
- to "Cancelled"
- to "Completed" AsDefault
- layout {
- composite {
- numColumns 6
- widget "Start Date"
- widget "End Date"
- widget "XRunSprintReportButton"
- }
- widget "Title"
- widget "Description"
- }
- }
-
- state "Completed" {
- type Completed
- ordinal 2
- to "InWork" OverrideAttributeValidation
- rule AddDecisionValidateBlockingReview
- }
+ id "WorkDef_Sprint"
+ startState "InWork"
+
+ widgetDefinition "Title" {
+ attributeName "Name"
+ xWidgetName "XTextDam"
+ option REQUIRED_FOR_TRANSITION
+ }
+
+ widgetDefinition "Holiday" {
+ attributeName "ats.Holiday"
+ description "Holidays during Agile Sprint"
+ xWidgetName "XDateDam"
+ }
+
+ widgetDefinition "Un-Planned Points" {
+ attributeName "ats.Un-Planned Points"
+ xWidgetName "XIntegerDam"
+ }
+
+ widgetDefinition "Planned Points" {
+ attributeName "ats.Planned Points"
+ xWidgetName "XIntegerDam"
+ }
+
+ widgetDefinition "Description" {
+ attributeName "ats.Description"
+ xWidgetName "XTextDam"
+ option FILL_VERTICALLY
+ }
+
+ widgetDefinition "Start Date" {
+ attributeName "ats.Start Date"
+ xWidgetName "XDateDam"
+ option HORIZONTAL_LABEL
+ }
+
+ widgetDefinition "End Date" {
+ attributeName "ats.End Date"
+ xWidgetName "XDateDam"
+ option HORIZONTAL_LABEL
+ }
+
+ widgetDefinition "Run Sprint Summary" {
+ xWidgetName "XRunSprintReportButton"
+ }
+
+ state "Cancelled" {
+ type Cancelled
+ ordinal 3
+ to "InWork" OverrideAttributeValidation
+ }
+
+ state "InWork" {
+ type Working
+ ordinal 1
+ to "Cancelled"
+ to "Completed" AsDefault
+ layout {
+ composite {
+ numColumns 6
+ widget "Start Date"
+ widget "End Date"
+ widget "Run Sprint Summary"
+ }
+ widget "Holiday"
+ composite {
+ numColumns 4
+ widget "Planned Points"
+ widget "Un-Planned Points"
+ }
+ widget "Title"
+ widget "Description"
+ }
+ }
+
+ state "Completed" {
+ type Completed
+ ordinal 2
+ to "InWork" OverrideAttributeValidation
+ rule AddDecisionValidateBlockingReview
+ }
} \ No newline at end of file

Back to the top