diff options
Diffstat (limited to 'plugins')
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 ab627ec8eed..e5947a6c882 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 b5d7c84a6af..06b265c506f 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 b2d9c3f5882..d9f25154ed4 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 56a9e01673f..1636955f02a 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()); + } + } |