Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2017-07-31 17:47:07 -0400
committerRyan D. Brooks2017-08-16 00:14:43 -0400
commit354ecd4dbbacacd1abc09a7c90846abaa699a385 (patch)
treebe40fbd346b5c22fb03706127af1af06d3c7fa22
parent22fca604da5703cb30c799a15471e93c565db750 (diff)
downloadorg.eclipse.osee-354ecd4dbbacacd1abc09a7c90846abaa699a385.tar.gz
org.eclipse.osee-354ecd4dbbacacd1abc09a7c90846abaa699a385.tar.xz
org.eclipse.osee-354ecd4dbbacacd1abc09a7c90846abaa699a385.zip
refactor: Use ArtifactQuery.getArtifactFromToken where applicable
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java6
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoWebDatabaseConfig.java2
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/TeamResourceTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/WfeEditorAddSupportingArtifactsTest.java4
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/navigate/SubscribeUtilityTest.java11
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfig2DataExample.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsAccessOseeDslProvider.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/provider/AtsWorkDefinitionImporter.java2
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/PurgeArtifactsTest.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactToken.java7
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java10
13 files changed, 34 insertions, 28 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java
index da1e477bf4..641603999b 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDatabaseConfig.java
@@ -268,8 +268,7 @@ public class DemoDatabaseConfig implements IDbInitializationTask {
SkynetTransaction transaction =
TransactionManager.createTransaction(AtsClientService.get().getAtsBranch(), "Create Work Packages");
- Artifact codeTeamArt =
- ArtifactQuery.getArtifactFromId(DemoArtifactToken.SAW_Code, AtsClientService.get().getAtsBranch());
+ Artifact codeTeamArt = ArtifactQuery.getArtifactFromToken(DemoArtifactToken.SAW_Code);
Artifact workPkg1 = createWorkPackage(DemoArtifactToken.SAW_Code_Team_WorkPackage_01, "ASDHFA443");
workPkg1.addRelation(AtsRelationTypes.WorkPackage_TeamDefOrAi, codeTeamArt);
@@ -287,8 +286,7 @@ public class DemoDatabaseConfig implements IDbInitializationTask {
relateInsertionActivity(workPkg3, DemoInsertionActivity.commButton);
workPkg3.persist(transaction);
- Artifact testTeamArt =
- ArtifactQuery.getArtifactFromId(DemoArtifactToken.SAW_Test_AI, AtsClientService.get().getAtsBranch());
+ Artifact testTeamArt = ArtifactQuery.getArtifactFromToken(DemoArtifactToken.SAW_Test_AI);
Artifact workPkg11 = createWorkPackage(DemoArtifactToken.SAW_Test_AI_WorkPackage_0A, "AHESSH3");
workPkg11.addRelation(AtsRelationTypes.WorkPackage_TeamDefOrAi, testTeamArt);
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoWebDatabaseConfig.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoWebDatabaseConfig.java
index 6e8417f7de..0d2ae1265e 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoWebDatabaseConfig.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoWebDatabaseConfig.java
@@ -45,7 +45,7 @@ public class DemoWebDatabaseConfig implements IDbInitializationTask {
oseeWebArt.addRelation(CoreRelationTypes.Universal_Grouping__Members, demoProgramsArt);
oseeWebArt.persist(transaction);
- Artifact sawTeam = ArtifactQuery.getArtifactFromId(DemoArtifactToken.SAW_Bld_1, atsBranch);
+ Artifact sawTeam = ArtifactQuery.getArtifactFromToken(DemoArtifactToken.SAW_Bld_1);
sawTeam.addRelation(CoreRelationTypes.SupportingInfo_SupportedBy, demoProgramsArt);
sawTeam.persist(transaction);
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/TeamResourceTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/TeamResourceTest.java
index b1909014ee..8a0c617d9b 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/TeamResourceTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/TeamResourceTest.java
@@ -73,6 +73,6 @@ public class TeamResourceTest extends AbstractConfigurationRestTest {
}
private Artifact getSawSwTeamDef() {
- return ArtifactQuery.getArtifactFromId(DemoTeam.SAW_SW.getTeamDefToken(), AtsClientService.get().getAtsBranch());
+ return ArtifactQuery.getArtifactFromToken(DemoTeam.SAW_SW.getTeamDefToken());
}
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/WfeEditorAddSupportingArtifactsTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/WfeEditorAddSupportingArtifactsTest.java
index d19e41b492..b280191fb6 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/WfeEditorAddSupportingArtifactsTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/editor/WfeEditorAddSupportingArtifactsTest.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.ats.client.integration.tests.ats.editor;
import java.util.Arrays;
-import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.editor.WfeEditorAddSupportingArtifacts;
@@ -40,8 +39,7 @@ public class WfeEditorAddSupportingArtifactsTest {
AtsTestUtil.cleanupAndReset(getClass().getSimpleName());
TeamWorkFlowArtifact teamWf = AtsTestUtil.getTeamWf();
- Artifact rootArt =
- ArtifactQuery.getArtifactFromId(CoreArtifactTokens.DefaultHierarchyRoot, AtsClientService.get().getAtsBranch());
+ Artifact rootArt = ArtifactQuery.getArtifactFromToken(CoreArtifactTokens.DefaultHierarchyRoot);
Artifact firstArt = null, secondArt = null;
for (Artifact child : rootArt.getChildren()) {
if (firstArt == null) {
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/navigate/SubscribeUtilityTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/navigate/SubscribeUtilityTest.java
index 5e12174253..3c412e13d6 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/navigate/SubscribeUtilityTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/navigate/SubscribeUtilityTest.java
@@ -14,7 +14,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
-import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.demo.api.DemoArtifactToken;
import org.eclipse.osee.ats.navigate.SubscribeUtility;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
@@ -29,7 +28,7 @@ import org.junit.Test;
/**
* Test case for {@link SubscribeUtility}
- *
+ *
* @author Donald G. Dunne
*/
public class SubscribeUtilityTest {
@@ -49,8 +48,8 @@ public class SubscribeUtilityTest {
alexUserArt.getRelatedArtifactsCount(CoreRelationTypes.Users_Artifact));
// Subscribe to 2 team definitions
- Artifact cisCodeTeam = ArtifactQuery.getArtifactFromId(DemoArtifactToken.CIS_Code, AtsClientService.get().getAtsBranch());
- Artifact cisSwTeam = ArtifactQuery.getArtifactFromId(DemoArtifactToken.CIS_SW, AtsClientService.get().getAtsBranch());
+ Artifact cisCodeTeam = ArtifactQuery.getArtifactFromToken(DemoArtifactToken.CIS_Code);
+ Artifact cisSwTeam = ArtifactQuery.getArtifactFromToken(DemoArtifactToken.CIS_SW);
SubscribeUtility.setSubcriptionsAndPersist(alexUserArt, CoreRelationTypes.Users_Artifact,
Arrays.asList(cisCodeTeam, cisSwTeam), AtsArtifactTypes.TeamDefinition, getClass().getSimpleName());
@@ -60,7 +59,7 @@ public class SubscribeUtilityTest {
Assert.assertFalse("User artifact changes should be persisted", alexUserArt.isDirty());
// Remove one, add another
- Artifact cisTestTeam = ArtifactQuery.getArtifactFromId(DemoArtifactToken.CIS_Test, AtsClientService.get().getAtsBranch());
+ Artifact cisTestTeam = ArtifactQuery.getArtifactFromToken(DemoArtifactToken.CIS_Test);
SubscribeUtility.setSubcriptionsAndPersist(alexUserArt, CoreRelationTypes.Users_Artifact,
Arrays.asList(cisCodeTeam, cisTestTeam), AtsArtifactTypes.TeamDefinition, getClass().getSimpleName());
@@ -79,7 +78,7 @@ public class SubscribeUtilityTest {
}
private static Artifact getAlexUserArtifact() throws OseeCoreException {
- return ArtifactQuery.getArtifactFromId(DemoUsers.Alex_Kay, AtsClientService.get().getAtsBranch());
+ return ArtifactQuery.getArtifactFromToken(DemoUsers.Alex_Kay);
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
index 9793913d84..3a01f63895 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
@@ -405,7 +405,7 @@ public class AtsClientImpl extends AtsCoreServiceImpl implements IAtsClient {
@Override
public String getConfigValue(String key) {
String result = null;
- Artifact atsConfig = ArtifactQuery.getArtifactFromId(AtsArtifactToken.AtsConfig, getAtsBranch());
+ Artifact atsConfig = ArtifactQuery.getArtifactFromToken(AtsArtifactToken.AtsConfig);
if (atsConfig != null) {
for (Object obj : atsConfig.getAttributeValues(CoreAttributeTypes.GeneralStringData)) {
String str = (String) obj;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfig2DataExample.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfig2DataExample.java
index f66e9aac7b..4d8ddb133c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfig2DataExample.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfig2DataExample.java
@@ -18,7 +18,6 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.workdef.WorkDefinitionSheet;
import org.eclipse.osee.ats.internal.Activator;
-import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.workdef.AtsWorkDefinitionSheetProviders;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.TokenFactory;
@@ -45,7 +44,7 @@ public class AtsConfig2DataExample extends AbstractAtsConfig2Data {
@Override
public void performPostConfig(IAtsChangeSet changes, AbstractAtsConfig2Data data) {
- Artifact dtsSoftware = ArtifactQuery.getArtifactFromId(Software_Team, AtsClientService.get().getAtsBranch());
+ Artifact dtsSoftware = ArtifactQuery.getArtifactFromToken(Software_Team);
dtsSoftware.addAttribute(AtsAttributeTypes.RelatedTaskWorkDefinition, "WorkDef_Task_AtsConfig2Example");
changes.add(dtsSoftware);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java
index 99ab785a7c..404ec7aca8 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java
@@ -53,8 +53,7 @@ public class AtsDatabaseConfig implements IDbInitializationTask {
createAtsFolders();
// load top team into cache
- Artifact topTeamDefArt =
- ArtifactQuery.getArtifactFromId(AtsArtifactToken.TopTeamDefinition, AtsClientService.get().getAtsBranch());
+ Artifact topTeamDefArt = ArtifactQuery.getArtifactFromToken(AtsArtifactToken.TopTeamDefinition);
IAtsTeamDefinition teamDef = AtsClientService.get().getConfigItem(topTeamDefArt);
IAtsChangeSet changes = AtsClientService.get().createChangeSet("Set Top Team Work Definition");
changes.setSoleAttributeValue(teamDef, AtsAttributeTypes.WorkflowDefinition,
@@ -62,8 +61,7 @@ public class AtsDatabaseConfig implements IDbInitializationTask {
changes.execute();
// load top ai into cache
- Artifact topAiArt =
- ArtifactQuery.getArtifactFromId(AtsArtifactToken.TopActionableItem, AtsClientService.get().getAtsBranch());
+ Artifact topAiArt = ArtifactQuery.getArtifactFromToken(AtsArtifactToken.TopActionableItem);
IAtsActionableItem aia = AtsClientService.get().getConfigItem(topAiArt);
changes.setSoleAttributeValue(aia, AtsAttributeTypes.Actionable, false);
changes.execute();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsAccessOseeDslProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsAccessOseeDslProvider.java
index 0e43cb04ec..432132fceb 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsAccessOseeDslProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsAccessOseeDslProvider.java
@@ -13,7 +13,6 @@ package org.eclipse.osee.ats.internal;
import org.eclipse.osee.ats.api.data.AtsArtifactToken;
import org.eclipse.osee.framework.core.dsl.ui.integration.operations.AbstractOseeDslProvider;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -30,7 +29,7 @@ public class AtsAccessOseeDslProvider extends AbstractOseeDslProvider {
private Artifact getStorageArtifact() {
try {
- return ArtifactQuery.getArtifactFromId(AtsArtifactToken.AtsCmAccessControl, CoreBranches.COMMON);
+ return ArtifactQuery.getArtifactFromToken(AtsArtifactToken.AtsCmAccessControl);
} catch (OseeCoreException ex) {
return null;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/provider/AtsWorkDefinitionImporter.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/provider/AtsWorkDefinitionImporter.java
index 1bc008ec75..95a963ed69 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/provider/AtsWorkDefinitionImporter.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workdef/provider/AtsWorkDefinitionImporter.java
@@ -86,7 +86,7 @@ public class AtsWorkDefinitionImporter {
Artifact artifact = null;
try {
if (token != null) {
- artifact = ArtifactQuery.getArtifactFromId(token, AtsClientService.get().getAtsBranch());
+ artifact = ArtifactQuery.getArtifactFromToken(token);
} else {
artifact = ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.WorkDefinition, sheetName,
AtsClientService.get().getAtsBranch());
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/PurgeArtifactsTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/PurgeArtifactsTest.java
index 2d617023a4..5a8a1d87f1 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/PurgeArtifactsTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/integration/skynet/core/PurgeArtifactsTest.java
@@ -49,7 +49,7 @@ public class PurgeArtifactsTest {
@Test
public void test() {
- Artifact userGroupsArt = ArtifactQuery.getArtifactFromId(CoreArtifactTokens.UserGroups, CoreBranches.COMMON);
+ Artifact userGroupsArt = ArtifactQuery.getArtifactFromToken(CoreArtifactTokens.UserGroups);
SkynetTransaction transaction =
TransactionManager.createTransaction(CoreBranches.COMMON, getClass().getSimpleName());
@@ -61,7 +61,7 @@ public class PurgeArtifactsTest {
ArtifactCache.deCache(userGroupsArt);
- userGroupsArt = ArtifactQuery.getArtifactFromId(CoreArtifactTokens.UserGroups, CoreBranches.COMMON);
+ userGroupsArt = ArtifactQuery.getArtifactFromToken(CoreArtifactTokens.UserGroups);
Assert.assertFalse(userGroupsArt.isDirty());
Assert.assertEquals(userGroupsArt, childFolder.getParent());
Assert.assertTrue(userGroupsArt.getChildren().contains(childFolder));
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactToken.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactToken.java
index 978cfa4199..7ae69b4ec5 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactToken.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/ArtifactToken.java
@@ -29,9 +29,16 @@ public interface ArtifactToken extends ArtifactId, HasArtifactType, HasBranch, N
}
public static ArtifactToken valueOf(ArtifactId id, BranchId branch) {
+ if (id instanceof ArtifactToken) {
+ return valueOf((ArtifactToken) id, branch);
+ }
return valueOf(id.getId(), GUID.create(), null, branch, null);
}
+ public static ArtifactToken valueOf(ArtifactToken token, BranchId branch) {
+ return valueOf(token.getId(), token.getGuid(), token.getName(), branch, token.getArtifactType());
+ }
+
public static ArtifactToken valueOf(long id, BranchId branch) {
return valueOf(id, GUID.create(), null, branch, null);
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
index 4ffdf63afe..117f4d4439 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
@@ -128,7 +128,15 @@ public class ArtifactQuery {
}
private static Artifact getOrCheckArtifactFromId(ArtifactId artifactId, BranchId branch, DeletionFlag allowDeleted, QueryType queryType) throws OseeCoreException {
- Artifact artifact = ArtifactCache.getActive(ArtifactToken.valueOf(artifactId, branch));
+ ArtifactToken artifactToken;
+ if (artifactId instanceof ArtifactToken) {
+ ArtifactToken inputToken = (ArtifactToken) artifactId;
+ artifactToken = ArtifactToken.valueOf(artifactId.getId(), artifactId.getGuid(), inputToken.getName(), branch,
+ inputToken.getArtifactType());
+ } else {
+ artifactToken = ArtifactToken.valueOf(artifactId, branch);
+ }
+ Artifact artifact = ArtifactCache.getActive(artifactToken);
if (artifact != null) {
if (artifact.isDeleted() && allowDeleted == EXCLUDE_DELETED) {
if (queryType == QueryType.CHECK) {

Back to the top