From 76c03d2c84a189b900f40cd4844393232b3f6f64 Mon Sep 17 00:00:00 2001 From: donald.g.dunne Date: Sat, 24 Sep 2016 14:01:01 -0700 Subject: refinement: Add getHisoricalOrNull to ArtifactQuery --- .../framework/skynet/core/artifact/search/ArtifactQuery.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 713b884df26..1a24a6a28fa 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 @@ -310,6 +310,16 @@ public class ArtifactQuery { return new ArtifactQueryBuilder(artifactId, transactionId, allowDeleted, ALL).getOrCheckArtifact(QueryType.GET); } + public static Artifact getHistoricalArtifactFromIdOrNull(int artifactId, TransactionToken transactionId, DeletionFlag allowDeleted) throws OseeCoreException { + try { + return new ArtifactQueryBuilder(artifactId, transactionId, allowDeleted, ALL).getOrCheckArtifact( + QueryType.GET); + } catch (ArtifactDoesNotExist ex) { + // do nothing + } + return null; + } + public static Artifact getHistoricalArtifactFromId(String guid, TransactionToken transactionId, DeletionFlag allowDeleted) throws OseeCoreException { return new ArtifactQueryBuilder(Arrays.asList(guid), transactionId, allowDeleted, ALL).getOrCheckArtifact( QueryType.GET); -- cgit v1.2.3