Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid W. Miller2017-01-03 19:03:58 -0500
committerDavid Miller2017-01-04 16:17:37 -0500
commita1d6a324ec7426b9294c89a10807c4a566dfb061 (patch)
treed212a8767901906b242891094368fd26b58732ea
parentd519d0245c36ecf0b1465a2500e41b7eb4ddbe05 (diff)
downloadorg.eclipse.osee-a1d6a324ec7426b9294c89a10807c4a566dfb061.tar.gz
org.eclipse.osee-a1d6a324ec7426b9294c89a10807c4a566dfb061.tar.xz
org.eclipse.osee-a1d6a324ec7426b9294c89a10807c4a566dfb061.zip
bug[ats_ATS326732]: Fixed exception finding associated workflow0.24.3.v201701091908-REL
-rw-r--r--plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java
index 9019dd162f..38ca3b3f88 100644
--- a/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java
+++ b/plugins/org.eclipse.osee.define.report/src/org/eclipse/osee/define/report/internal/wordupdate/SafetyWorkflowEventHandler.java
@@ -76,12 +76,13 @@ public class SafetyWorkflowEventHandler implements EventHandler {
checkEventObjects(branchId, userArt); // throws exception if incorrect
ArtifactReadable assocArt = getAssociatedWorkflowArt((BranchId) branchId);
- IAtsTeamWorkflow safetyWf = getSafetyWorkflow(assocArt);
- if (safetyWf == null) {
- IAtsTeamWorkflow teamWf = atsServer.getWorkItemFactory().getTeamWf(assocArt);
- safetyWf = createSafetyAction(teamWf, (ArtifactReadable) userArt);
+ if (assocArt != null) {
+ IAtsTeamWorkflow safetyWf = getSafetyWorkflow(assocArt);
+ if (safetyWf == null) {
+ IAtsTeamWorkflow teamWf = atsServer.getWorkItemFactory().getTeamWf(assocArt);
+ safetyWf = createSafetyAction(teamWf, (ArtifactReadable) userArt);
+ }
}
-
} catch (Exception ex) {
logger.error(ex, "Could not create safety workflow");
}
@@ -100,13 +101,15 @@ public class SafetyWorkflowEventHandler implements EventHandler {
private ArtifactReadable getAssociatedWorkflowArt(BranchId branchId) {
ArtifactReadable toReturn = null;
- BranchReadable branch = queryFactory.branchQuery().andIds(branchId).getResults().getExactlyOne();
- long workflowUuid = branch.getAssociatedArtifactId();
try {
- toReturn = atsServer.getQuery().andUuid(workflowUuid).andIsOfType(
- AtsArtifactTypes.TeamWorkflow).getResults().getExactlyOne();
+ BranchReadable branch = queryFactory.branchQuery().andIds(branchId).getResults().getOneOrNull();
+ if (branch != null) {
+ long workflowUuid = branch.getAssociatedArtifactId();
+ toReturn = atsServer.getQuery().andUuid(workflowUuid).andIsOfType(
+ AtsArtifactTypes.TeamWorkflow).getResults().getOneOrNull();
+ }
} catch (Exception ex) {
- throw new OseeCoreException(ex, "Exception in getAssociatedWorkflowArt: %s", workflowUuid);
+ // do not throw exception when associated artifact is osee system or doesn't exist
}
return toReturn;
}

Back to the top