Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2021-01-12 04:17:19 +0000
committerdonald.g.dunne2021-01-12 04:17:19 +0000
commit0942feceb7c1a2e98f5c753eec989a33db7fa945 (patch)
tree763f1851d93a63e6ef834dfb0f1c05c074b56abe
parent56295410236dc8e5a0ca56d160f55af2ad0c94c6 (diff)
downloadorg.eclipse.osee-0942feceb7c1a2e98f5c753eec989a33db7fa945.tar.gz
org.eclipse.osee-0942feceb7c1a2e98f5c753eec989a33db7fa945.tar.xz
org.eclipse.osee-0942feceb7c1a2e98f5c753eec989a33db7fa945.zip
bug[TW18555]: Convert WFE isDirty to use XResultData
-rw-r--r--plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/actions/DirtyReportActionTest1.java7
-rw-r--r--plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/actions/DirtyReportActionTest2.java6
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/DirtyReportAction.java18
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/IDirtyReportable.java4
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/WorkflowEditor.java39
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/WfeWorkFlowTab.java18
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeCustomHeader.java7
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java12
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTitleHeader.java9
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeWorkflowSection.java5
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AbstractWorkflowArtifact.java31
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidget.java2
12 files changed, 83 insertions, 75 deletions
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/actions/DirtyReportActionTest1.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/actions/DirtyReportActionTest1.java
index 957db4bbfb4..be593656667 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/actions/DirtyReportActionTest1.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/actions/DirtyReportActionTest1.java
@@ -16,7 +16,7 @@ package org.eclipse.osee.ats.ide.integration.tests.ats.actions;
import org.eclipse.osee.ats.ide.actions.DirtyReportAction;
import org.eclipse.osee.ats.ide.actions.IDirtyReportable;
import org.eclipse.osee.ats.ide.integration.tests.ats.workflow.AtsTestUtil;
-import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.result.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.junit.Test;
@@ -36,8 +36,9 @@ public class DirtyReportActionTest1 extends AbstractAtsActionTest {
public DirtyReportAction createAction() {
return new DirtyReportAction(new IDirtyReportable() {
@Override
- public Result isDirtyResult() {
- return new Result("Hello World");
+ public XResultData isDirtyResult(XResultData rd) {
+ rd.log("Hello World");
+ return rd;
}
});
}
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/actions/DirtyReportActionTest2.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/actions/DirtyReportActionTest2.java
index 7a629fd4423..61fae596fc5 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/actions/DirtyReportActionTest2.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/actions/DirtyReportActionTest2.java
@@ -16,7 +16,7 @@ package org.eclipse.osee.ats.ide.integration.tests.ats.actions;
import org.eclipse.osee.ats.ide.actions.DirtyReportAction;
import org.eclipse.osee.ats.ide.actions.IDirtyReportable;
import org.eclipse.osee.ats.ide.integration.tests.ats.workflow.AtsTestUtil;
-import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.result.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.junit.Test;
@@ -36,8 +36,8 @@ public class DirtyReportActionTest2 extends AbstractAtsActionTest {
public DirtyReportAction createAction() {
return new DirtyReportAction(new IDirtyReportable() {
@Override
- public Result isDirtyResult() {
- return Result.TrueResult;
+ public XResultData isDirtyResult(XResultData rd) {
+ return rd;
}
});
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/DirtyReportAction.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/DirtyReportAction.java
index fd8783449d9..8f754270dff 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/DirtyReportAction.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/DirtyReportAction.java
@@ -15,10 +15,10 @@ package org.eclipse.osee.ats.ide.actions;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osee.ats.api.util.AtsUtil;
-import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.result.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
-import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.results.XResultDataUI;
import org.eclipse.osee.framework.ui.swt.ImageManager;
/**
@@ -36,11 +36,19 @@ public class DirtyReportAction extends AbstractAtsAction {
@Override
public void runWithException() {
- Result result = reportable.isDirtyResult();
+ XResultData rd = new XResultData();
+ rd.log("WorkflowEditor Dirty Report\n-----------------------------------------------\n");
+ reportable.isDirtyResult(rd);
if (AtsUtil.isInTest()) {
- throw new OseeStateException("Dirty Report", result.isFalse() ? "Not Dirty" : "Dirty -> " + result.getText());
+ throw new OseeStateException("Dirty Report", rd.isSuccess() ? "Not Dirty" : "Dirty -> " + rd.toString());
} else {
- AWorkbench.popup("Dirty Report", result.isFalse() ? "Not Dirty" : "Dirty -> " + result.getText());
+ rd.log("\n-----------------------------------------------");
+ if (rd.isSuccess()) {
+ rd.log("Editor is Not Dirty");
+ } else {
+ rd.error("Editor is Dirty");
+ }
+ XResultDataUI.report(rd, "Dirty Report - " + (rd.isSuccess() ? "Not Dirty" : "Dirty"));
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/IDirtyReportable.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/IDirtyReportable.java
index d5ab3fa029e..0b24a16dfc4 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/IDirtyReportable.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/actions/IDirtyReportable.java
@@ -13,13 +13,13 @@
package org.eclipse.osee.ats.ide.actions;
-import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.result.XResultData;
/**
* @author Donald G. Dunne
*/
public interface IDirtyReportable {
- public Result isDirtyResult();
+ public XResultData isDirtyResult(XResultData rd);
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/WorkflowEditor.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/WorkflowEditor.java
index 96db83941d6..fe305a5c2c2 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/WorkflowEditor.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/WorkflowEditor.java
@@ -70,12 +70,13 @@ import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.core.util.OsgiUtil;
-import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.result.XResultData;
import org.eclipse.osee.framework.jdk.core.type.DoubleKeyHashMap;
import org.eclipse.osee.framework.jdk.core.type.HashCollectionSet;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -330,7 +331,7 @@ public class WorkflowEditor extends AbstractArtifactEditor implements IDirtyRepo
}
WfeArtifactEventManager.remove(this);
WfeBranchEventManager.remove(this);
- if (workItem != null && !workItem.isDeleted() && workItem.isWfeDirty().isTrue()) {
+ if (workItem != null && !workItem.isDeleted() && workItem.isWfeDirty(new XResultData()).isErrors()) {
workItem.revert();
}
// Tabs are disposed by editor
@@ -367,41 +368,39 @@ public class WorkflowEditor extends AbstractArtifactEditor implements IDirtyRepo
@Override
public boolean isDirty() {
- return isDirtyResult().isTrue();
+ return isDirtyResult(new XResultData()).isErrors();
}
@Override
- public Result isDirtyResult() {
+ public XResultData isDirtyResult(XResultData rd) {
if (workFlowTab == null || getWfeInput().isReload() || (workItem != null && workItem.isDeleted())) {
- return Result.FalseResult;
+ return rd;
}
try {
- Result result = workFlowTab.isXWidgetDirty();
- if (result.isTrue()) {
- return result;
- }
- result = ((AbstractWorkflowArtifact) ((WfeInput) getEditorInput()).getArtifact()).isWfeDirty();
- if (result.isTrue()) {
- return result;
- }
+ rd.log("===> WorkFlowTab.isXWidgetDirty\n");
+ workFlowTab.isXWidgetDirty(rd);
+
+ rd.log("\n===> AWA.isWfeDirty\n");
+ ((AbstractWorkflowArtifact) ((WfeInput) getEditorInput()).getArtifact()).isWfeDirty(rd);
- String rString = null;
+ rd.log("\n===> Attribute.isDirty\n");
for (Attribute<?> attribute : workItem.internalGetAttributes()) {
if (attribute.isDirty()) {
- rString = "Attribute: " + attribute.getNameValueDescription();
- break;
+ rd.errorf("Attribute [%s] is dirty\n", attribute.getNameValueDescription());
}
}
- if (rString == null) {
- rString = RelationManager.reportHasDirtyLinks(workItem);
+ rd.log("\n===> RelationMgr.isDirty\n");
+ String rString = RelationManager.reportHasDirtyLinks(workItem);
+ if (Strings.isValid(rString)) {
+ rd.error("Relation tab is dirty\n");
}
- return new Result(rString != null, rString);
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
- return new Result(true, ex.getLocalizedMessage());
+ rd.errorf("\n===> WorkflowException.Exception\n[%s]\n", Lib.exceptionToString(ex));
}
+ return rd;
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/WfeWorkFlowTab.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/WfeWorkFlowTab.java
index 92a06d67bca..6249550b785 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/WfeWorkFlowTab.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/WfeWorkFlowTab.java
@@ -49,6 +49,7 @@ import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.result.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -372,21 +373,16 @@ public class WfeWorkFlowTab extends WfeAbstractTab implements IWorldViewerEventH
});
}
- public Result isXWidgetDirty() {
- Result result = null;
+ public XResultData isXWidgetDirty(XResultData rd) {
if (Widgets.isAccessible(headerComp)) {
- result = headerComp.isXWidgetDirty();
- if (result != null && result.isTrue()) {
- return result;
- }
+ rd.log("======> WFE - Header\n");
+ headerComp.isXWidgetDirty(rd);
}
for (WfeWorkflowSection section : sections) {
- result = section.isXWidgetDirty();
- if (result.isTrue()) {
- return result;
- }
+ rd.logf("======> WFE Section - %s\n", section.getStatePage().getName());
+ section.isXWidgetDirty(rd);
}
- return Result.FalseResult;
+ return rd;
}
public Result isXWidgetSavable() {
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeCustomHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeCustomHeader.java
index 7b1fe89b3a3..ac3bc807bca 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeCustomHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeCustomHeader.java
@@ -29,6 +29,7 @@ import org.eclipse.osee.ats.ide.workdef.XWidgetPage;
import org.eclipse.osee.ats.ide.workflow.ATSXWidgetOptionResolver;
import org.eclipse.osee.ats.ide.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.result.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -154,19 +155,19 @@ public class WfeCustomHeader extends Composite {
return "Header for " + workItem.toStringWithId();
}
- public Result isXWidgetDirty() {
+ public XResultData isXWidgetDirty(XResultData rd) {
for (XWidget widget : allXWidgets) {
if (widget instanceof IArtifactStoredWidget) {
IArtifactStoredWidget artifactStoredWidget = (IArtifactStoredWidget) widget;
if (artifactStoredWidget.getArtifact() != null) {
Result result = artifactStoredWidget.isDirty();
if (result.isTrue()) {
- return result;
+ rd.errorf("Widget [%s] is dirty\n", widget.toString());
}
}
}
}
- return Result.FalseResult;
+ return rd;
}
public void getDirtyIArtifactWidgets(List<IArtifactStoredWidget> widgets) {
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java
index 57be5a90a74..7beac824d99 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java
@@ -34,6 +34,7 @@ import org.eclipse.osee.ats.ide.workflow.hooks.IAtsWorkItemHookIde;
import org.eclipse.osee.ats.ide.workflow.review.AbstractReviewArtifact;
import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.result.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -287,17 +288,14 @@ public class WfeHeaderComposite extends Composite {
}
}
- public Result isXWidgetDirty() {
+ public XResultData isXWidgetDirty(XResultData rd) {
if (titleHeader != null) {
- Result result = titleHeader.isXWidgetDirty();
- if (result.isTrue()) {
- return result;
- }
+ titleHeader.isXWidgetDirty(rd);
}
if (customHeader != null) {
- return customHeader.isXWidgetDirty();
+ customHeader.isXWidgetDirty(rd);
}
- return Result.FalseResult;
+ return rd;
}
public void getDirtyIArtifactWidgets(List<IArtifactStoredWidget> artWidgets) {
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTitleHeader.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTitleHeader.java
index dd4995dff93..0ce4b36e4ea 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTitleHeader.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeTitleHeader.java
@@ -25,6 +25,7 @@ import org.eclipse.osee.ats.ide.editor.event.IWfeEventHandle;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.result.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -82,11 +83,13 @@ public class WfeTitleHeader extends Composite implements IWfeEventHandle {
return titleText;
}
- public Result isXWidgetDirty() {
+ public XResultData isXWidgetDirty(XResultData rd) {
if (titleText != null) {
- return titleText.isDirty();
+ if (titleText.isDirty().isTrue()) {
+ rd.error("Title is dirty");
+ }
}
- return Result.FalseResult;
+ return rd;
}
public Result isXWidgetSavable() {
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeWorkflowSection.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeWorkflowSection.java
index 6aa3e8dc7ad..17c3255e7f8 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeWorkflowSection.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/section/WfeWorkflowSection.java
@@ -39,6 +39,7 @@ import org.eclipse.osee.ats.ide.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.ide.workflow.hooks.IAtsWorkItemHookIde;
import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.result.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.DateUtil;
@@ -358,14 +359,14 @@ public class WfeWorkflowSection extends SectionPart {
return statePage + " for " + getSma();
}
- public Result isXWidgetDirty() {
+ public Result isXWidgetDirty(XResultData rd) {
for (XWidget widget : allXWidgets) {
if (widget instanceof IArtifactStoredWidget) {
IArtifactStoredWidget artifactStoredWidget = (IArtifactStoredWidget) widget;
if (artifactStoredWidget.getArtifact() != null) {
Result result = artifactStoredWidget.isDirty();
if (result.isTrue()) {
- return result;
+ rd.errorf("Widget [%s] is dirty\n", widget.toString());
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AbstractWorkflowArtifact.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AbstractWorkflowArtifact.java
index 277686fce10..6be741cc880 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AbstractWorkflowArtifact.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/workflow/AbstractWorkflowArtifact.java
@@ -53,10 +53,11 @@ import org.eclipse.osee.framework.core.services.HasCmAccessControl;
import org.eclipse.osee.framework.core.util.IGroupExplorerProvider;
import org.eclipse.osee.framework.core.util.OsgiUtil;
import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.result.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -138,7 +139,7 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
*
* @return true if any object in SMA tree is dirty
*/
- public Result isWfeDirty() {
+ public XResultData isWfeDirty(XResultData rd) {
try {
Set<Artifact> artifacts = new HashSet<>();
getSmaArtifactsOneLevel(this, artifacts);
@@ -146,34 +147,33 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
if (artifact instanceof AbstractWorkflowArtifact) {
AbstractWorkflowArtifact awa = (AbstractWorkflowArtifact) artifact;
if (awa.getStateMgr() == null) {
- throw new OseeStateException("StateManager can not be null for %s", artifact.toStringWithId());
- }
- if (awa.getStateMgr().isDirty()) {
- return new Result(true, "StateManager is dirty");
+ rd.errorf("StateManager can not be null for %s", artifact.toStringWithId());
}
+ awa.getStateMgr().isDirty();
+
if (awa.getLog().isDirty()) {
- return new Result(true, "Log is dirty");
+ rd.error("Log is dirty");
}
}
if (artifact.isDirty()) {
- String rString = null;
for (Attribute<?> attribute : artifact.internalGetAttributes()) {
if (attribute.isDirty()) {
- rString = "Attribute: " + attribute.getNameValueDescription();
- break;
+ rd.errorf("Dirty Attribute: " + attribute.getNameValueDescription() + "\n");
}
}
- if (rString == null) {
- rString = RelationManager.reportHasDirtyLinks(artifact);
+ String rString = RelationManager.reportHasDirtyLinks(artifact);
+ if (Strings.isValid(rString)) {
+ rd.errorf("Dirty Relation Tab: " + rString + " \n");
}
- return new Result(true, String.format("Artifact %s is dirty\n\n%s", artifact.toStringWithId(), rString));
+
}
}
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, "Unable to determine if artifact is dirty " + getAtsId(), ex);
+ rd.errorf("Exception in isWfeDirty [%s]", Lib.exceptionToString(ex));
}
- return Result.FalseResult;
+ return rd;
}
public void save(IAtsChangeSet changes) {
@@ -269,7 +269,8 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
}
/**
- * Return true if workItem is TeamWorkflowArtifact or review of a team workflow and it's IAtsTeamDefinition has rule set
+ * Return true if workItem is TeamWorkflowArtifact or review of a team workflow and it's IAtsTeamDefinition has rule
+ * set
*/
public boolean teamDefHasRule(RuleDefinitionOption option) {
TeamWorkFlowArtifact teamArt = null;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidget.java
index 85347bf8ed1..5e78ebdeca6 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/XWidget.java
@@ -358,7 +358,7 @@ public abstract class XWidget {
@Override
public String toString() {
- return String.format("%s: %s\n\n", getLabel(), getReportData());
+ return String.format("%s: %s", getLabel(), getReportData());
}
public void setDisplayLabel(boolean displayLabel) {

Back to the top