Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-10-10 17:14:36 -0400
committerDonald Dunne2017-10-10 18:10:47 -0400
commite81c81d68e0b6a00affbfa905e6f0df6feedfe56 (patch)
tree41cc7552cb44e0f6fa614a349a4bd52f16bd1e49
parent70d2d5dd6d60f4e211839063fb38302b50041231 (diff)
downloadorg.eclipse.osee-e81c81d68e0b6a00affbfa905e6f0df6feedfe56.tar.gz
org.eclipse.osee-e81c81d68e0b6a00affbfa905e6f0df6feedfe56.tar.xz
org.eclipse.osee-e81c81d68e0b6a00affbfa905e6f0df6feedfe56.zip
bug[ats_TW2790]: Create TRAX Action gives class cast exception0.25.1.v201710102214-NR
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java7
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ConvertAtsConfigGuidAttributesOperations.java18
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java5
4 files changed, 28 insertions, 7 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java
index ab627ec8ee..e5947a6c88 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java
@@ -150,4 +150,9 @@ public interface IAtsChangeSet {
List<IAtsWorkItem> getWorkItemsCreated();
+ /**
+ * This can be removed when both the client and server accept ArtifactId as a value. In 25.0, client accepts
+ * ArtifactId while server expects String.
+ */
+ void addArtifactReferencedAttribute(ArtifactId artifact, AttributeTypeId attributeType, ArtifactId artifactRef);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java
index b5d7c84a6a..06b265c506 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsChangeSet.java
@@ -39,7 +39,6 @@ import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
-import org.eclipse.osee.framework.jdk.core.util.ElapsedTime;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
@@ -405,4 +404,10 @@ public class AtsChangeSet extends AbstractAtsChangeSet {
art.deleteRelations(relationSide);
}
+ @Override
+ public void addArtifactReferencedAttribute(ArtifactId artifact, AttributeTypeId attributeType, ArtifactId artifactRef) {
+ Artifact art = getArtifact(artifact);
+ art.addAttributeFromString(attributeType, artifactRef.getId().toString());
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ConvertAtsConfigGuidAttributesOperations.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ConvertAtsConfigGuidAttributesOperations.java
index b2d9c3f588..d9f25154ed 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ConvertAtsConfigGuidAttributesOperations.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ConvertAtsConfigGuidAttributesOperations.java
@@ -51,7 +51,7 @@ public class ConvertAtsConfigGuidAttributesOperations {
}
for (ArtifactId need : neededAiRefIds) {
- changes.addAttribute(art, AtsAttributeTypes.ActionableItemReference, need);
+ changes.addArtifactReferencedAttribute(art, AtsAttributeTypes.ActionableItemReference, need);
}
// convert id to guid
@@ -62,12 +62,17 @@ public class ConvertAtsConfigGuidAttributesOperations {
}
List<String> neededAiGuidIds = new LinkedList<>();
- Collection<ArtifactId> aiArts =
+ Collection<Object> aiArts =
services.getAttributeResolver().getAttributeValues(art, AtsAttributeTypes.ActionableItemReference);
- for (ArtifactId id : aiArts) {
- IAtsActionableItem ai = services.getConfigItem(id);
+ for (Object obj : aiArts) {
+ IAtsActionableItem ai = null;
+ if (obj instanceof ArtifactId) {
+ ai = services.getConfigItem((ArtifactId) obj);
+ } else {
+ ai = services.getConfigItem(Long.valueOf((String) obj));
+ }
if (ai == null) {
- services.getLogger().error("AI not found for id " + id + " for art " + art.toStringWithId());
+ services.getLogger().error("AI not found for id " + obj + " for art " + art.toStringWithId());
} else if (!currentAiGuidIds.contains(ai.getStoreObject().getGuid())) {
neededAiGuidIds.add(ai.getStoreObject().getGuid());
}
@@ -86,7 +91,8 @@ public class ConvertAtsConfigGuidAttributesOperations {
String teamDefGuid = services.getAttributeResolver().getSoleAttributeValue(art, TeamDefinition, "");
if (Strings.isValid(teamDefGuid)) {
IAtsTeamDefinition teamDef = services.getConfigItem(teamDefGuid);
- changes.setSoleAttributeValue(art, AtsAttributeTypes.TeamDefinitionReference, teamDef.getStoreObject());
+ changes.addArtifactReferencedAttribute(art, AtsAttributeTypes.TeamDefinitionReference,
+ teamDef.getStoreObject());
}
}
// convert id to guid
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
index 56a9e01673..1636955f02 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
@@ -367,4 +367,9 @@ public class AtsChangeSet extends AbstractAtsChangeSet {
add(art);
}
+ @Override
+ public void addArtifactReferencedAttribute(ArtifactId artifact, AttributeTypeId attributeType, ArtifactId artifactRef) {
+ addAttribute(artifact, attributeType, artifactRef.getId().toString());
+ }
+
}

Back to the top