Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2014-01-21 23:03:26 +0000
committerdonald.g.dunne2014-01-24 18:49:11 +0000
commitda89366c57538033364a7d2ca40de6e8467f9211 (patch)
tree3081c0e6ed190b2e54a3004e884ec80be0439a08 /plugins
parent513b583b2d3741a4fd28cf1d4984186dfe895461 (diff)
downloadorg.eclipse.osee-da89366c57538033364a7d2ca40de6e8467f9211.tar.gz
org.eclipse.osee-da89366c57538033364a7d2ca40de6e8467f9211.tar.xz
org.eclipse.osee-da89366c57538033364a7d2ca40de6e8467f9211.zip
bug[ats_ATS9613]: Exception on ATS Create New Version
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsObject.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifact.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AbstractAtsArtifact.java10
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsArtifactStore.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUser.java9
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java71
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockAtsUser.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java10
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/model/impl/AtsObject.java8
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUser.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsRelationChange.java55
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/user/AtsUser.java9
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/AtsConfigObject.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java9
16 files changed, 197 insertions, 16 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsObject.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsObject.java
index fb659c463f..a0d879ad0e 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsObject.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsObject.java
@@ -24,4 +24,6 @@ public interface IAtsObject extends Identifiable<String>, HasDescription {
Object getStoreObject();
+ void setStoreObject(Object object);
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifact.java
index e568e8518b..ff30399ad0 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifact.java
@@ -82,4 +82,9 @@ public class ActionArtifact extends Artifact implements IAtsAction {
return this;
}
+ @Override
+ public void setStoreObject(Object object) {
+ // do nothing
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AbstractAtsArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AbstractAtsArtifact.java
index c680585412..9768e6503d 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AbstractAtsArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/artifact/AbstractAtsArtifact.java
@@ -29,4 +29,14 @@ public abstract class AbstractAtsArtifact extends Artifact implements IAtsObject
return null;
}
+ @Override
+ public Object getStoreObject() {
+ return this;
+ }
+
+ @Override
+ public void setStoreObject(Object object) {
+ // do nothing
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsArtifactStore.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsArtifactStore.java
index eaeaf7b3a6..e0fb2305dd 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsArtifactStore.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsArtifactStore.java
@@ -44,7 +44,9 @@ public class AtsArtifactStore implements IAtsArtifactStore {
IAtsArtifactWriter<T> writer = getWriter(configObject.getClass());
Conditions.checkNotNull(writer, "writer");
- return writer.store(configObject, cache, changes);
+ Artifact art = writer.store(configObject, cache, changes);
+ configObject.setStoreObject(art);
+ return art;
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUser.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUser.java
index ed975c4dca..6d078756b6 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUser.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUser.java
@@ -20,7 +20,7 @@ import org.eclipse.osee.framework.skynet.core.User;
*/
public class AtsUser implements IAtsUser {
- private final User user;
+ private User user;
public AtsUser(User user) {
this.user = user;
@@ -149,4 +149,11 @@ public class AtsUser implements IAtsUser {
return user;
}
+ @Override
+ public void setStoreObject(Object object) {
+ if (object instanceof User) {
+ this.user = (User) object;
+ }
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java
index bcbbaad24c..a2d4e12d56 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java
@@ -10,13 +10,21 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.client.util;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
+import org.eclipse.osee.ats.api.IAtsConfigObject;
+import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.util.IExecuteListener;
import org.eclipse.osee.ats.api.workflow.IAttribute;
import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.util.AbstractAtsChangeSet;
+import org.eclipse.osee.ats.core.util.AtsRelationChange;
+import org.eclipse.osee.ats.core.util.AtsRelationChange.RelationOperation;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
@@ -24,6 +32,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
@@ -43,24 +52,36 @@ public class AtsChangeSet extends AbstractAtsChangeSet {
throw new OseeArgumentException("objects/deleteObjects cannot be empty");
}
SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtilCore.getAtsBranchToken(), comment);
+ // First, create or update any artifacts that changed
for (Object obj : new CopyOnWriteArrayList<Object>(objects)) {
if (obj instanceof IAtsWorkItem) {
IAtsWorkItem workItem = (IAtsWorkItem) obj;
if (workItem.getStateMgr().isDirty()) {
AtsCore.getStateFactory().writeToStore(workItem, this);
+ ((Artifact) workItem.getStoreObject()).persist(transaction);
}
if (workItem.getLog().isDirty()) {
AtsCore.getLogFactory().writeToStore(workItem, AtsClientService.get().getAttributeResolver(), this);
+ ((Artifact) workItem.getStoreObject()).persist(transaction);
}
+ } else if (obj instanceof IAtsConfigObject) {
+ IAtsConfigObject configObj = (IAtsConfigObject) obj;
+ Artifact storeConfigObject = AtsClientService.get().storeConfigObject(configObj, this);
+ storeConfigObject.persist(transaction);
}
- }
- for (Object obj : objects) {
if (obj instanceof Artifact) {
((Artifact) obj).persist(transaction);
- } else {
- throw new OseeArgumentException("ATsChangeSet: Unhandled object type: " + obj);
+ } else if (obj instanceof IAtsObject && ((IAtsObject) obj).getStoreObject() instanceof Artifact) {
+ ((Artifact) ((IAtsObject) obj).getStoreObject()).persist(transaction);
+ }
+ }
+ // Second, add or delete any relations; this has to be done separate so all artifacts are created
+ for (Object obj : objects) {
+ if (obj instanceof AtsRelationChange) {
+ execute((AtsRelationChange) obj, transaction);
}
}
+ // Third, delete any desired objects
for (Object obj : deleteObjects) {
if (obj instanceof Artifact) {
((Artifact) obj).deleteAndPersist(transaction);
@@ -74,6 +95,48 @@ public class AtsChangeSet extends AbstractAtsChangeSet {
}
}
+ private void execute(AtsRelationChange relChange, SkynetTransaction transaction) {
+ Conditions.checkNotNull(relChange, "relChange");
+ Conditions.checkNotNull(relChange.getRelationSide(), "relationSide");
+ Object obj = relChange.getObject();
+ Artifact art = getArtifact(obj);
+ Conditions.checkNotNull(art, "artifact");
+ Collection<Object> objects = relChange.getObjects();
+ Conditions.checkNotNullOrEmpty(objects, "objects");
+ Set<Artifact> arts = new HashSet<Artifact>();
+ for (Object obj2 : objects) {
+ Artifact art2 = getArtifact(obj2);
+ Conditions.checkNotNull(art2, "toArtifact");
+ arts.add(art2);
+ }
+ for (Artifact artifact : arts) {
+ List<Artifact> relatedArtifacts = art.getRelatedArtifacts(relChange.getRelationSide());
+ if (relChange.getOperation() == RelationOperation.Add && !relatedArtifacts.contains(artifact)) {
+ art.addRelation(relChange.getRelationSide(), artifact);
+ } else if (relChange.getOperation() == RelationOperation.Delete && relatedArtifacts.contains(artifact)) {
+ art.deleteRelation(relChange.getRelationSide(), artifact);
+ }
+ }
+ art.persist(transaction);
+ }
+
+ private Artifact getArtifact(Object obj) {
+ Artifact art = null;
+ if (obj instanceof Artifact) {
+ art = (Artifact) obj;
+ } else if (obj instanceof IAtsObject) {
+ IAtsObject atsObject = (IAtsObject) obj;
+ Object storeObject = atsObject.getStoreObject();
+ if (storeObject != null) {
+ art = getArtifact(storeObject);
+ }
+ if (art == null) {
+ art = ArtifactQuery.getArtifactFromId(atsObject.getGuid(), AtsUtilClient.getAtsBranch());
+ }
+ }
+ return art;
+ }
+
public void addTo(SkynetTransaction transaction) throws OseeCoreException {
Conditions.checkNotNull(transaction, "transaction");
for (Object obj : objects) {
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java
index 4d1bc19117..d735ed6299 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java
@@ -765,9 +765,4 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
changes.setSoleAttributeValue(this, AtsAttributeTypes.AtsId, atsId);
}
- @Override
- public Object getStoreObject() {
- return this;
- }
-
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockAtsUser.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockAtsUser.java
index b45fd2ca4c..a11739a08e 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockAtsUser.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockAtsUser.java
@@ -132,4 +132,9 @@ public class MockAtsUser implements IAtsUser {
return null;
}
+ @Override
+ public void setStoreObject(Object object) {
+ // do nothing
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java
index 363cd81ea0..558b254cad 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java
@@ -159,4 +159,9 @@ public class MockWorkItem implements IAtsWorkItem {
return null;
}
+ @Override
+ public void setStoreObject(Object object) {
+ // do nothing
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java
index f10179bb96..f1d69cdbfc 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java
@@ -184,6 +184,11 @@ public class CoreAtsUsersTest {
public String getGuid() {
return "ASE434dfgsdfgs";
}
+
+ @Override
+ public void setStoreObject(Object object) {
+ // do nothing
+ }
};
private class ExceptionUser implements IAtsUser {
@@ -237,5 +242,10 @@ public class CoreAtsUsersTest {
public Object getStoreObject() {
return null;
}
+
+ @Override
+ public void setStoreObject(Object object) {
+ // do nothing
+ }
};
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/model/impl/AtsObject.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/model/impl/AtsObject.java
index 91c805fe28..76055d1dcb 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/model/impl/AtsObject.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/model/impl/AtsObject.java
@@ -19,6 +19,7 @@ import org.eclipse.osee.framework.jdk.core.type.FullyNamedIdentity;
public class AtsObject extends FullyNamedIdentity<String> implements IAtsObject {
private String desc;
+ private Object object;
public AtsObject(String name, String guid) {
super(guid, name);
@@ -81,7 +82,12 @@ public class AtsObject extends FullyNamedIdentity<String> implements IAtsObject
@Override
public Object getStoreObject() {
- return null;
+ return object;
+ }
+
+ @Override
+ public void setStoreObject(Object object) {
+ this.object = object;
}
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUser.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUser.java
index 65608a1215..6c3a72f12c 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUser.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUser.java
@@ -123,4 +123,8 @@ public abstract class AbstractAtsUser implements IAtsUser {
return null;
}
+ @Override
+ public void setStoreObject(Object object) {
+ // do nothing
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsRelationChange.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsRelationChange.java
new file mode 100644
index 0000000000..3e78851856
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsRelationChange.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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.core.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import org.eclipse.osee.framework.core.data.IRelationTypeSide;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsRelationChange {
+
+ public static enum RelationOperation {
+ Add,
+ Delete;
+ }
+
+ private final Object object;
+ private final IRelationTypeSide relationSide;
+ private final Collection<Object> objects;
+ private final RelationOperation operation;
+
+ public AtsRelationChange(Object object, IRelationTypeSide relationSide, Collection<? extends Object> objects, RelationOperation operation) {
+ this.object = object;
+ this.relationSide = relationSide;
+ this.objects = new ArrayList<Object>(objects);
+ this.operation = operation;
+ }
+
+ public Object getObject() {
+ return object;
+ }
+
+ public IRelationTypeSide getRelationSide() {
+ return relationSide;
+ }
+
+ public Collection<Object> getObjects() {
+ return objects;
+ }
+
+ public RelationOperation getOperation() {
+ return operation;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/user/AtsUser.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/user/AtsUser.java
index 4d807edb53..31e2f81c7a 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/user/AtsUser.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/user/AtsUser.java
@@ -21,7 +21,7 @@ import org.eclipse.osee.orcs.data.ArtifactReadable;
*/
public class AtsUser implements IAtsUser {
- private final ArtifactReadable user;
+ private ArtifactReadable user;
public AtsUser(ArtifactReadable user) {
this.user = user;
@@ -146,4 +146,11 @@ public class AtsUser implements IAtsUser {
return user;
}
+ @Override
+ public void setStoreObject(Object object) {
+ if (object instanceof ArtifactReadable) {
+ this.user = (ArtifactReadable) object;
+ }
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/AtsConfigObject.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/AtsConfigObject.java
index 5bab143d4d..e78be91cd3 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/AtsConfigObject.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/workitem/AtsConfigObject.java
@@ -109,7 +109,7 @@ public abstract class AtsConfigObject extends org.eclipse.osee.ats.core.model.im
@Override
public Object getStoreObject() {
- return artifact;
+ return (artifact != null ? artifact : super.getStoreObject());
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java
index 9d330def93..8e332dfe68 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/version/CreateNewVersionItem.java
@@ -13,16 +13,19 @@ package org.eclipse.osee.ats.version;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
-import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
+import org.eclipse.osee.ats.core.util.AtsRelationChange;
+import org.eclipse.osee.ats.core.util.AtsRelationChange.RelationOperation;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
@@ -120,8 +123,10 @@ public class CreateNewVersionItem extends XNavigateItemAction {
for (String newVer : newVersionNames) {
IAtsVersion version = AtsClientService.get().createVersion(newVer);
versions.add(version);
- AtsVersionService.get().setTeamDefinition(version, teamDefHoldingVersions);
changes.add(version);
+ changes.add(new AtsRelationChange(teamDefHoldingVersions,
+ AtsRelationTypes.TeamDefinitionToVersion_Version, Collections.singleton(version),
+ RelationOperation.Add));
}
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);

Back to the top