Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2013-10-17 23:02:31 +0000
committerRoberto E. Escobar2013-11-25 23:45:29 +0000
commitd07bba90619cee2f19d25bbfeb83935144832555 (patch)
tree7da5782f4df423bb67cf27d74dc1b230dcbb805d /plugins/org.eclipse.osee.ats.client.demo
parentc4f67af4a1438b08fff0e55c0e63597300e265ca (diff)
downloadorg.eclipse.osee-d07bba90619cee2f19d25bbfeb83935144832555.tar.gz
org.eclipse.osee-d07bba90619cee2f19d25bbfeb83935144832555.tar.xz
org.eclipse.osee-d07bba90619cee2f19d25bbfeb83935144832555.zip
feature[ats_S5JDQ]: Move TransitionManager to ats.core
- Replace client-only SkynetTransaction with AtsChangeSet - Convert necessary Artifact references objects with ATS interfaces - Move TransitionManager to ats.core Change-Id: I629cd44a06e1435679c542ebdee3664017692092
Diffstat (limited to 'plugins/org.eclipse.osee.ats.client.demo')
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java45
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateSawBuild2Actions.java69
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java66
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/CreateGoalTestDemoArtifacts.java78
5 files changed, 114 insertions, 146 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF
index 94a080b742..95c5ab0189 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.client.demo/META-INF/MANIFEST.MF
@@ -24,10 +24,12 @@ Import-Package: org.eclipse.core.filesystem,
org.eclipse.osee.ats.api.rule,
org.eclipse.osee.ats.api.team,
org.eclipse.osee.ats.api.user,
+ org.eclipse.osee.ats.api.util,
org.eclipse.osee.ats.api.version,
org.eclipse.osee.ats.api.workdef,
org.eclipse.osee.ats.api.workflow,
org.eclipse.osee.ats.api.workflow.state,
+ org.eclipse.osee.ats.api.workflow.transition,
org.eclipse.osee.ats.core,
org.eclipse.osee.ats.core.client,
org.eclipse.osee.ats.core.client.action,
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java
index 4b3b42717f..8f17491e8d 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateDemoActions.java
@@ -20,8 +20,10 @@ import java.util.logging.Level;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.client.demo.config.DemoDbActionData;
import org.eclipse.osee.ats.client.demo.config.DemoDbActionData.CreateReview;
import org.eclipse.osee.ats.client.demo.config.DemoDbGroups;
@@ -38,10 +40,10 @@ import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
import org.eclipse.osee.ats.core.client.review.ReviewManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
import org.eclipse.osee.ats.util.AtsUtil;
@@ -229,21 +231,19 @@ public class PopulateDemoActions extends XNavigateItemAction {
}
private void createNonReqChangeDemoActions() throws Exception {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Populate Demo DB - Create Actions");
+ AtsChangeSet changes = new AtsChangeSet("Populate Demo DB - Create Actions");
if (DEBUG) {
OseeLog.log(Activator.class, Level.INFO, "createNonReqChangeDemoActions - SAW_Bld_3");
}
Set<ActionArtifact> actions =
- createActions(DemoDbActionData.getNonReqSawActionData(), DemoArtifactToken.SAW_Bld_3, null, transaction);
- appendBuildNameToTitles(actions, DemoSawBuilds.SAW_Bld_3.getName(), transaction);
+ createActions(DemoDbActionData.getNonReqSawActionData(), DemoArtifactToken.SAW_Bld_3, null, changes);
+ appendBuildNameToTitles(actions, DemoSawBuilds.SAW_Bld_3.getName(), changes);
if (DEBUG) {
OseeLog.log(Activator.class, Level.INFO, "createNonReqChangeDemoActions - SAW_Bld_2");
}
- actions =
- createActions(DemoDbActionData.getNonReqSawActionData(), DemoArtifactToken.SAW_Bld_2, null, transaction);
- appendBuildNameToTitles(actions, DemoSawBuilds.SAW_Bld_2.getName(), transaction);
+ actions = createActions(DemoDbActionData.getNonReqSawActionData(), DemoArtifactToken.SAW_Bld_2, null, changes);
+ appendBuildNameToTitles(actions, DemoSawBuilds.SAW_Bld_2.getName(), changes);
if (DEBUG) {
OseeLog.log(Activator.class, Level.INFO, "createNonReqChangeDemoActions - SAW_Bld_1");
@@ -251,34 +251,34 @@ public class PopulateDemoActions extends XNavigateItemAction {
actions =
createActions(DemoDbActionData.getNonReqSawActionData(), DemoArtifactToken.SAW_Bld_1, TeamState.Completed,
- transaction);
- appendBuildNameToTitles(actions, DemoSawBuilds.SAW_Bld_1.toString(), transaction);
+ changes);
+ appendBuildNameToTitles(actions, DemoSawBuilds.SAW_Bld_1.toString(), changes);
- transaction.execute();
+ changes.execute();
}
private void createGenericDemoActions() throws Exception {
if (DEBUG) {
OseeLog.log(Activator.class, Level.INFO, "createNonReqChangeDemoActions - getGenericActionData");
}
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Populate Demo DB - Create Generic Actions");
- createActions(DemoDbActionData.getGenericActionData(), null, null, transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet("Populate Demo DB - Create Generic Actions");
+ createActions(DemoDbActionData.getGenericActionData(), null, null, changes);
+ changes.execute();
}
- private void appendBuildNameToTitles(Set<ActionArtifact> actions, String buildName, SkynetTransaction transaction) throws OseeCoreException {
+ private void appendBuildNameToTitles(Set<ActionArtifact> actions, String buildName, IAtsChangeSet changes) throws OseeCoreException {
for (ActionArtifact action : actions) {
for (TeamWorkFlowArtifact team : action.getTeams()) {
team.setName(team.getName() + " for " + buildName);
- team.persist(transaction);
+ changes.add(team);
}
- ActionArtifactRollup rollup = new ActionArtifactRollup(action, transaction);
+ ActionArtifactRollup rollup = new ActionArtifactRollup(action);
rollup.resetAttributesOffChildren();
+ changes.add(action);
}
}
- private Set<ActionArtifact> createActions(List<DemoDbActionData> actionDatas, IArtifactToken versionToken, TeamState toStateOverride, SkynetTransaction transaction) throws Exception {
+ private Set<ActionArtifact> createActions(List<DemoDbActionData> actionDatas, IArtifactToken versionToken, TeamState toStateOverride, IAtsChangeSet changes) throws Exception {
Set<ActionArtifact> actionArts = new HashSet<ActionArtifact>();
int currNum = 1;
for (DemoDbActionData aData : actionDatas) {
@@ -293,7 +293,7 @@ public class PopulateDemoActions extends XNavigateItemAction {
ActionArtifact actionArt =
ActionManager.createAction(null, prefixTitle + " " + aData.postFixTitle,
TITLE_PREFIX[x] + " " + aData.postFixTitle, CHANGE_TYPE[x], aData.priority, false, null,
- aData.getActionableItems(), createdDate, createdBy, null, transaction);
+ aData.getActionableItems(), createdDate, createdBy, null, changes);
actionArts.add(actionArt);
for (TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
TeamWorkFlowManager dtwm =
@@ -318,7 +318,7 @@ public class PopulateDemoActions extends XNavigateItemAction {
// Transition to desired state
Result result =
dtwm.transitionTo((toStateOverride != null ? toStateOverride : aData.toState),
- teamWf.getAssignees().iterator().next(), false, transaction);
+ teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to state [%s]: [%s]", teamWf.toStringWithId(),
aData.toState.getName(), result.getText());
@@ -327,12 +327,9 @@ public class PopulateDemoActions extends XNavigateItemAction {
// Reset assignees that may have been overwritten during transition
teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
}
-
- teamWf.persist(transaction);
if (versionToken != null) {
IAtsVersion version = AtsVersionService.get().getById(versionToken);
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
- teamWf.persist(transaction);
}
}
}
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateSawBuild2Actions.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateSawBuild2Actions.java
index 66d93d6d36..c958f95931 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateSawBuild2Actions.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateSawBuild2Actions.java
@@ -16,8 +16,10 @@ import java.util.logging.Level;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.client.demo.config.DemoDbAIs;
import org.eclipse.osee.ats.client.demo.config.DemoDbUtil;
import org.eclipse.osee.ats.client.demo.config.DemoDbUtil.SoftwareRequirementStrs;
@@ -30,12 +32,11 @@ import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
import org.eclipse.osee.ats.core.client.review.ReviewManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
-import org.eclipse.osee.ats.core.client.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
import org.eclipse.osee.ats.util.AtsBranchManager;
-import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
@@ -50,8 +51,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
/**
* @author Donald G. Dunne
@@ -68,22 +67,21 @@ public class PopulateSawBuild2Actions {
Conditions.checkNotNull(version, "SAW_Bld_2");
// Create SAW_Bld_2 Actions
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Populate Demo DB - PopulateSawBuild2Actions");
+ AtsChangeSet changes = new AtsChangeSet("Populate Demo DB - PopulateSawBuild2Actions");
// SawBuild2Action1
- ActionArtifact committedAction = sawBuild2Action1_createCommittedAction(transaction);
+ ActionArtifact committedAction = sawBuild2Action1_createCommittedAction(changes);
// SawBuild2Action2
- ActionArtifact unCommittedAction = sawBuild2Action2_createUnCommittedAction(transaction);
+ ActionArtifact unCommittedAction = sawBuild2Action2_createUnCommittedAction(changes);
// SawBuild2Action3
- sawBuild2Action3_createNoBranchAction(transaction);
+ sawBuild2Action3_createNoBranchAction(changes);
// SawBuild2Action4
- ActionArtifact conflictedAction = sawBuild2Action4_createUnCommittedConflictedAction(transaction);
+ ActionArtifact conflictedAction = sawBuild2Action4_createUnCommittedConflictedAction(changes);
- transaction.execute();
+ changes.execute();
// Sleep to wait for the persist of the actions
DemoDbUtil.sleep(3000);
@@ -99,7 +97,7 @@ public class PopulateSawBuild2Actions {
}
- private static ActionArtifact sawBuild2Action4_createUnCommittedConflictedAction(SkynetTransaction transaction) throws OseeCoreException {
+ private static ActionArtifact sawBuild2Action4_createUnCommittedConflictedAction(IAtsChangeSet changes) throws OseeCoreException {
String title = "SAW (uncommitted-conflicted) More Requirement Changes for Diagram View";
Collection<IAtsActionableItem> aias =
DemoDbUtil.getActionableItems(new String[] {DemoDbAIs.SAW_Requirements.getAIName()});
@@ -109,7 +107,7 @@ public class PopulateSawBuild2Actions {
ActionArtifact actionArt =
ActionManager.createAction(null, title, "Problem with the Diagram View", ChangeType.Problem, priority, false,
- null, aias, createdDate, createdBy, null, transaction);
+ null, aias, createdDate, createdBy, null, changes);
for (TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
TeamWorkFlowManager dtwm =
@@ -117,7 +115,7 @@ public class PopulateSawBuild2Actions {
TransitionOption.OverrideTransitionValidityCheck);
// Transition to desired state
- Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, transaction);
+ Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to state [%s]: [%s]", teamWf.toStringWithId(),
toState.getName(), result.getText());
@@ -128,15 +126,13 @@ public class PopulateSawBuild2Actions {
teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
}
- teamWf.persist(transaction);
-
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
- teamWf.persist(transaction);
+ changes.add(teamWf);
}
return actionArt;
}
- private static ActionArtifact sawBuild2Action3_createNoBranchAction(SkynetTransaction transaction) throws OseeCoreException {
+ private static ActionArtifact sawBuild2Action3_createNoBranchAction(IAtsChangeSet changes) throws OseeCoreException {
String title = "SAW (no-branch) Even More Requirement Changes for Diagram View";
Collection<IAtsActionableItem> aias =
DemoDbUtil.getActionableItems(new String[] {
@@ -150,7 +146,7 @@ public class PopulateSawBuild2Actions {
ActionArtifact actionArt =
ActionManager.createAction(null, title, "Problem with the Diagram View", ChangeType.Problem, priority, false,
- null, aias, createdDate, createdBy, null, transaction);
+ null, aias, createdDate, createdBy, null, changes);
for (TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
boolean isSwDesign = teamWf.getTeamDefinition().getName().contains("SW Design");
@@ -160,7 +156,7 @@ public class PopulateSawBuild2Actions {
if (isSwDesign) {
// transition to analyze
Result result =
- dtwm.transitionTo(TeamState.Analyze, teamWf.getAssignees().iterator().next(), false, transaction);
+ dtwm.transitionTo(TeamState.Analyze, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to Analyze state: [%s]", teamWf.toStringWithId(),
toState.getName(), result.getText());
@@ -175,8 +171,7 @@ public class PopulateSawBuild2Actions {
}
// transition to authorize
- result =
- dtwm.transitionTo(TeamState.Authorize, teamWf.getAssignees().iterator().next(), false, transaction);
+ result = dtwm.transitionTo(TeamState.Authorize, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to Authorize state: [%s]",
teamWf.toStringWithId(), toState.getName(), result.getText());
@@ -192,7 +187,7 @@ public class PopulateSawBuild2Actions {
}
}
// Transition to final state
- Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, transaction);
+ Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to state [%s]: [%s]", teamWf.toStringWithId(),
toState.getName(), result.getText());
@@ -203,15 +198,13 @@ public class PopulateSawBuild2Actions {
teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
}
- teamWf.persist(transaction);
-
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
- teamWf.persist(transaction);
+ changes.add(teamWf);
}
return actionArt;
}
- private static ActionArtifact sawBuild2Action2_createUnCommittedAction(SkynetTransaction transaction) throws OseeCoreException {
+ private static ActionArtifact sawBuild2Action2_createUnCommittedAction(IAtsChangeSet changes) throws OseeCoreException {
String title = "SAW (uncommitted) More Reqt Changes for Diagram View";
Collection<IAtsActionableItem> aias =
DemoDbUtil.getActionableItems(new String[] {
@@ -225,7 +218,7 @@ public class PopulateSawBuild2Actions {
ActionArtifact actionArt =
ActionManager.createAction(null, title, "Problem with the Diagram View", ChangeType.Problem, priority, false,
- null, aias, createdDate, createdBy, null, transaction);
+ null, aias, createdDate, createdBy, null, changes);
for (TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
boolean isSwDesign = teamWf.getTeamDefinition().getName().contains("SW Design");
@@ -236,7 +229,7 @@ public class PopulateSawBuild2Actions {
if (isSwDesign) {
// transition to analyze
Result result =
- dtwm.transitionTo(TeamState.Analyze, teamWf.getAssignees().iterator().next(), false, transaction);
+ dtwm.transitionTo(TeamState.Analyze, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to Analyze state [%s] error [%s]",
teamWf.toStringWithId(), toState.getName(), result.getText());
@@ -251,8 +244,7 @@ public class PopulateSawBuild2Actions {
}
// transition to authorize
- result =
- dtwm.transitionTo(TeamState.Authorize, teamWf.getAssignees().iterator().next(), false, transaction);
+ result = dtwm.transitionTo(TeamState.Authorize, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to Authorize state: [%s]",
teamWf.toStringWithId(), toState.getName(), result.getText());
@@ -269,7 +261,7 @@ public class PopulateSawBuild2Actions {
}
// Transition to final state
- Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, transaction);
+ Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to state [%s]: [%s]", teamWf.toStringWithId(),
toState.getName(), result.getText());
@@ -280,15 +272,13 @@ public class PopulateSawBuild2Actions {
teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
}
- teamWf.persist(transaction);
-
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
- teamWf.persist(transaction);
+ changes.add(teamWf);
}
return actionArt;
}
- private static ActionArtifact sawBuild2Action1_createCommittedAction(SkynetTransaction transaction) throws OseeCoreException {
+ private static ActionArtifact sawBuild2Action1_createCommittedAction(IAtsChangeSet changes) throws OseeCoreException {
String title = "SAW (committed) Reqt Changes for Diagram View";
Collection<IAtsActionableItem> aias =
DemoDbUtil.getActionableItems(new String[] {
@@ -301,7 +291,7 @@ public class PopulateSawBuild2Actions {
ActionArtifact actionArt =
ActionManager.createAction(null, title, "Problem with the Diagram View", ChangeType.Problem, priority, false,
- null, aias, createdDate, createdBy, null, transaction);
+ null, aias, createdDate, createdBy, null, changes);
for (TeamWorkFlowArtifact teamWf : ActionManager.getTeams(actionArt)) {
if (teamWf.getTeamDefinition().getName().contains("Req") && !teamWf.getWorkDefinition().getName().equals(
@@ -327,7 +317,7 @@ public class PopulateSawBuild2Actions {
TransitionOption.OverrideTransitionValidityCheck);
// Transition to desired state
- Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, transaction);
+ Result result = dtwm.transitionTo(toState, teamWf.getAssignees().iterator().next(), false, changes);
if (result.isFalse()) {
throw new OseeCoreException("Error transitioning [%s] to state [%s]: [%s]", teamWf.toStringWithId(),
toState.getName(), result.getText());
@@ -338,9 +328,8 @@ public class PopulateSawBuild2Actions {
teamWf.getStateMgr().setAssignees(teamWf.getTeamDefinition().getLeads());
}
- teamWf.persist(transaction);
+ changes.add(teamWf);
AtsVersionService.get().setTargetedVersionAndStore(teamWf, version);
- teamWf.persist(transaction);
}
return actionArt;
}
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java
index 86d0d45463..c1466c2d69 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java
@@ -16,6 +16,7 @@ import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.client.demo.DemoArtifactTypes;
import org.eclipse.osee.ats.client.demo.DemoUsers;
import org.eclipse.osee.ats.client.demo.internal.Activator;
@@ -34,14 +35,13 @@ import org.eclipse.osee.ats.core.client.review.defect.ReviewDefectItem.Severity;
import org.eclipse.osee.ats.core.client.review.role.Role;
import org.eclipse.osee.ats.core.client.review.role.UserRole;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.artifact.search.QueryOptions;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
/**
* @author Donald G. Dunne
@@ -49,11 +49,10 @@ import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
public class DemoDbReviews {
public static void createReviews(boolean DEBUG) throws Exception {
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Populate Demo DB - Create Reviews");
- createPeerToPeerReviews(DEBUG, transaction);
- createDecisionReviews(DEBUG, transaction);
- transaction.execute();
+ AtsChangeSet changes = new AtsChangeSet("Populate Demo DB - Create Reviews");
+ createPeerToPeerReviews(DEBUG, changes);
+ createDecisionReviews(DEBUG, changes);
+ changes.execute();
}
/**
@@ -63,7 +62,7 @@ public class DemoDbReviews {
* 3) Decision in Complete state w Joe Smith assignee and completed<br>
* <br>
*/
- public static void createDecisionReviews(boolean DEBUG, SkynetTransaction transaction) throws Exception {
+ public static void createDecisionReviews(boolean DEBUG, IAtsChangeSet changes) throws Exception {
Date createdDate = new Date();
IAtsUser createdBy = AtsClientService.get().getUserAdmin().getCurrentUser();
@@ -76,21 +75,21 @@ public class DemoDbReviews {
// Create a Decision review and transition to ReWork
DecisionReviewArtifact reviewArt =
- ValidateReviewManager.createValidateReview(firstTestArt, true, createdDate, createdBy, transaction);
+ ValidateReviewManager.createValidateReview(firstTestArt, true, createdDate, createdBy, changes);
Result result =
- DecisionReviewManager.transitionTo(reviewArt, DecisionReviewState.Followup, createdBy, false, transaction);
+ DecisionReviewManager.transitionTo(reviewArt, DecisionReviewState.Followup, createdBy, false, changes);
if (result.isFalse()) {
throw new IllegalStateException("Failed transitioning review to Followup: " + result.getText());
}
- reviewArt.persist(transaction);
+ changes.add(reviewArt);
// Create a Decision review and transition to Completed
- reviewArt = ValidateReviewManager.createValidateReview(secondTestArt, true, createdDate, createdBy, transaction);
- DecisionReviewManager.transitionTo(reviewArt, DecisionReviewState.Completed, createdBy, false, transaction);
+ reviewArt = ValidateReviewManager.createValidateReview(secondTestArt, true, createdDate, createdBy, changes);
+ DecisionReviewManager.transitionTo(reviewArt, DecisionReviewState.Completed, createdBy, false, changes);
if (result.isFalse()) {
throw new IllegalStateException("Failed transitioning review to Completed: " + result.getText());
}
- reviewArt.persist(transaction);
+ changes.add(reviewArt);
}
@@ -118,7 +117,7 @@ public class DemoDbReviews {
* 3) PeerToPeer in Prepare state w Joe Smith assignee and completed<br>
* <br>
*/
- public static void createPeerToPeerReviews(boolean DEBUG, SkynetTransaction transaction) throws Exception {
+ public static void createPeerToPeerReviews(boolean DEBUG, IAtsChangeSet changes) throws Exception {
if (DEBUG) {
OseeLog.log(Activator.class, Level.INFO, "Create Peer To Peer reviews");
@@ -129,41 +128,38 @@ public class DemoDbReviews {
// Create a PeerToPeer review and leave in Prepare state
PeerToPeerReviewArtifact reviewArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(firstCodeArt, "Peer Review first set of code changes",
- firstCodeArt.getStateMgr().getCurrentStateName(), transaction);
- reviewArt.persist(transaction);
+ firstCodeArt.getStateMgr().getCurrentStateName(), changes);
// Create a PeerToPeer review and transition to Review state
reviewArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(firstCodeArt, "Peer Review algorithm used in code",
- firstCodeArt.getStateMgr().getCurrentStateName(), transaction);
+ firstCodeArt.getStateMgr().getCurrentStateName(), changes);
List<UserRole> roles = new ArrayList<UserRole>();
- roles.add(new UserRole(Role.Author,
- AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Joe_Smith)));
- roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(
- DemoUsers.Kay_Jones)));
- roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(
- DemoUsers.Alex_Kay), 2.0, true));
+ roles.add(new UserRole(Role.Author, AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Joe_Smith)));
+ roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Kay_Jones)));
+ roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Alex_Kay),
+ 2.0, true));
Result result =
PeerToPeerReviewManager.transitionTo(reviewArt, PeerToPeerReviewState.Review, roles, null,
- AtsClientService.get().getUserAdmin().getCurrentUser(), false, transaction);
+ AtsClientService.get().getUserAdmin().getCurrentUser(), false, changes);
if (result.isFalse()) {
throw new IllegalStateException("Failed transitioning review to Review: " + result.getText());
}
- reviewArt.persist(transaction);
+ changes.add(reviewArt);
// Create a PeerToPeer review and transition to Completed
reviewArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(secondCodeArt, "Review new logic",
secondCodeArt.getStateMgr().getCurrentStateName(), new Date(),
AtsClientService.get().getUserAdmin().getUserFromOseeUser(DemoDbUtil.getDemoUser(DemoUsers.Kay_Jones)),
- transaction);
+ changes);
roles = new ArrayList<UserRole>();
- roles.add(new UserRole(Role.Author,
- AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Kay_Jones), 2.3, true));
- roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(
- DemoUsers.Joe_Smith), 4.5, true));
- roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(
- DemoUsers.Alex_Kay), 2.0, true));
+ roles.add(new UserRole(Role.Author, AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Kay_Jones),
+ 2.3, true));
+ roles.add(new UserRole(Role.Reviewer,
+ AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Joe_Smith), 4.5, true));
+ roles.add(new UserRole(Role.Reviewer, AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Alex_Kay),
+ 2.0, true));
List<ReviewDefectItem> defects = new ArrayList<ReviewDefectItem>();
defects.add(new ReviewDefectItem(AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Alex_Kay),
@@ -186,9 +182,9 @@ public class DemoDbReviews {
}
result =
PeerToPeerReviewManager.transitionTo(reviewArt, PeerToPeerReviewState.Completed, roles, defects,
- AtsClientService.get().getUserAdmin().getCurrentUser(), false, transaction);
+ AtsClientService.get().getUserAdmin().getCurrentUser(), false, changes);
if (result.isTrue()) {
- reviewArt.persist(transaction);
+ changes.add(reviewArt);
}
if (result.isFalse()) {
throw new IllegalStateException("Failed transitioning review to Completed: " + result.getText());
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/CreateGoalTestDemoArtifacts.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/CreateGoalTestDemoArtifacts.java
index 9e8cee2468..4f035387f2 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/CreateGoalTestDemoArtifacts.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/navigate/CreateGoalTestDemoArtifacts.java
@@ -15,6 +15,7 @@ import java.util.Date;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.artifact.GoalManager;
import org.eclipse.osee.ats.client.demo.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.action.ActionArtifact;
@@ -24,6 +25,7 @@ import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewManager;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.util.AtsUtil;
@@ -31,8 +33,6 @@ import org.eclipse.osee.ats.world.WorldEditor;
import org.eclipse.osee.ats.world.WorldEditorSimpleProvider;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
@@ -60,104 +60,88 @@ public class CreateGoalTestDemoArtifacts extends XNavigateItemAction {
return;
}
createdDate = new Date();
+ AtsChangeSet changes = new AtsChangeSet(getName());
createdBy = AtsClientService.get().getUserAdmin().getCurrentUser();
- SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), getName());
- GoalArtifact sawCodeGoal = GoalManager.createGoal("SAW Code");
- GoalArtifact sawTestGoal = GoalManager.createGoal("SAW Test");
- GoalArtifact toolsTeamGoal = GoalManager.createGoal("Tools Team");
- GoalArtifact facilitiesGoal = GoalManager.createGoal("Facilities Team");
- GoalArtifact cisReqGoal = GoalManager.createGoal("CIS Requirements");
-
- TeamWorkFlowArtifact teamArt = createAction1(transaction, sawCodeGoal);
-
- createAction2(transaction, sawCodeGoal, cisReqGoal);
-
- createAction3(transaction, sawTestGoal, cisReqGoal);
-
- teamArt = createAction456(transaction, sawCodeGoal, facilitiesGoal, teamArt);
-
- createAction7(transaction, facilitiesGoal);
+ GoalArtifact sawCodeGoal = GoalManager.createGoal("SAW Code", changes);
+ GoalArtifact sawTestGoal = GoalManager.createGoal("SAW Test", changes);
+ GoalArtifact toolsTeamGoal = GoalManager.createGoal("Tools Team", changes);
+ GoalArtifact facilitiesGoal = GoalManager.createGoal("Facilities Team", changes);
+ GoalArtifact cisReqGoal = GoalManager.createGoal("CIS Requirements", changes);
+
+ TeamWorkFlowArtifact teamArt = createAction1(changes, sawCodeGoal);
+ createAction2(changes, sawCodeGoal, cisReqGoal);
+ createAction3(changes, sawTestGoal, cisReqGoal);
+ teamArt = createAction456(changes, sawCodeGoal, facilitiesGoal, teamArt);
+ createAction7(changes, facilitiesGoal);
for (String name : Arrays.asList("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P",
"Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "AA", "BB", "CC", "DD", "EE", "FF", "GG", "HH", "II", "JJ",
"KK", "LL", "MM", "NN", "OO", "PP", "QQ", "RR")) {
TaskArtifact taskArt = teamArt.createNewTask("Task " + name, createdDate, createdBy);
toolsTeamGoal.addMember(taskArt);
- taskArt.persist(transaction);
+ changes.add(taskArt);
}
- toolsTeamGoal.persist(transaction);
-
- transaction.execute();
+ changes.add(toolsTeamGoal);
+ changes.execute();
WorldEditor.open(new WorldEditorSimpleProvider("Goals", Arrays.asList(sawCodeGoal, sawTestGoal, toolsTeamGoal,
facilitiesGoal, cisReqGoal)));
}
- private void createAction7(SkynetTransaction transaction, GoalArtifact facilitiesGoal) throws OseeCoreException {
+ private void createAction7(IAtsChangeSet changes, GoalArtifact facilitiesGoal) throws OseeCoreException {
Artifact action =
ActionManager.createAction(null, "Add the Improvement", "Description", ChangeType.Improvement, "4", false,
- null, ActionableItems.getActionableItems(Arrays.asList("Network")), createdDate, createdBy, null,
- transaction);
- action.persist(transaction);
+ null, ActionableItems.getActionableItems(Arrays.asList("Network")), createdDate, createdBy, null, changes);
facilitiesGoal.addMember(action);
- facilitiesGoal.persist(transaction);
+ changes.add(facilitiesGoal);
}
- private TeamWorkFlowArtifact createAction456(SkynetTransaction transaction, GoalArtifact sawCodeGoal, GoalArtifact facilitiesGoal, TeamWorkFlowArtifact teamArt) throws OseeCoreException {
+ private TeamWorkFlowArtifact createAction456(IAtsChangeSet changes, GoalArtifact sawCodeGoal, GoalArtifact facilitiesGoal, TeamWorkFlowArtifact teamArt) throws OseeCoreException {
for (String msaTool : Arrays.asList("Backups", "Computers", "Network")) {
Artifact action =
ActionManager.createAction(null, "Fix " + msaTool + " button", "Description", ChangeType.Problem, "4",
false, null, ActionableItems.getActionableItems(Arrays.asList(msaTool)), createdDate, createdBy, null,
- transaction);
- action.persist(transaction);
+ changes);
facilitiesGoal.addMember(ActionManager.getFirstTeam(action));
teamArt = ActionManager.getFirstTeam(action);
TaskArtifact taskArt = teamArt.createNewTask("Task 1", createdDate, createdBy);
sawCodeGoal.addMember(taskArt);
- taskArt.persist(transaction);
+ changes.add(taskArt);
taskArt = teamArt.createNewTask("Task 2", createdDate, createdBy);
facilitiesGoal.addMember(taskArt);
- taskArt.persist(transaction);
+ changes.add(taskArt);
}
return teamArt;
}
- private void createAction3(SkynetTransaction transaction, GoalArtifact sawCodeGoal, GoalArtifact cisReqGoal) throws OseeCoreException {
+ private void createAction3(IAtsChangeSet changes, GoalArtifact sawCodeGoal, GoalArtifact cisReqGoal) throws OseeCoreException {
Artifact action =
ActionManager.createAction(null, "Remove Workflow button", "Description", ChangeType.Problem, "4", false,
null, ActionableItems.getActionableItems(Arrays.asList("SAW Code", "CIS Requirements")), createdDate,
- createdBy, null, transaction);
- action.persist(transaction);
+ createdBy, null, changes);
sawCodeGoal.addMember(ActionManager.getFirstTeam(action));
cisReqGoal.addMember(ActionManager.getFirstTeam(action));
- ActionManager.getFirstTeam(action).persist(transaction);
}
- private void createAction2(SkynetTransaction transaction, GoalArtifact sawCodeGoal, GoalArtifact cisReqGoal) throws OseeCoreException {
+ private void createAction2(IAtsChangeSet changes, GoalArtifact sawCodeGoal, GoalArtifact cisReqGoal) throws OseeCoreException {
ActionArtifact action =
ActionManager.createAction(null, "Add CDB Check Signals", "Description", ChangeType.Problem, "4", false, null,
ActionableItems.getActionableItems(Arrays.asList("SAW Code", "CIS Requirements")), createdDate, createdBy,
- null, transaction);
- action.persist(transaction);
+ null, changes);
sawCodeGoal.addMember(ActionManager.getFirstTeam(action));
cisReqGoal.addMember(ActionManager.getFirstTeam(action));
- for (TeamWorkFlowArtifact teamArt2 : action.getTeams()) {
- teamArt2.persist(transaction);
- }
}
- private TeamWorkFlowArtifact createAction1(SkynetTransaction transaction, GoalArtifact sawCodeGoal) throws OseeCoreException {
+ private TeamWorkFlowArtifact createAction1(IAtsChangeSet changes, GoalArtifact sawCodeGoal) throws OseeCoreException {
Artifact action =
ActionManager.createAction(null, "Fix this model", "Description", ChangeType.Problem, "2", false, null,
- ActionableItems.getActionableItems(Arrays.asList("SAW Code")), createdDate, createdBy, null, transaction);
- action.persist(transaction);
+ ActionableItems.getActionableItems(Arrays.asList("SAW Code")), createdDate, createdBy, null, changes);
sawCodeGoal.addMember(ActionManager.getFirstTeam(action));
TeamWorkFlowArtifact teamArt = ActionManager.getFirstTeam(action);
PeerToPeerReviewArtifact peerReviewArt =
- PeerToPeerReviewManager.createNewPeerToPeerReview(teamArt, "New Review", "Implement", transaction);
+ PeerToPeerReviewManager.createNewPeerToPeerReview(teamArt, "New Review", "Implement", changes);
sawCodeGoal.addMember(peerReviewArt);
- teamArt.persist(transaction);
return teamArt;
}
}

Back to the top