Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2014-05-20 22:56:18 +0000
committerRoberto E. Escobar2014-09-29 22:54:55 +0000
commit59d292bf3a48edc4fcd36bdcec583971b2c0a686 (patch)
tree4330d401112a85d40d7343aafcf7a41dd150a28d
parentbe16dcc01d7c3c5b9958bf8e626fb8b011982511 (diff)
downloadorg.eclipse.osee-59d292bf3a48edc4fcd36bdcec583971b2c0a686.tar.gz
org.eclipse.osee-59d292bf3a48edc4fcd36bdcec583971b2c0a686.tar.xz
org.eclipse.osee-59d292bf3a48edc4fcd36bdcec583971b2c0a686.zip
feature: Reset rerun flag on reimport of item
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java6
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoWriter.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java16
3 files changed, 15 insertions, 9 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
index 4bdce8d2104..b61e28911f5 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
@@ -188,7 +188,7 @@ public class DispoApiImpl implements DispoApi {
return wasUpdated;
}
- private boolean editDispoItems(DispoProgram program, List<DispoItem> dispoItems) {
+ private boolean editDispoItems(DispoProgram program, List<DispoItem> dispoItems, boolean resetRerunFlag) {
boolean wasUpdated = false;
for (DispoItem dispoItem : dispoItems) {
@@ -200,7 +200,7 @@ public class DispoApiImpl implements DispoApi {
}
ArtifactReadable author = getQuery().findUser();
- getWriter().updateDispoItems(author, program, dispoItems);
+ getWriter().updateDispoItems(author, program, dispoItems, resetRerunFlag);
wasUpdated = true;
return wasUpdated;
}
@@ -390,7 +390,7 @@ public class DispoApiImpl implements DispoApi {
createDispoItems(program, setToEdit.getGuid(), itemsToCreate);
}
if (itemsToEdit.size() > 0) {
- editDispoItems(program, itemsToEdit);
+ editDispoItems(program, itemsToEdit, true);
}
} catch (Exception ex) {
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoWriter.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoWriter.java
index a5044487565..2d1fcb49a1f 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoWriter.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoWriter.java
@@ -34,5 +34,5 @@ public interface DispoWriter {
void updateDispoItem(ArtifactReadable author, DispoProgram program, String dispoItemId, DispoItem data);
- void updateDispoItems(ArtifactReadable author, DispoProgram program, List<DispoItem> data);
+ void updateDispoItems(ArtifactReadable author, DispoProgram program, List<DispoItem> data, boolean resetRerunFlag);
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
index d0434fce7b2..882c744290d 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
@@ -289,9 +289,8 @@ public class OrcsStorageImpl implements Storage {
tx.commit();
}
- public void updateSingleItem(ArtifactReadable author, DispoProgram program, ArtifactId currentItemArt, DispoItem newItemData, TransactionBuilder tx) {
+ private void updateSingleItem(ArtifactReadable author, DispoProgram program, ArtifactId currentItemArt, DispoItem newItemData, TransactionBuilder tx, boolean resetRerunFlag) {
Date lastUpdate = newItemData.getLastUpdate();
- Boolean needsRerun = newItemData.getNeedsRerun();
String name = newItemData.getName();
JSONObject discrepanciesList = newItemData.getDiscrepanciesList();
JSONArray annotationsList = newItemData.getAnnotationsList();
@@ -299,6 +298,13 @@ public class OrcsStorageImpl implements Storage {
String assignee = newItemData.getAssignee();
String totalPoints = newItemData.getTotalPoints();
+ Boolean needsRerun;
+ if (resetRerunFlag) {
+ needsRerun = false;
+ } else {
+ needsRerun = newItemData.getNeedsRerun();
+ }
+
if (name != null) {
tx.setName(currentItemArt, name);
}
@@ -331,17 +337,17 @@ public class OrcsStorageImpl implements Storage {
IOseeBranch branch = TokenFactory.createBranch(program.getUuid(), "");
TransactionBuilder tx = getTxFactory().createTransaction(branch, author, "Edit Dispo Item");
ArtifactId dispoItemArt = findDispoArtifact(program, dispoItemId, DispoConstants.DispoItem);
- updateSingleItem(author, program, dispoItemArt, data, tx);
+ updateSingleItem(author, program, dispoItemArt, data, tx, false);
tx.commit();
}
@Override
- public void updateDispoItems(ArtifactReadable author, DispoProgram program, List<DispoItem> data) {
+ public void updateDispoItems(ArtifactReadable author, DispoProgram program, List<DispoItem> data, boolean resetRerunFlag) {
TransactionBuilder tx = getTxFactory().createTransaction(program.getUuid(), author, "Edit Multiple Dispo Items");
for (DispoItem newItem : data) {
ArtifactId dispoItemArt = findDispoArtifact(program, newItem.getGuid(), DispoConstants.DispoItem);
- updateSingleItem(author, program, dispoItemArt, newItem, tx);
+ updateSingleItem(author, program, dispoItemArt, newItem, tx, resetRerunFlag);
}
tx.commit();

Back to the top