Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2020-04-20 17:48:05 +0000
committerDonald Dunne2020-04-21 23:27:10 +0000
commit45fa4ee0013aa324d329e1a37aab864bfa539cad (patch)
treee266060a8d40158b4e68f10cc8be2aba70276a98
parent7b46cf429b7647c5b74d0b43745cc72fa5046473 (diff)
downloadorg.eclipse.osee-26_test.tar.gz
org.eclipse.osee-26_test.tar.xz
org.eclipse.osee-26_test.zip
feature[TW15833]: Convert ATS Enums to OseeEnumOSEE_0.26.0_DEV_20200422192526_test
- Remove ITransitionResult - Convert WidgetStatus to OseeEnum - Convert TransitionOption to OseeEnum - Convert ReviewDefectError to OseeEnum - Convert UserRoleError to OseeEnum Change-Id: I32f7219300f9baf2d9a6fbca8cd1b86a265f5bba
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/ITransitionResult.java28
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/WidgetResult.java38
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/WidgetStatus.java59
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionData.java1
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionOption.java50
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResult.java5
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java19
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionWorkItemResult.java90
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidatorTest.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXDateValidatorTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManagerTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidatorTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/ValidatorTestUtil.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/WidgetStatusTest.java13
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/review/ReviewDefectError.java32
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/task/CreateTasksOperation.java1
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidator.java8
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboValidator.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXDateValidator.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXListValidator.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXNumberValidator.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXTextValidator.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManager.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidator.java37
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java2
-rw-r--r--plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/AtsXCommitManagerValidatorTest.java12
-rw-r--r--plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/review/defect/AtsXDefectValidatorTest.java4
-rw-r--r--plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/review/defect/ValidatorTestUtil.java4
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTransitionHeader.java44
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/AtsUtilClient.java8
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsOperationalImpactValidator.java4
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsOperationalImpactWithWorkaroundValidator.java8
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsXCommitManagerValidator.java2
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsXHyperlinkMemberSelValidator.java4
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/defect/AtsXDefectValidator.java2
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/role/AtsXUserRoleValidator.java2
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/role/UserRoleError.java37
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/transition/TransitionResultsUi.java23
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/transition/TransitionToMenu.java2
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsActionEndpointImpl.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/OseeEnum.java72
41 files changed, 418 insertions, 238 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/ITransitionResult.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/ITransitionResult.java
deleted file mode 100644
index df3355d9ac0..00000000000
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/ITransitionResult.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.api.workdef;
-
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import org.eclipse.osee.ats.api.workflow.transition.TransitionResult;
-
-/**
- * @author Donald G. Dunne
- */
-@JsonSerialize(as = TransitionResult.class)
-@JsonDeserialize(as = TransitionResult.class)
-public interface ITransitionResult {
-
- public String getDetails();
-
- public String getException();
-
-}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/WidgetResult.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/WidgetResult.java
index 32bade90603..562e4eb119b 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/WidgetResult.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/WidgetResult.java
@@ -10,18 +10,23 @@
*******************************************************************************/
package org.eclipse.osee.ats.api.workdef;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResult;
import org.eclipse.osee.framework.jdk.core.util.Lib;
/**
* @author Donald G. Dunne
*/
-public class WidgetResult implements ITransitionResult {
+public class WidgetResult extends TransitionResult {
- private final WidgetStatus status;
- private final String message;
- public static WidgetResult Valid = new WidgetResult(WidgetStatus.Valid, "");
+ private WidgetStatus status;
+ private String message;
+ public static WidgetResult Success = new WidgetResult(WidgetStatus.Success, "");
private String exception = "";
+ public WidgetResult() {
+ this(WidgetStatus.Success, "");
+ }
+
public WidgetResult(WidgetStatus status, String format, Object... object) {
this(status, null, format, object);
}
@@ -34,8 +39,8 @@ public class WidgetResult implements ITransitionResult {
this.message = String.format(format, objects);
}
- public boolean isValid() {
- return status.isValid();
+ public boolean isSuccess() {
+ return status.isSuccess();
}
public WidgetStatus getStatus() {
@@ -44,8 +49,8 @@ public class WidgetResult implements ITransitionResult {
@Override
public String getDetails() {
- if (this == Valid) {
- return "Valid";
+ if (this == Success) {
+ return "Success";
}
return message;
}
@@ -59,4 +64,21 @@ public class WidgetResult implements ITransitionResult {
public String getException() {
return exception;
}
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public void setStatus(WidgetStatus status) {
+ this.status = status;
+ }
+
+ @Override
+ public void setException(String exception) {
+ this.exception = exception;
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/WidgetStatus.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/WidgetStatus.java
index d91390e996c..2107e5dac2e 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/WidgetStatus.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/WidgetStatus.java
@@ -10,23 +10,62 @@
*******************************************************************************/
package org.eclipse.osee.ats.api.workdef;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.eclipse.osee.framework.core.enums.OseeEnum;
+
/**
* @author Donald G. Dunne
*/
-public enum WidgetStatus {
+public class WidgetStatus extends OseeEnum {
+
+ private static final Long ENUM_ID = 8837298548L;
+
+ // @formatter:off
+ public static WidgetStatus None = new WidgetStatus("None");
+ public static WidgetStatus Success = new WidgetStatus("Success");
+ public static WidgetStatus Empty = new WidgetStatus("Empty");
+ // string entered when sho2uld be int
+ public static WidgetStatus Invalid_Type = new WidgetStatus("Invalid_Type");
+ // entered 8 when should b2e >2 and <5 or entered 5 characters when min =8
+ public static WidgetStatus Invalid_Range = new WidgetStatus("Invalid_Range");
+ // entered 2 integers when2 should be 3; have to enter hours for defect
+ public static WidgetStatus Invalid_Incompleted = new WidgetStatus("Invalid_Incompleted");
+ public static WidgetStatus Exception = new WidgetStatus("Exception");
+ // @formatter:on
+
+ public static final WidgetStatus instance = None;
+
+ public WidgetStatus() {
+ super(ENUM_ID, -1L, "");
+ }
+
+ public WidgetStatus(String name) {
+ super(ENUM_ID, name);
+ }
+
+ public WidgetStatus(long id, String name) {
+ super(ENUM_ID, id, name);
+ }
- Valid,
- Empty,
- Invalid_Type, // string entered when should be int
- Invalid_Range, // entered 8 when should be >2 and <5 or entered 5 characters when min =8
- Invalid_Incompleted, // entered 2 integers when should be 3; have to enter hours for defect
- Exception;
+ @Override
+ public Long getTypeId() {
+ return ENUM_ID;
+ }
- public boolean isValid() {
- return this == Valid;
+ @JsonIgnore
+ @Override
+ public WidgetStatus getDefault() {
+ return None;
}
+ @JsonIgnore
public boolean isEmpty() {
- return this == Empty;
+ return getId().equals(Empty.id);
}
+
+ @JsonIgnore
+ public boolean isSuccess() {
+ return getId().equals(Success.id);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionData.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionData.java
index 5e18951ad43..aaee0cd3b90 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionData.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionData.java
@@ -15,6 +15,7 @@ import java.util.Collection;
import java.util.HashSet;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.AtsUser;
+
import org.eclipse.osee.framework.core.data.ArtifactToken;
/**
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionOption.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionOption.java
index 3771db47612..06b410d62bf 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionOption.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionOption.java
@@ -10,17 +10,45 @@
*******************************************************************************/
package org.eclipse.osee.ats.api.workflow.transition;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.eclipse.osee.framework.core.enums.OseeEnum;
+
/**
* @author Donald G. Dunne
*/
-public enum TransitionOption {
- None,
- // Override check whether workflow allows transition to state
- OverrideTransitionValidityCheck,
- // Allows transition to occur with UnAssigned, OseeSystem or Anonymous
- OverrideAssigneeCheck,
- // Skip reloading workflow prior to transition
- OverrideReload,
- // Allow Transition regardless of working branch
- OverrideWorkingBranchCheck
-};
+public class TransitionOption extends OseeEnum {
+
+ private static final Long ENUM_ID = 219374727L;
+
+ // @formatter:off
+ public static final TransitionOption None = new TransitionOption("None");
+ public static final TransitionOption OverrideTransitionValidityCheck = new TransitionOption("OverrideTransitionValidityCheck");
+ public static final TransitionOption OverrideAssigneeCheck = new TransitionOption("OverrideAssigneeCheck");
+ public static final TransitionOption OverrideReload = new TransitionOption("OverrideReload");
+ public static final TransitionOption OverrideWorkingBranchCheck = new TransitionOption("OverrideWorkingBranchCheck");
+ // @formatter:on
+
+ public TransitionOption() {
+ super(ENUM_ID, -1L, "");
+ }
+
+ public TransitionOption(String name) {
+ super(ENUM_ID, name);
+ }
+
+ public TransitionOption(long id, String name) {
+ super(ENUM_ID, id, name);
+ }
+
+ @Override
+ public Long getTypeId() {
+ return ENUM_ID;
+ }
+
+ @JsonIgnore
+ @Override
+ public TransitionOption getDefault() {
+ return None;
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResult.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResult.java
index 1536d42f46e..59179b80b53 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResult.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResult.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.ats.api.workflow.transition;
-import org.eclipse.osee.ats.api.workdef.ITransitionResult;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -18,7 +17,7 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
* @author Donald G. Dunne
*/
-public class TransitionResult implements ITransitionResult {
+public class TransitionResult {
public static TransitionResult MUST_BE_TARGETED_FOR_VERSION =
new TransitionResult("Actions must be targeted for a Version. Please set \"Target Version\" before transition.");
@@ -72,7 +71,6 @@ public class TransitionResult implements ITransitionResult {
this(details, null);
}
- @Override
public String getDetails() {
return details;
}
@@ -82,7 +80,6 @@ public class TransitionResult implements ITransitionResult {
return getDetails();
}
- @Override
public String getException() {
return exception;
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java
index b43367e2bb4..b16aff1bc84 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java
@@ -18,7 +18,6 @@ import java.util.List;
import java.util.Set;
import org.eclipse.osee.ats.api.AtsApi;
import org.eclipse.osee.ats.api.IAtsWorkItem;
-import org.eclipse.osee.ats.api.workdef.ITransitionResult;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.jdk.core.result.XResultData;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -30,12 +29,12 @@ public class TransitionResults {
boolean cancelled;
private Set<ArtifactToken> workItemIds = new HashSet<>();
- private List<ITransitionResult> results = new ArrayList<>();
+ private List<TransitionResult> results = new ArrayList<>();
private List<TransitionWorkItemResult> transitionWorkItems = new ArrayList<>();
@JsonIgnore
private AtsApi atsApi;
- public void addResult(IAtsWorkItem workItem, ITransitionResult result) {
+ public void addResult(IAtsWorkItem workItem, TransitionResult result) {
TransitionWorkItemResult workItemResult = getTransitionWorkItemResult(workItem);
if (workItemResult == null) {
workItemResult = new TransitionWorkItemResult();
@@ -61,7 +60,7 @@ public class TransitionResults {
transitionWorkItems.clear();
}
- public void addResult(ITransitionResult result) {
+ public void addResult(TransitionResult result) {
results.add(result);
}
@@ -122,17 +121,15 @@ public class TransitionResults {
return sb.toString();
}
- public void appendResultsString(StringBuffer sb, List<ITransitionResult> results) {
- for (ITransitionResult result : results) {
+ public void appendResultsString(StringBuffer sb, List<TransitionResult> results) {
+ for (TransitionResult result : results) {
sb.append(" - ");
sb.append(result.getDetails());
- if (result.getException() != null) {
+ if (Strings.isValid(result.getException())) {
if (Strings.isValid(result.getException())) {
sb.append(" - Exception [");
sb.append(result.getException());
sb.append("] (see log for details)");
- } else {
- sb.append(" - (see log for details)");
}
}
sb.append("\n");
@@ -154,7 +151,7 @@ public class TransitionResults {
return getResultString();
}
- public List<ITransitionResult> getResults() {
+ public List<TransitionResult> getResults() {
return results;
}
@@ -181,7 +178,7 @@ public class TransitionResults {
}
}
- public void setResults(List<ITransitionResult> results) {
+ public void setResults(List<TransitionResult> results) {
this.results = results;
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionWorkItemResult.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionWorkItemResult.java
index 5cd999359ba..aa8a469686f 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionWorkItemResult.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionWorkItemResult.java
@@ -13,9 +13,7 @@ package org.eclipse.osee.ats.api.workflow.transition;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.osee.ats.api.AtsApi;
import org.eclipse.osee.ats.api.IAtsWorkItem;
-import org.eclipse.osee.ats.api.workdef.ITransitionResult;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -24,14 +22,12 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
*/
public class TransitionWorkItemResult {
- @JsonIgnore
- private IAtsWorkItem workItem;
private ArtifactToken workItemId;
- private List<ITransitionResult> transitionResults = new ArrayList<ITransitionResult>();
- @JsonIgnore
- private AtsApi atsApi;
+ private String workItemType;
+ private String atsId;
+ private List<TransitionResult> transitionResults = new ArrayList<TransitionResult>();
- public void addResult(ITransitionResult result) {
+ public void addResult(TransitionResult result) {
transitionResults.add(result);
}
@@ -68,36 +64,23 @@ public class TransitionWorkItemResult {
return "<Empty>";
}
StringBuffer sb = new StringBuffer();
- if (workItem != null) {
- if (Strings.isValid(workItem.getArtifactTypeName())) {
- sb.append(workItem.getArtifactTypeName());
- } else {
- sb.append("Work Item");
- }
- sb.append(" [");
- sb.append(workItem.getAtsId());
- sb.append("] Titled [");
- sb.append(workItem.getName());
- sb.append("]\n\n");
- } else if (workItemId != null) {
- if (Strings.isValid(workItemId.getArtifactType().getName())) {
- sb.append(workItemId.getArtifactType().getName());
- } else {
- sb.append("Work Item");
- }
- sb.append(" [");
- sb.append(workItemId.getIdString());
- sb.append("] Titled [");
- sb.append(workItemId.getName());
- sb.append("]\n\n");
+ if (Strings.isValid(workItemType)) {
+ sb.append(workItemType);
+ } else {
+ sb.append("Work Item");
}
+ sb.append(" [");
+ sb.append(atsId);
+ sb.append("] Titled [");
+ sb.append(workItemId.getName());
+ sb.append("]\n\n");
appendResultsString(sb, transitionResults);
return sb.toString();
}
- public void appendResultsString(StringBuffer sb, List<ITransitionResult> results) {
- for (ITransitionResult result : results) {
+ public void appendResultsString(StringBuffer sb, List<TransitionResult> results) {
+ for (TransitionResult result : results) {
sb.append(" - ");
sb.append(result.getDetails());
if (result.getException() != null) {
@@ -105,8 +88,6 @@ public class TransitionWorkItemResult {
sb.append(" - Exception [");
sb.append(result.getException());
sb.append("] (see log for details)");
- } else {
- sb.append(" - (see log for details)");
}
}
sb.append("\n");
@@ -119,43 +100,42 @@ public class TransitionWorkItemResult {
return getResultString();
}
- public List<ITransitionResult> getResults() {
+ public List<TransitionResult> getResults() {
return transitionResults;
}
- void setResults(List<ITransitionResult> transitionResults) {
+ void setResults(List<TransitionResult> transitionResults) {
this.transitionResults = transitionResults;
}
- @JsonIgnore
- public AtsApi getAtsApi() {
- return atsApi;
+ public void setWorkItem(IAtsWorkItem workItem) {
+ this.workItemType = workItem.getArtifactTypeName();
+ this.atsId = workItem.getAtsId();
+ this.workItemId = ArtifactToken.valueOf(workItem.getId(), workItem.getName());
}
- public void setAtsApi(AtsApi atsApi) {
- this.atsApi = atsApi;
+ public ArtifactToken getWorkItemId() {
+ return workItemId;
}
- public IAtsWorkItem getWorkItem() {
- if (workItem == null && workItemId.isValid()) {
- workItem = atsApi.getWorkItemService().getWorkItem(workItemId);
- }
- return workItem;
+ public void setWorkItemId(ArtifactToken workItemId) {
+ this.workItemId = workItemId;
}
- public void setWorkItem(IAtsWorkItem workItem) {
- this.workItem = workItem;
+ public String getWorkItemType() {
+ return workItemType;
}
- public ArtifactToken getWorkItemId() {
- if ((workItemId == null || workItemId.isInvalid()) && workItem != null) {
- workItemId = workItem.getArtifactToken();
- }
- return workItemId;
+ public void setWorkItemType(String workItemType) {
+ this.workItemType = workItemType;
}
- public void setWorkItemId(ArtifactToken workItemId) {
- this.workItemId = workItemId;
+ public String getAtsId() {
+ return atsId;
+ }
+
+ public void setAtsId(String atsId) {
+ this.atsId = atsId;
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidatorTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidatorTest.java
index 72617b45cc6..bf5bda4a415 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidatorTest.java
@@ -79,12 +79,12 @@ public class AtsXComboBooleanValidatorTest {
// Check for "true" value
StringValueProvider valueProvider = new StringValueProvider(Arrays.asList("true"));
result = validator.validateTransition(workItem, valueProvider, widgetDef, fromStateDef, toStateDef, atsServices);
- Assert.assertEquals(WidgetStatus.Valid, result.getStatus());
+ Assert.assertEquals(WidgetStatus.Success, result.getStatus());
// Check for "false" value
valueProvider = new StringValueProvider(Arrays.asList("false"));
result = validator.validateTransition(workItem, valueProvider, widgetDef, fromStateDef, toStateDef, atsServices);
- Assert.assertEquals(WidgetStatus.Valid, result.getStatus());
+ Assert.assertEquals(WidgetStatus.Success, result.getStatus());
// Check for "junk" value
valueProvider = new StringValueProvider(Arrays.asList("junk"));
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXDateValidatorTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXDateValidatorTest.java
index f02650c0a79..8893ea55adf 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXDateValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXDateValidatorTest.java
@@ -83,7 +83,7 @@ public class AtsXDateValidatorTest {
// Valid for valid date
WidgetResult result =
validator.validateTransition(workItem, dateProvider, widgetDef, fromStateDef, toStateDef, atsServices);
- Assert.assertEquals(WidgetStatus.Valid, result.getStatus());
+ Assert.assertEquals(WidgetStatus.Success, result.getStatus());
}
@org.junit.Test
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManagerTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManagerTest.java
index 15522587b68..971507ed16e 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManagerTest.java
@@ -100,7 +100,7 @@ public class AtsXWidgetValidateManagerTest {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, AtsApi atsServices) {
- return new WidgetResult(WidgetStatus.Valid, "Here it is");
+ return new WidgetResult(WidgetStatus.Success, "Here it is");
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidatorTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidatorTest.java
index 3404ba40055..af23d9b4b1c 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidatorTest.java
@@ -130,7 +130,7 @@ public class AtsXWidgetValidatorTest {
WidgetDefinition widgetDef = new WidgetDefinition("test");
WidgetResult result = validator.isValidDate(new MockDateValueProvider(Arrays.asList(new Date())), widgetDef);
- Assert.assertEquals(WidgetStatus.Valid, result.getStatus());
+ Assert.assertEquals(WidgetStatus.Success, result.getStatus());
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/ValidatorTestUtil.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/ValidatorTestUtil.java
index 775f6310f4e..699ac742937 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/ValidatorTestUtil.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/ValidatorTestUtil.java
@@ -24,8 +24,8 @@ public class ValidatorTestUtil {
public static StringValueProvider emptyValueProvider = new StringValueProvider(new ArrayList<String>());
public static void assertValidResult(WidgetResult result) {
- Assert.assertEquals(WidgetStatus.Valid, result.getStatus());
- Assert.assertEquals(WidgetStatus.Valid.name(), result.getDetails());
+ Assert.assertEquals(WidgetStatus.Success, result.getStatus());
+ Assert.assertEquals(WidgetStatus.Success.getName(), result.getDetails());
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/WidgetStatusTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/WidgetStatusTest.java
index 7706d27f4d4..e704afb83b8 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/WidgetStatusTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/validator/WidgetStatusTest.java
@@ -21,21 +21,22 @@ public class WidgetStatusTest {
@Test
public void test() {
- Assert.assertTrue(WidgetStatus.Valid.isValid());
- Assert.assertFalse(WidgetStatus.Empty.isValid());
+ Assert.assertTrue(WidgetStatus.Success.isSuccess());
+ Assert.assertFalse(WidgetStatus.Empty.isSuccess());
Assert.assertTrue(WidgetStatus.Empty.isEmpty());
- Assert.assertFalse(WidgetStatus.Valid.isEmpty());
+ Assert.assertFalse(WidgetStatus.Success.isEmpty());
}
@Test
public void testValues() {
- Assert.assertEquals(6, WidgetStatus.values().length);
+ Assert.assertEquals(7, WidgetStatus.instance.values().size());
}
@Test
- public void testValueOf() {
- Assert.assertEquals(WidgetStatus.Empty, WidgetStatus.valueOf(WidgetStatus.Empty.name()));
+ public void testOrdinals() {
+ Assert.assertEquals(new Long(0), WidgetStatus.None.getId());
+ Assert.assertEquals(new Long(1), WidgetStatus.Success.getId());
}
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/review/ReviewDefectError.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/review/ReviewDefectError.java
index 23d3e2d9bd2..c0b84d004f1 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/review/ReviewDefectError.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/review/ReviewDefectError.java
@@ -13,20 +13,30 @@ package org.eclipse.osee.ats.core.review;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workdef.WidgetStatus;
+import org.eclipse.osee.framework.core.enums.OseeEnum;
/**
* @author Donald G. Dunne
*/
-public enum ReviewDefectError {
+public class ReviewDefectError extends OseeEnum {
- None("", WidgetStatus.Valid),
- ExceptionValidatingRoles("Exception validating defects. See log for details.", WidgetStatus.Exception),
- AllItemsMustBeMarkedAndClosed("All items must be marked for severity, disposition and closed.", WidgetStatus.Invalid_Incompleted);
+ private static final Long ENUM_ID = 345345222L;
+
+ // @formatter:off
+ public static final ReviewDefectError None = new ReviewDefectError("None", "", WidgetStatus.Success);
+ public static final ReviewDefectError ExceptionValidatingRoles = new ReviewDefectError("ExceptionValidatingRoles", "Exception validating defects. See log for details.", WidgetStatus.Exception);
+ public static final ReviewDefectError AllItemsMustBeMarkedAndClosed = new ReviewDefectError("AllItemsMustBeMarkedAndClosed", "All items must be marked for severity, disposition and closed.", WidgetStatus.Invalid_Incompleted);
+ // @formatter:on
private final String error;
private final WidgetStatus widgetStatus;
- private ReviewDefectError(String error, WidgetStatus widgetStatus) {
+ public ReviewDefectError() {
+ this("", "", WidgetStatus.Success);
+ }
+
+ public ReviewDefectError(String name, String error, WidgetStatus widgetStatus) {
+ super(ENUM_ID, name);
this.error = error;
this.widgetStatus = widgetStatus;
}
@@ -41,8 +51,18 @@ public enum ReviewDefectError {
public WidgetResult toWidgetResult(IAtsWidgetDefinition widgetDef) {
if (this == None) {
- return WidgetResult.Valid;
+ return WidgetResult.Success;
}
return new WidgetResult(widgetStatus, getError());
}
+
+ @Override
+ public Long getTypeId() {
+ return ENUM_ID;
+ }
+
+ @Override
+ public OseeEnum getDefault() {
+ return None;
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/task/CreateTasksOperation.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/task/CreateTasksOperation.java
index 68cd2457fce..2b533f95927 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/task/CreateTasksOperation.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/task/CreateTasksOperation.java
@@ -39,7 +39,6 @@ import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
-import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.data.TransactionId;
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidator.java
index 3a58e9a3086..8c32f8aac09 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboBooleanValidator.java
@@ -32,16 +32,16 @@ public class AtsXComboBooleanValidator extends AtsXWidgetValidator {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, AtsApi atsServices) {
- WidgetResult result = WidgetResult.Valid;
+ WidgetResult result = WidgetResult.Success;
if ("XComboBooleanDam".equals(widgetDef.getXWidgetName())) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, fromStateDef);
- if (!result.isValid()) {
+ if (!result.isSuccess()) {
return result;
}
for (String value : provider.getValues()) {
if (!isValid(value)) {
- return new WidgetResult(WidgetStatus.Invalid_Range, "[%s] value [%s] must be true or false", provider.getName(),
- value);
+ return new WidgetResult(WidgetStatus.Invalid_Range, "[%s] value [%s] must be true or false",
+ provider.getName(), value);
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboValidator.java
index 8b482b8ecca..e0c5f5a1cdb 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXComboValidator.java
@@ -24,10 +24,10 @@ public class AtsXComboValidator extends AtsXWidgetValidator {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, AtsApi atsServices) {
- WidgetResult result = WidgetResult.Valid;
+ WidgetResult result = WidgetResult.Success;
if (widgetDef.getXWidgetName().startsWith("XComboDam")) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
- if (!result.isValid()) {
+ if (!result.isSuccess()) {
return result;
}
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXDateValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXDateValidator.java
index 1687c3eb8aa..33525f44a16 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXDateValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXDateValidator.java
@@ -24,14 +24,14 @@ public class AtsXDateValidator extends AtsXWidgetValidator {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, AtsApi atsServices) {
- WidgetResult result = WidgetResult.Valid;
+ WidgetResult result = WidgetResult.Success;
if ("XDateDam".equals(widgetDef.getXWidgetName())) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
- if (!result.isValid()) {
+ if (!result.isSuccess()) {
return result;
}
result = isValidDate(provider, widgetDef);
- if (!result.isValid()) {
+ if (!result.isSuccess()) {
return result;
}
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXListValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXListValidator.java
index 8512c1494ae..5ebee50abff 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXListValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXListValidator.java
@@ -24,14 +24,14 @@ public class AtsXListValidator extends AtsXWidgetValidator {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, AtsApi atsServices) {
- WidgetResult result = WidgetResult.Valid;
+ WidgetResult result = WidgetResult.Success;
if ("XListDam".equals(widgetDef.getXWidgetName())) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
- if (!result.isValid()) {
+ if (!result.isSuccess()) {
return result;
}
result = isValidList(provider, widgetDef);
- if (!result.isValid()) {
+ if (!result.isSuccess()) {
return result;
}
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXNumberValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXNumberValidator.java
index 096a274d479..85283346cf7 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXNumberValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXNumberValidator.java
@@ -24,19 +24,19 @@ public class AtsXNumberValidator extends AtsXWidgetValidator {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, AtsApi atsServices) {
- WidgetResult result = WidgetResult.Valid;
+ WidgetResult result = WidgetResult.Success;
String name = widgetDef.getXWidgetName();
if ("XFloatDam".equals(name)) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
- if (!result.isValid()) {
+ if (!result.isSuccess()) {
return result;
}
return isValidFloat(provider, widgetDef);
}
if ("XIntegerDam".equals(name)) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
- if (!result.isValid()) {
+ if (!result.isSuccess()) {
return result;
}
return isValidInteger(provider, widgetDef);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXTextValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXTextValidator.java
index 1ed7f85f9bc..89f09fff0b4 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXTextValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXTextValidator.java
@@ -24,10 +24,10 @@ public class AtsXTextValidator extends AtsXWidgetValidator {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, AtsApi atsServices) {
- WidgetResult result = WidgetResult.Valid;
+ WidgetResult result = WidgetResult.Success;
if ("XTextDam".equals(widgetDef.getXWidgetName())) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
- if (!result.isValid()) {
+ if (!result.isSuccess()) {
return result;
}
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManager.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManager.java
index 2b5b1b6da8d..6ec8e432f58 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManager.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidateManager.java
@@ -46,7 +46,7 @@ public class AtsXWidgetValidateManager {
try {
WidgetResult status = validator.validateTransition(workItem, valueProvider, widgetDef, fromStateDef,
toStateDef, atsServices);
- if (!status.isValid()) {
+ if (!status.isSuccess()) {
results.add(status);
}
} catch (Exception ex) {
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidator.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidator.java
index ac7b11f0222..88e7b171f56 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidator.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/validator/AtsXWidgetValidator.java
@@ -47,12 +47,13 @@ public abstract class AtsXWidgetValidator implements IAtsXWidgetValidator {
public WidgetResult validateWidgetIsRequired(IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef) {
if (isRequiredForTransition(widgetDef) && isEmptyValue(provider)) {
- return new WidgetResult(WidgetStatus.Invalid_Incompleted, "[%s] is required for transition", widgetDef.getName());
+ return new WidgetResult(WidgetStatus.Invalid_Incompleted, "[%s] is required for transition",
+ widgetDef.getName());
} else if (isTransitionToComplete(toStateDef) && isRequiredForCompletion(widgetDef) && isEmptyValue(provider)) {
- return new WidgetResult(WidgetStatus.Invalid_Incompleted, "[%s] is required for transition to [%s]", widgetDef.getName(),
- toStateDef.getName());
+ return new WidgetResult(WidgetStatus.Invalid_Incompleted, "[%s] is required for transition to [%s]",
+ widgetDef.getName(), toStateDef.getName());
}
- return WidgetResult.Valid;
+ return WidgetResult.Success;
}
@Override
@@ -62,54 +63,54 @@ public abstract class AtsXWidgetValidator implements IAtsXWidgetValidator {
for (Date date : valueProvider.getDateValues()) {
if (widgetDef.is(WidgetOption.FUTURE_DATE_REQUIRED)) {
if (date.before(new Date())) {
- return new WidgetResult(WidgetStatus.Invalid_Range, "[%s] value [%s] must be in future", valueProvider.getName(),
- DateUtil.get(date, DateUtil.MMDDYYHHMM));
+ return new WidgetResult(WidgetStatus.Invalid_Range, "[%s] value [%s] must be in future",
+ valueProvider.getName(), DateUtil.get(date, DateUtil.MMDDYYHHMM));
}
}
}
- return WidgetResult.Valid;
+ return WidgetResult.Success;
}
public WidgetResult isValidFloat(IValueProvider valueProvider, IAtsWidgetDefinition widgetDef) {
for (Object obj : valueProvider.getValues()) {
if (obj instanceof Double) {
- return WidgetResult.Valid;
+ return WidgetResult.Success;
}
if (obj instanceof String) {
String attrStr = (String) obj;
if (attrStr.matches("[-+]?\\d*\\.?\\d*")) {
WidgetResult result = checkValid(widgetDef, Double.parseDouble(attrStr), valueProvider.getName());
- if (!result.isValid()) {
+ if (!result.isSuccess()) {
return result;
}
} else {
- return new WidgetResult(WidgetStatus.Invalid_Type, "[%s] value [%s] is not a valid float", valueProvider.getName(),
- attrStr);
+ return new WidgetResult(WidgetStatus.Invalid_Type, "[%s] value [%s] is not a valid float",
+ valueProvider.getName(), attrStr);
}
}
}
- return WidgetResult.Valid;
+ return WidgetResult.Success;
}
public WidgetResult isValidInteger(IValueProvider valueProvider, IAtsWidgetDefinition widgetDef) {
for (Object obj : valueProvider.getValues()) {
if (obj instanceof Integer) {
- return WidgetResult.Valid;
+ return WidgetResult.Success;
}
if (obj instanceof String) {
String attrStr = (String) obj;
if (Strings.isValid(attrStr)) {
WidgetResult result = checkValid(widgetDef, Integer.parseInt(attrStr), valueProvider.getName());
- if (!result.isValid()) {
+ if (!result.isSuccess()) {
return result;
}
} else {
- return new WidgetResult(WidgetStatus.Invalid_Type, "[%s] value [%s] is not a valid integer", valueProvider.getName(),
- attrStr);
+ return new WidgetResult(WidgetStatus.Invalid_Type, "[%s] value [%s] is not a valid integer",
+ valueProvider.getName(), attrStr);
}
}
}
- return WidgetResult.Valid;
+ return WidgetResult.Success;
}
private WidgetResult checkValid(IAtsWidgetDefinition widgetDef, double value, String valueProviderName) {
@@ -124,7 +125,7 @@ public abstract class AtsXWidgetValidator implements IAtsXWidgetValidator {
value, minValue, maxValue);
}
- return WidgetResult.Valid;
+ return WidgetResult.Success;
}
public WidgetResult isValidList(IValueProvider valueProvider, IAtsWidgetDefinition widgetDef) {
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java
index d163e1ec4a7..e64b7582f33 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java
@@ -394,7 +394,7 @@ public class TransitionManager implements IExecuteListener {
// Validate XWidgets for transition
Collection<WidgetResult> widgetResults = workItemService.validateWidgetTransition(workItem, toStateDef);
for (WidgetResult widgetResult : widgetResults) {
- if (!widgetResult.isValid()) {
+ if (!widgetResult.isSuccess()) {
results.addResult(workItem, widgetResult);
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/AtsXCommitManagerValidatorTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/AtsXCommitManagerValidatorTest.java
index 7ff23373c5d..5cabbd77ac9 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/AtsXCommitManagerValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/AtsXCommitManagerValidatorTest.java
@@ -56,14 +56,14 @@ public class AtsXCommitManagerValidatorTest extends AtsMockitoTest {
AtsXCommitManagerValidator validator = new AtsXCommitManagerValidator();
WidgetResult result = validator.validateTransition(workItem, null, notXCommitManagerWidget, null, null, null);
- Assert.assertEquals(WidgetResult.Valid, result);
+ Assert.assertEquals(WidgetResult.Success, result);
result = validator.validateTransition(workItem, notArtifactValueProvider, widgetDef, null, null, atsApi);
- Assert.assertEquals(WidgetResult.Valid, result);
+ Assert.assertEquals(WidgetResult.Success, result);
when(provider.getObject()).thenReturn(task1);
result = validator.validateTransition(workItem, provider, widgetDef, null, null, atsApi);
- Assert.assertEquals(WidgetResult.Valid, result);
+ Assert.assertEquals(WidgetResult.Success, result);
}
@@ -75,7 +75,7 @@ public class AtsXCommitManagerValidatorTest extends AtsMockitoTest {
when(branchService.isWorkingBranchInWork(teamWf)).thenReturn(false);
when(branchService.isCommittedBranchExists(teamWf)).thenReturn(false);
WidgetResult result = validator.validateTransition(workItem, provider, widgetDef, analyze, implement, atsApi);
- Assert.assertEquals(WidgetResult.Valid, result);
+ Assert.assertEquals(WidgetResult.Success, result);
}
@Test
@@ -107,7 +107,7 @@ public class AtsXCommitManagerValidatorTest extends AtsMockitoTest {
when(branchService.isAllObjectsToCommitToConfigured(teamWf)).thenReturn(true);
when(implement.hasRule(RuleDefinitionOption.AllowTransitionWithWorkingBranch.name())).thenReturn(true);
WidgetResult result = validator.validateTransition(workItem, provider, widgetDef, analyze, implement, atsApi);
- Assert.assertEquals(WidgetResult.Valid, result);
+ Assert.assertEquals(WidgetResult.Success, result);
}
@Test
@@ -122,7 +122,7 @@ public class AtsXCommitManagerValidatorTest extends AtsMockitoTest {
when(branchService.isBranchesAllCommitted(teamWf)).thenReturn(true);
WidgetResult result = validator.validateTransition(workItem, provider, widgetDef, analyze, implement, atsApi);
- Assert.assertEquals(WidgetResult.Valid, result);
+ Assert.assertEquals(WidgetResult.Success, result);
when(branchService.isBranchesAllCommitted(teamWf)).thenReturn(false);
result = validator.validateTransition(workItem, provider, widgetDef, analyze, implement, atsApi);
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/review/defect/AtsXDefectValidatorTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/review/defect/AtsXDefectValidatorTest.java
index 5e7fe0ba1bc..391e1ec7bf3 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/review/defect/AtsXDefectValidatorTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/review/defect/AtsXDefectValidatorTest.java
@@ -69,7 +69,7 @@ public class AtsXDefectValidatorTest {
// Reviews do not require Defects to be entered, even if required for transition
result = validator.validateTransition(workItem, ValidatorTestUtil.emptyValueProvider, widgetDef, fromStateDef,
toStateDef, atsServices);
- Assert.assertEquals(WidgetStatus.Valid, result.getStatus());
+ Assert.assertEquals(WidgetStatus.Success, result.getStatus());
}
@org.junit.Test
@@ -90,7 +90,7 @@ public class AtsXDefectValidatorTest {
// Valid defect
WidgetResult result =
validator.validateTransition(workItem, itemValueProvider, widgetDef, fromStateDef, toStateDef, atsServices);
- Assert.assertEquals(WidgetStatus.Valid, result.getStatus());
+ Assert.assertEquals(WidgetStatus.Success, result.getStatus());
// Invalid Severity
item = getValidItem();
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/review/defect/ValidatorTestUtil.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/review/defect/ValidatorTestUtil.java
index aa4eb95b887..c75db861517 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/review/defect/ValidatorTestUtil.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/review/defect/ValidatorTestUtil.java
@@ -24,8 +24,8 @@ public class ValidatorTestUtil {
public static StringValueProvider emptyValueProvider = new StringValueProvider(new ArrayList<String>());
public static void assertValidResult(WidgetResult result) {
- Assert.assertEquals(WidgetStatus.Valid, result.getStatus());
- Assert.assertEquals(WidgetStatus.Valid.name(), result.getDetails());
+ Assert.assertEquals(WidgetStatus.Success, result.getStatus());
+ Assert.assertEquals(WidgetStatus.Success.getName(), result.getDetails());
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTransitionHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTransitionHeader.java
index 5c21a57b5a9..db9b42e3927 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTransitionHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTransitionHeader.java
@@ -191,10 +191,10 @@ public class WfeTransitionHeader extends Composite implements IAtsWorkItemTopicE
if (editor.isDirty()) {
editor.doSave(null);
}
- handleTransitionButtonSelection(awa, isEditable, toStateDef);
+ handleTransitionButtonSelection(awa, isEditable, toStateDef, this);
}
- public static void handleTransitionButtonSelection(AbstractWorkflowArtifact awa, final boolean isEditable, IAtsStateDefinition toStateDef) {
+ public static void handleTransitionButtonSelection(AbstractWorkflowArtifact awa, final boolean isEditable, IAtsStateDefinition toStateDef, final WfeTransitionHeader wfeTransitionHeader) {
ITransitionHelper helper = new TransitionHelperAdapter(AtsClientService.get().getServices()) {
@Override
@@ -301,9 +301,11 @@ public class WfeTransitionHeader extends Composite implements IAtsWorkItemTopicE
@Override
public void done(IJobChangeEvent event) {
TransitionResults results = operation.getResults();
+ results.setAtsApi(AtsClientService.get());
if (results.isErrors()) {
- TransitionResultsUi.report("Transition Failed", results);
+ TransitionResultsUi.reportDialog("Transition Failed", results);
AtsUtilClient.logExceptions(results);
+ wfeTransitionHeader.refresh();
}
}
@@ -365,23 +367,29 @@ public class WfeTransitionHeader extends Composite implements IAtsWorkItemTopicE
}
public void refresh() {
- if (Widgets.isAccessible(transitionAssigneesLabel)) {
- IAtsStateDefinition toState = userSelectedTransitionToState;
- if (toState == null) {
- toState = awa.getStateDefinition().getDefaultToState();
- }
- if (toState == null) {
- stateLabelLink.setText("<Not Set>");
- } else {
- stateLabelLink.setText(toState.getName());
- }
- stateLabelLink.getParent().layout();
+ Displays.ensureInDisplayThread(new Runnable() {
+
+ @Override
+ public void run() {
+ if (Widgets.isAccessible(transitionAssigneesLabel)) {
+ IAtsStateDefinition toState = userSelectedTransitionToState;
+ if (toState == null) {
+ toState = awa.getStateDefinition().getDefaultToState();
+ }
+ if (toState == null) {
+ stateLabelLink.setText("<Not Set>");
+ } else {
+ stateLabelLink.setText(toState.getName());
+ }
+ stateLabelLink.getParent().layout();
- transitionLabelLink.setEnabled(true);
+ transitionLabelLink.setEnabled(true);
- transitionAssigneesLabel.setText(awa.getTransitionAssigneesStr());
- transitionAssigneesLabel.getParent().layout();
- }
+ transitionAssigneesLabel.setText(awa.getTransitionAssigneesStr());
+ transitionAssigneesLabel.getParent().layout();
+ }
+ }
+ });
}
private void handleChangeTransitionAssignees(AbstractWorkflowArtifact aba) {
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/AtsUtilClient.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/AtsUtilClient.java
index 8ac4ca67f6d..e96d767f6f4 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/AtsUtilClient.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/AtsUtilClient.java
@@ -15,7 +15,7 @@ import java.util.List;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.util.AtsUtil;
-import org.eclipse.osee.ats.api.workdef.ITransitionResult;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResult;
import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.api.workflow.transition.TransitionWorkItemResult;
import org.eclipse.osee.ats.ide.internal.Activator;
@@ -87,17 +87,17 @@ public class AtsUtilClient {
* Log exceptions to OseeLog. Don't always want to do this due to testing.
*/
public static void logExceptions(TransitionResults transResult) {
- for (ITransitionResult result : transResult.getResults()) {
+ for (TransitionResult result : transResult.getResults()) {
String ex = result.getException();
if (Strings.isValid(ex)) {
OseeLog.log(TransitionResults.class, Level.SEVERE, result.getDetails() + "\n\n" + ex);
}
}
for (TransitionWorkItemResult transitionWorkItemResult : transResult.getTransitionWorkItems()) {
- for (ITransitionResult result : transitionWorkItemResult.getResults()) {
+ for (TransitionResult result : transitionWorkItemResult.getResults()) {
String ex = result.getException();
if (Strings.isValid(ex)) {
- String message = transitionWorkItemResult.getWorkItem().toStringWithId() + " - " + result.getDetails();
+ String message = transitionWorkItemResult.getWorkItemId().toStringWithId() + " - " + result.getDetails();
OseeLog.log(TransitionResults.class, Level.SEVERE, message + "\n\n" + ex);
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsOperationalImpactValidator.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsOperationalImpactValidator.java
index a937c1d1b21..0f32966ea6d 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsOperationalImpactValidator.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsOperationalImpactValidator.java
@@ -24,7 +24,7 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
* Test unit for {@link
- *
+ *
* @author Donald G. Dunne
*/
public class AtsOperationalImpactValidator extends AtsXWidgetValidator {
@@ -32,7 +32,7 @@ public class AtsOperationalImpactValidator extends AtsXWidgetValidator {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, AtsApi atsServices) {
- WidgetResult result = WidgetResult.Valid;
+ WidgetResult result = WidgetResult.Success;
if (WIDGET_NAME.equals(widgetDef.getXWidgetName())) {
if (provider instanceof ArtifactValueProvider && ((ArtifactValueProvider) provider).getArtifact() instanceof TeamWorkFlowArtifact) {
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) ((ArtifactValueProvider) provider).getArtifact();
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsOperationalImpactWithWorkaroundValidator.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsOperationalImpactWithWorkaroundValidator.java
index 71dad01964a..873867ab7a5 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsOperationalImpactWithWorkaroundValidator.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsOperationalImpactWithWorkaroundValidator.java
@@ -31,7 +31,7 @@ public class AtsOperationalImpactWithWorkaroundValidator implements IAtsXWidgetV
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, AtsApi atsServices) {
- WidgetResult result = WidgetResult.Valid;
+ WidgetResult result = WidgetResult.Success;
if (WIDGET_NAME.equals(widgetDef.getXWidgetName())) {
if (provider instanceof TeamWorkFlowArtifact) {
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) provider;
@@ -39,7 +39,8 @@ public class AtsOperationalImpactWithWorkaroundValidator implements IAtsXWidgetV
if (impact.equals("Yes")) {
String desc = teamArt.getSoleAttributeValue(AtsAttributeTypes.OperationalImpactDescription, "");
if (!Strings.isValid(desc)) {
- return new WidgetResult(WidgetStatus.Invalid_Incompleted, "Must enter [%s]", AtsAttributeTypes.OperationalImpactDescription.getName());
+ return new WidgetResult(WidgetStatus.Invalid_Incompleted, "Must enter [%s]",
+ AtsAttributeTypes.OperationalImpactDescription.getName());
}
}
String workaroundChecked =
@@ -48,7 +49,8 @@ public class AtsOperationalImpactWithWorkaroundValidator implements IAtsXWidgetV
String desc =
teamArt.getSoleAttributeValue(AtsAttributeTypes.OperationalImpactWorkaroundDescription, "");
if (!Strings.isValid(desc)) {
- return new WidgetResult(WidgetStatus.Invalid_Incompleted, "Must enter [%s]", AtsAttributeTypes.OperationalImpactWorkaroundDescription.getName());
+ return new WidgetResult(WidgetStatus.Invalid_Incompleted, "Must enter [%s]",
+ AtsAttributeTypes.OperationalImpactWorkaroundDescription.getName());
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsXCommitManagerValidator.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsXCommitManagerValidator.java
index ec9450666a5..4b169caa84d 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsXCommitManagerValidator.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsXCommitManagerValidator.java
@@ -38,7 +38,7 @@ public class AtsXCommitManagerValidator extends AtsXWidgetValidator {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, AtsApi atsServices) {
- WidgetResult result = WidgetResult.Valid;
+ WidgetResult result = WidgetResult.Success;
if ("XCommitManager".equals(widgetDef.getXWidgetName())) {
try {
IAtsBranchService branchService = atsServices.getBranchService();
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsXHyperlinkMemberSelValidator.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsXHyperlinkMemberSelValidator.java
index fe9915c0901..37382ae1d02 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsXHyperlinkMemberSelValidator.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/validate/AtsXHyperlinkMemberSelValidator.java
@@ -25,10 +25,10 @@ public class AtsXHyperlinkMemberSelValidator extends AtsXWidgetValidator {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, AtsApi atsServices) {
- WidgetResult result = WidgetResult.Valid;
+ WidgetResult result = WidgetResult.Success;
if ("XHyperlabelMemberSelDam".equals(widgetDef.getXWidgetName())) {
result = validateWidgetIsRequired(provider, widgetDef, fromStateDef, toStateDef);
- if (!result.isValid()) {
+ if (!result.isSuccess()) {
return result;
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/defect/AtsXDefectValidator.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/defect/AtsXDefectValidator.java
index 4c80f0dbe6b..6d75a1ad64a 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/defect/AtsXDefectValidator.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/defect/AtsXDefectValidator.java
@@ -29,7 +29,7 @@ public class AtsXDefectValidator extends AtsXWidgetValidator {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, AtsApi atsServices) {
- WidgetResult result = WidgetResult.Valid;
+ WidgetResult result = WidgetResult.Success;
if (WIDGET_NAME.equals(widgetDef.getXWidgetName())) {
ReviewDefectManager mgr = new ReviewDefectManager(provider);
ReviewDefectError error = ReviewDefectValidator.isValid(mgr.getDefectItems());
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/role/AtsXUserRoleValidator.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/role/AtsXUserRoleValidator.java
index 93898ef1033..3dd996dd478 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/role/AtsXUserRoleValidator.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/role/AtsXUserRoleValidator.java
@@ -29,7 +29,7 @@ public class AtsXUserRoleValidator extends AtsXWidgetValidator {
@Override
public WidgetResult validateTransition(IAtsWorkItem workItem, IValueProvider provider, IAtsWidgetDefinition widgetDef, IAtsStateDefinition fromStateDef, IAtsStateDefinition toStateDef, AtsApi atsApi) {
- WidgetResult result = WidgetResult.Valid;
+ WidgetResult result = WidgetResult.Success;
if (WIDGET_NAME.equals(widgetDef.getXWidgetName())) {
// ReviewDefectValidation converted to provider IValueProvider
IAtsPeerReviewRoleManager mgr = ((IAtsPeerToPeerReview) workItem).getRoleManager();
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/role/UserRoleError.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/role/UserRoleError.java
index f0df36eeb9c..3cf50d2dc8f 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/role/UserRoleError.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/review/role/UserRoleError.java
@@ -13,23 +13,33 @@ package org.eclipse.osee.ats.ide.workflow.review.role;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workdef.WidgetStatus;
+import org.eclipse.osee.framework.core.enums.OseeEnum;
/**
* @author Donald G. Dunne
*/
-public enum UserRoleError {
+public class UserRoleError extends OseeEnum {
- None("", WidgetStatus.Valid),
- OneRoleEntryRequired("At least one role entry is required.", WidgetStatus.Invalid_Incompleted),
- ExceptionValidatingRoles("Exception validating roles. See log for details.", WidgetStatus.Exception),
- MustHaveAtLeastOneAuthor("Must have at least one Author.", WidgetStatus.Invalid_Incompleted),
- MustHaveAtLeastOneReviewer("Must have at least one Reviewer (a ModeratorReviewer can fulfill this requirement).", WidgetStatus.Invalid_Incompleted),
- HoursSpentMustBeEnteredForEachRole("Hours spent must be entered for each role.", WidgetStatus.Invalid_Incompleted);
+ private static final Long ENUM_ID = 999223411L;
+
+ // @formatter:off
+ public static final UserRoleError None = new UserRoleError("None", "", WidgetStatus.Success);
+ public static final UserRoleError OneRoleEntryRequired = new UserRoleError("OneRoleEntryRequired", "At least one role entry is required.", WidgetStatus.Invalid_Incompleted);
+ public static final UserRoleError ExceptionValidatingRoles = new UserRoleError("ExceptionValidatingRoles", "Exception validating roles. See log for details.", WidgetStatus.Exception);
+ public static final UserRoleError MustHaveAtLeastOneAuthor = new UserRoleError("MustHaveAtLeastOneAuthor", "Must have at least one Author.", WidgetStatus.Invalid_Incompleted);
+ public static final UserRoleError MustHaveAtLeastOneReviewer = new UserRoleError("MustHaveAtLeastOneReviewer", "Must have at least one Reviewer (a ModeratorReviewer can fulfill this requirement).", WidgetStatus.Invalid_Incompleted);
+ public static final UserRoleError HoursSpentMustBeEnteredForEachRole = new UserRoleError("HoursSpentMustBeEnteredForEachRole", "Hours spent must be entered for each role.", WidgetStatus.Invalid_Incompleted);
+ // @formatter:on
private final String error;
private final WidgetStatus widgetStatus;
- private UserRoleError(String error, WidgetStatus widgetStatus) {
+ public UserRoleError() {
+ this("", "", WidgetStatus.Success);
+ }
+
+ public UserRoleError(String name, String error, WidgetStatus widgetStatus) {
+ super(ENUM_ID, name);
this.error = error;
this.widgetStatus = widgetStatus;
}
@@ -44,9 +54,18 @@ public enum UserRoleError {
public WidgetResult toWidgetResult(IAtsWidgetDefinition widgetDef) {
if (this == None) {
- return WidgetResult.Valid;
+ return WidgetResult.Success;
}
return new WidgetResult(widgetStatus, getError());
}
+ @Override
+ public Long getTypeId() {
+ return ENUM_ID;
+ }
+
+ @Override
+ public OseeEnum getDefault() {
+ return None;
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/transition/TransitionResultsUi.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/transition/TransitionResultsUi.java
index 1c6a43acf3e..ee5879f3c3d 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/transition/TransitionResultsUi.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/transition/TransitionResultsUi.java
@@ -10,9 +10,12 @@
*******************************************************************************/
package org.eclipse.osee.ats.ide.workflow.transition;
+import org.eclipse.osee.ats.api.util.AtsUtil;
import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.ui.skynet.results.ResultsEditor;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.HtmlDialog;
+import org.eclipse.osee.framework.ui.swt.Displays;
/**
* @author Donald G. Dunne
@@ -24,7 +27,25 @@ public class TransitionResultsUi {
}
public static void report(String name, TransitionResults transResults) {
- ResultsEditor.open("results", name, AHTML.simplePage(transResults.getResultString()));
+ String html = transResults.getResultString();
+ html = AHTML.textToHtml(html);
+ ResultsEditor.open("results", name, AHTML.simplePage(html));
+ }
+
+ public static void reportDialog(String name, TransitionResults transResults) {
+ if (AtsUtil.isInTest()) {
+ return;
+ }
+ String html = transResults.getResultString();
+ final String fHtml = AHTML.textToHtml(html);
+ Displays.ensureInDisplayThread(new Runnable() {
+
+ @Override
+ public void run() {
+ HtmlDialog dialog = new HtmlDialog(name, name, fHtml);
+ dialog.open();
+ }
+ });
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/transition/TransitionToMenu.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/transition/TransitionToMenu.java
index 665b44fce97..7d268f81c9d 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/transition/TransitionToMenu.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/transition/TransitionToMenu.java
@@ -274,7 +274,7 @@ public class TransitionToMenu {
String resultStr = results.getResultString();
AWorkbench.popup(MessageType.Error, "Transition Failed", resultStr);
} else {
- TransitionResultsUi.report("Transition Failed", results);
+ TransitionResultsUi.reportDialog("Transition Failed", results);
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsActionEndpointImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsActionEndpointImpl.java
index f0bd86626f6..c011e311168 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsActionEndpointImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsActionEndpointImpl.java
@@ -742,7 +742,8 @@ public final class AtsActionEndpointImpl implements AtsActionEndpointApi {
@Consumes({MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_JSON})
public TransitionResults transitionValidate(TransitionData transData) {
- return atsApi.getWorkItemService().transitionValidate(transData);
+ TransitionResults results = atsApi.getWorkItemService().transitionValidate(transData);
+ return results;
}
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/OseeEnum.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/OseeEnum.java
new file mode 100644
index 00000000000..e43fbf230f7
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/OseeEnum.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2020 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.framework.core.enums;
+
+import java.util.Collection;
+import java.util.Collections;
+import org.eclipse.osee.framework.jdk.core.type.HashCollection;
+import org.eclipse.osee.framework.jdk.core.type.NamedIdBase;
+
+/**
+ * Simple Enum class that provides few things over enum class.</br>
+ * </br>
+ * 1) It searilizes/desearilizes automatically</br>
+ * 2) Provides a default get(String) method that doesn't exception if no match</br>
+ * 3) Other parameters can be easily added while named/id is automatic</br>
+ *
+ * @author Donald G. Dunne
+ */
+public abstract class OseeEnum extends NamedIdBase {
+ protected static final HashCollection<Long, OseeEnum> idToEnums = new HashCollection<Long, OseeEnum>(15);
+
+ /**
+ * Add enum with next ordinal
+ */
+ public OseeEnum(Long typeId, String name) {
+ super(-1L, name);
+ setId(Long.valueOf(values().size()));
+ idToEnums.put(typeId, this);
+ }
+
+ public OseeEnum(Long typeId, Long ordinal, String name) {
+ super(ordinal, name);
+ idToEnums.put(typeId, this);
+ }
+
+ abstract public Long getTypeId();
+
+ abstract public OseeEnum getDefault();
+
+ /**
+ * @return OseeEnum matching name or sentinel
+ */
+ public OseeEnum get(String name) {
+ for (OseeEnum oEnum : idToEnums.getValues(getTypeId())) {
+ if (oEnum.name().equals(name)) {
+ return oEnum;
+ }
+ }
+ return getDefault();
+ }
+
+ public String name() {
+ return getName();
+ }
+
+ public Collection<OseeEnum> values() {
+ Collection<OseeEnum> values = idToEnums.getValues(getTypeId());
+ if (values == null) {
+ return Collections.emptyList();
+ }
+ return values;
+ }
+
+} \ No newline at end of file

Back to the top