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/wor