Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2014-08-26 18:50:46 +0000
committerRoberto E. Escobar2014-10-01 21:03:45 +0000
commit6ea9d020cd21b0c11285027431f40ee221c3fba4 (patch)
treed34287d182b1ceec0181fe8f8365c0c47050e7ef
parentc757d03e6936976bf322d9bdce8e6c81e7f6aae4 (diff)
downloadorg.eclipse.osee-6ea9d020cd21b0c11285027431f40ee221c3fba4.tar.gz
org.eclipse.osee-6ea9d020cd21b0c11285027431f40ee221c3fba4.tar.xz
org.eclipse.osee-6ea9d020cd21b0c11285027431f40ee221c3fba4.zip
bug[ats_ATS33276]: Provide AtsBranchManager through IAtsBranchService
-rw-r--r--plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java92
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransaction.java25
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/PopulateSawBuild2Actions.java14
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/access/AtsBranchAccessManagerTest.java3
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java8
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java8
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchServiceImplTest.java (renamed from plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchManagerCoreTest.java)27
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsCoreClient_Branch_Suite.java2
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/createTasks/CreateTasksOperationTest.java12
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchManagerCore.java772
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchUtil.java218
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/internal/AtsBranchServiceImpl.java164
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidator.java10
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsBranchServiceImpl.java92
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsBranchService.java567
-rw-r--r--plugins/org.eclipse.osee.ats.impl/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java2
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsBranchServiceImpl.java226
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/PortPairsOperation.java8
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowBranchChangeDataAction.java5
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowChangeReportAction.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowMergeManagerAction.java5
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AbstractBranchColumn.java8
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/BranchStatusColumn.java9
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorArtifactEventManager.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java8
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsOseeCmService.java5
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/report/CreateActionArtifactChangeReportJob.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateWorkingBranchFromTxBlam.java7
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskToChangedArtifactReferenceAttributeAdapter.java7
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java8
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java59
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java14
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchButtonCreate.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchDeleteMerge.java7
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchEnablement.java11
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchWidgetAbstract.java8
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/CommitXManager.java12
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitLabelProvider.java19
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java13
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java8
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java7
48 files changed, 1410 insertions, 1111 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF
index e0718a8ece0..96d27f5df66 100644
--- a/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF
@@ -30,6 +30,7 @@ Import-Package: javax.ws.rs;version="2.0.0",
javax.ws.rs.core;version="2.0.0",
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
+ org.eclipse.osee.framework.core.model,
org.eclipse.osee.framework.core.util,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java
index 36aece0ce95..cd12f6fc725 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java
@@ -10,10 +10,18 @@
*******************************************************************************/
package org.eclipse.osee.ats.api.workflow;
+import java.util.Collection;
+import java.util.Date;
import org.eclipse.osee.ats.api.IAtsConfigObject;
+import org.eclipse.osee.ats.api.commit.CommitStatus;
import org.eclipse.osee.ats.api.commit.ICommitConfigItem;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.ITransaction;
+import org.eclipse.osee.framework.core.enums.BranchArchivedState;
+import org.eclipse.osee.framework.core.enums.BranchState;
+import org.eclipse.osee.framework.core.enums.BranchType;
+import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
@@ -23,6 +31,9 @@ public interface IAtsBranchService {
boolean isBranchInCommit(IAtsTeamWorkflow teamWf) throws OseeCoreException;
+ /**
+ * @return whether there is a working branch that is not committed
+ */
boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException;
IOseeBranch getBranch(IAtsTeamWorkflow teamWf) throws OseeCoreException;
@@ -36,4 +47,85 @@ public interface IAtsBranchService {
boolean isBranchValid(ICommitConfigItem configArt);
IOseeBranch getBranchInherited(IAtsVersion version);
+
+ boolean isAllObjectsToCommitToConfigured(IAtsTeamWorkflow teamWf);
+
+ boolean isCommittedBranchExists(IAtsTeamWorkflow teamWf);
+
+ boolean isBranchesAllCommitted(IAtsTeamWorkflow teamWf);
+
+ IOseeBranch getWorkingBranch(IAtsTeamWorkflow teamWf);
+
+ IOseeBranch getCommittedWorkingBranch(IAtsTeamWorkflow teamWf);
+
+ Collection<ICommitConfigItem> getConfigArtifactsConfiguredToCommitTo(IAtsTeamWorkflow teamWf);
+
+ ITransaction getEarliestTransactionId(IAtsTeamWorkflow teamWf);
+
+ Collection<ITransaction> getTransactionIds(IAtsTeamWorkflow teamWf, boolean forMergeBranches);
+
+ boolean isBranchesAllCommittedExcept(IAtsTeamWorkflow teamWf, IOseeBranch branchToExclude);
+
+ Collection<IOseeBranch> getBranchesCommittedTo(IAtsTeamWorkflow teamWf);
+
+ Collection<IOseeBranch> getBranchesLeftToCommit(IAtsTeamWorkflow teamWf);
+
+ CommitStatus getCommitStatus(IAtsTeamWorkflow teamWf, ICommitConfigItem configArt);
+
+ ICommitConfigItem getParentBranchConfigArtifactConfiguredToCommitTo(IAtsTeamWorkflow teamWf);
+
+ CommitStatus getCommitStatus(IAtsTeamWorkflow teamWf, IOseeBranch destinationBranch, ICommitConfigItem configArt);
+
+ IOseeBranch getWorkingBranchExcludeStates(IAtsTeamWorkflow teamWf, BranchState... negatedBranchStates);
+
+ CommitStatus getCommitStatus(IAtsTeamWorkflow teamWf, IOseeBranch destinationBranch);
+
+ Collection<Object> getCommitTransactionsAndConfigItemsForTeamWf(IAtsTeamWorkflow teamWf);
+
+ IOseeBranch getConfiguredBranchForWorkflow(IAtsTeamWorkflow teamWf);
+
+ IOseeBranch getWorkingBranch(IAtsTeamWorkflow teamWf, boolean force);
+
+ boolean isWorkingBranchEverCommitted(IAtsTeamWorkflow teamWf);
+
+ Collection<Object> combineCommitTransactionsAndConfigItems(Collection<ICommitConfigItem> configArtSet, Collection<ITransaction> commitTxs);
+
+ Collection<ITransaction> getCommitTransactionsToUnarchivedBaselineBranchs(IAtsTeamWorkflow teamWf);
+
+ BranchType getBranchType(IOseeBranch branch);
+
+ BranchState getBranchState(IOseeBranch branch);
+
+ Collection<ITransaction> getCommittedArtifactTransactionIds(IAtsTeamWorkflow teamWf);
+
+ boolean isMergeBranchExists(IAtsTeamWorkflow teamWf, IOseeBranch destinationBranch);
+
+ boolean isMergeBranchExists(IAtsTeamWorkflow teamWf, IOseeBranch workingBranch, IOseeBranch destinationBranch);
+
+ Result isCommitBranchAllowed(IAtsTeamWorkflow teamWf) throws OseeCoreException;
+
+ Result isCreateBranchAllowed(IAtsTeamWorkflow teamWf) throws OseeCoreException;
+
+ IOseeBranch getBranchByUuid(long branchUuid);
+
+ boolean branchExists(long branchUuid);
+
+ BranchArchivedState getArchiveState(IOseeBranch branch);
+
+ IOseeBranch getBranch(ITransaction transactionId);
+
+ ITransaction getCommitTransactionRecord(IAtsTeamWorkflow teamWf, IOseeBranch branch);
+
+ Date getTimeStamp(ITransaction committedToParentTransRecord);
+
+ Collection<IOseeBranch> getBranchesToCommitTo(IAtsTeamWorkflow teamWf) throws OseeCoreException;
+
+ Collection<IOseeBranch> getBranchesInCommit();
+
+ boolean workingBranchCommittedToDestinationBranchParentPriorToDestinationBranchCreation(IAtsTeamWorkflow teamWf, IOseeBranch destinationBranch, Collection<ITransaction> commitTransactionIds) throws OseeCoreException;
+
+ IOseeBranch getParentBranch(IOseeBranch branch);
+
+ ITransaction getBaseTransaction(IOseeBranch branch);
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransaction.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransaction.java
deleted file mode 100644
index e0316ec82b5..00000000000
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransaction.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 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.workflow.transition;
-
-import org.eclipse.osee.ats.api.IAtsWorkItem;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-
-/**
- * @author Donald G Dunne
- */
-public interface ITransaction {
-
- void persist(IAtsWorkItem workItem) throws OseeCoreException;
-
- void setInTransition(IAtsWorkItem workItem, boolean set);
-
-}
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 61c3d7915cd..297fed80b9b 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
@@ -29,7 +29,7 @@ import org.eclipse.osee.ats.client.demo.internal.Activator;
import org.eclipse.osee.ats.client.demo.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.action.ActionArtifact;
import org.eclipse.osee.ats.core.client.action.ActionManager;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
+import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil;
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;
@@ -350,12 +350,12 @@ public class PopulateSawBuild2Actions {
if (DEBUG) {
OseeLog.log(Activator.class, Level.INFO, "Creating working branch");
}
- Result result = AtsBranchManagerCore.createWorkingBranch_Validate(reqTeam);
+ Result result = AtsBranchUtil.createWorkingBranch_Validate(reqTeam);
if (result.isFalse()) {
throw new OseeArgumentException(
new StringBuilder("Error creating working branch: ").append(result.getText()).toString());
}
- AtsBranchManagerCore.createWorkingBranch_Create(reqTeam);
+ AtsBranchUtil.createWorkingBranch_Create(reqTeam);
DemoDbUtil.sleep(5000);
@@ -442,12 +442,12 @@ public class PopulateSawBuild2Actions {
if (DEBUG) {
OseeLog.log(Activator.class, Level.INFO, "Creating working branch");
}
- Result result = AtsBranchManagerCore.createWorkingBranch_Validate(reqTeam);
+ Result result = AtsBranchUtil.createWorkingBranch_Validate(reqTeam);
if (result.isFalse()) {
throw new OseeArgumentException(
new StringBuilder("Error creating working branch: ").append(result.getText()).toString());
}
- AtsBranchManagerCore.createWorkingBranch_Create(reqTeam);
+ AtsBranchUtil.createWorkingBranch_Create(reqTeam);
DemoDbUtil.sleep(5000);
@@ -494,12 +494,12 @@ public class PopulateSawBuild2Actions {
if (DEBUG) {
OseeLog.log(Activator.class, Level.INFO, "Creating working branch");
}
- Result result = AtsBranchManagerCore.createWorkingBranch_Validate(reqTeam);
+ Result result = AtsBranchUtil.createWorkingBranch_Validate(reqTeam);
if (result.isFalse()) {
throw new OseeArgumentException(
new StringBuilder("Error creating working branch: ").append(result.getText()).toString());
}
- AtsBranchManagerCore.createWorkingBranch_Create(reqTeam);
+ AtsBranchUtil.createWorkingBranch_Create(reqTeam);
DemoDbUtil.sleep(5000);
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/access/AtsBranchAccessManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/access/AtsBranchAccessManagerTest.java
index 89c9c0a559d..41f3c857075 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/access/AtsBranchAccessManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/access/AtsBranchAccessManagerTest.java
@@ -18,7 +18,6 @@ import org.eclipse.osee.ats.client.demo.DemoSawBuilds;
import org.eclipse.osee.ats.client.demo.DemoWorkType;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.util.DemoTestUtil;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
@@ -86,7 +85,7 @@ public class AtsBranchAccessManagerTest {
(TeamWorkFlowArtifact) DemoTestUtil.getUncommittedActionWorkflow(DemoWorkType.Requirements);
Assert.assertNotNull(teamArt);
- IOseeBranch branch = AtsBranchManagerCore.getWorkingBranch(teamArt);
+ IOseeBranch branch = AtsClientService.get().getBranchService().getWorkingBranch(teamArt);
Assert.assertNotNull(branch);
Assert.assertTrue(mgr.isApplicable(branch));
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java
index 63584aedbf9..5cb2c61f507 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/config/AtsBranchConfigurationTest.java
@@ -27,7 +27,7 @@ import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.config.AtsConfigOperation;
import org.eclipse.osee.ats.core.client.action.ActionManager;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
+import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil;
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;
@@ -412,17 +412,17 @@ public class AtsBranchConfigurationTest {
public static void commitBranch(TeamWorkFlowArtifact teamWf) throws Exception {
IOperation op =
AtsBranchManager.commitWorkingBranch(teamWf, false, true,
- BranchManager.getParentBranch(AtsBranchManagerCore.getWorkingBranch(teamWf)), true);
+ BranchManager.getParentBranch(AtsClientService.get().getBranchService().getWorkingBranch(teamWf)), true);
Operations.executeWorkAndCheckStatus(op);
}
public static void createBranch(String namespace, TeamWorkFlowArtifact teamWf) throws Exception {
- Result result = AtsBranchManagerCore.createWorkingBranch_Validate(teamWf);
+ Result result = AtsBranchUtil.createWorkingBranch_Validate(teamWf);
if (result.isFalse()) {
AWorkbench.popup(result);
return;
}
- AtsBranchManagerCore.createWorkingBranch_Create(teamWf);
+ AtsBranchUtil.createWorkingBranch_Create(teamWf);
TestUtil.sleep(4000);
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java
index 4d0046112f4..24f0dcdd76e 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/AtsTestUtil.java
@@ -39,7 +39,7 @@ import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.core.client.action.ActionArtifact;
import org.eclipse.osee.ats.core.client.action.ActionManager;
import org.eclipse.osee.ats.core.client.actions.ISelectedAtsArtifacts;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
+import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil;
import org.eclipse.osee.ats.core.client.config.AtsBulkLoad;
import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
import org.eclipse.osee.ats.core.client.review.DecisionReviewArtifact;
@@ -424,7 +424,7 @@ public class AtsTestUtil {
AtsChangeSet changes = new AtsChangeSet(AtsTestUtil.class.getSimpleName() + " - cleanup deleteTeamWf");
if (teamWfToDelete.getWorkingBranch() != null) {
- Result result = AtsBranchManagerCore.deleteWorkingBranch(teamWfToDelete, true);
+ Result result = AtsBranchUtil.deleteWorkingBranch(teamWfToDelete, true);
if (result.isFalse()) {
throw new OseeStateException("Error deleting working branch [%s]", result.getText());
}
@@ -711,11 +711,11 @@ public class AtsTestUtil {
public static Result createWorkingBranchFromTeamWf() throws OseeCoreException {
configureVer1ForWorkingBranch();
- Result result = AtsBranchManagerCore.createWorkingBranch_Validate(teamArt);
+ Result result = AtsBranchUtil.createWorkingBranch_Validate(teamArt);
if (result.isFalse()) {
return result;
}
- AtsBranchManagerCore.createWorkingBranch_Create(teamArt, true);
+ AtsBranchUtil.createWorkingBranch_Create(teamArt, true);
teamArt.getWorkingBranchForceCacheUpdate();
return Result.TrueResult;
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchManagerCoreTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchServiceImplTest.java
index f9387b882b7..dc598ee4994 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchManagerCoreTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsBranchServiceImplTest.java
@@ -21,8 +21,8 @@ import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.client.demo.DemoSawBuilds;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.framework.core.data.ITransaction;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.TransactionRecord;
@@ -39,11 +39,11 @@ import org.mockito.Matchers;
import org.mockito.Mockito;
/**
- * Test unit for {@AtsBranchManagerCore}
+ * Test unit for {@AtsBranchServiceImpl}
*
* @author Shawn F. Cook
*/
-public class AtsBranchManagerCoreTest {
+public class AtsBranchServiceImplTest {
@BeforeClass
public static void setUp() throws Exception {
@@ -60,7 +60,7 @@ public class AtsBranchManagerCoreTest {
@Test
public void testGetCommitTransactionsAndConfigItemsForTeamWf_teamDef() throws OseeCoreException {
- AtsTestUtil.cleanupAndReset(AtsBranchManagerCoreTest.class.getSimpleName() + ".testGetCommitTransactionsAndConfigItemsForTeamWf_teamDef");
+ AtsTestUtil.cleanupAndReset(AtsBranchServiceImplTest.class.getSimpleName() + ".testGetCommitTransactionsAndConfigItemsForTeamWf_teamDef");
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
//Test Team Def-base Team Arts
@@ -68,21 +68,23 @@ public class AtsBranchManagerCoreTest {
// clear versions to config item is from teamDef
teamDef.getVersions().clear();
teamDef.setBaselineBranchUuid(DemoSawBuilds.SAW_Bld_1.getUuid());
- Collection<Object> commitObjs = AtsBranchManagerCore.getCommitTransactionsAndConfigItemsForTeamWf(teamArt);
+ Collection<Object> commitObjs =
+ AtsClientService.get().getBranchService().getCommitTransactionsAndConfigItemsForTeamWf(teamArt);
assertTrue("commitObjs has wrong size", commitObjs.size() == 1);
assertTrue("commitObjs is missing teamDef", commitObjs.contains(teamDef));
}
@Test
public void testGetCommitTransactionsAndConfigItemsForTeamWf_versions() throws OseeCoreException {
- AtsTestUtil.cleanupAndReset(AtsBranchManagerCoreTest.class.getSimpleName() + ".testGetCommitTransactionsAndConfigItemsForTeamWf_versions");
+ AtsTestUtil.cleanupAndReset(AtsBranchServiceImplTest.class.getSimpleName() + ".testGetCommitTransactionsAndConfigItemsForTeamWf_versions");
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
//Test Version-based Team Arts
IAtsVersion verArt1 = AtsTestUtil.getVerArt1();
IAtsVersion verArt2 = AtsTestUtil.getVerArt2();
verArt1.getParallelVersions().add(verArt2);
AtsClientService.get().getVersionService().setTargetedVersion(teamArt, verArt1);
- Collection<Object> commitObjs = AtsBranchManagerCore.getCommitTransactionsAndConfigItemsForTeamWf(teamArt);
+ Collection<Object> commitObjs =
+ AtsClientService.get().getBranchService().getCommitTransactionsAndConfigItemsForTeamWf(teamArt);
assertTrue("commitObjs has wrong size", commitObjs.size() == 2);
assertTrue("commitObjs is missing verArt1", commitObjs.contains(verArt1));
assertTrue("commitObjs is missing verArt2", commitObjs.contains(verArt2));
@@ -90,7 +92,7 @@ public class AtsBranchManagerCoreTest {
@Test
public void testGetCommitTransactionsAndConfigItemsForTeam_txRecords() throws OseeCoreException {
- AtsTestUtil.cleanupAndReset(AtsBranchManagerCoreTest.class.getSimpleName() + ".testGetCommitTransactionsAndConfigItemsForTeam_txRecords");
+ AtsTestUtil.cleanupAndReset(AtsBranchServiceImplTest.class.getSimpleName() + ".testGetCommitTransactionsAndConfigItemsForTeam_txRecords");
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
IAtsTeamDefinition teamDef = teamArt.getTeamDefinition();
teamDef.setBaselineBranchUuid(DemoSawBuilds.SAW_Bld_1.getUuid());
@@ -103,17 +105,18 @@ public class AtsBranchManagerCoreTest {
TransactionRecord txRecord =
new TransactionRecord(1234, branch.getUuid(), "comment", new Date(), UserManager.getUser().getArtId(),
UserManager.getUser().getArtId(), TransactionDetailsType.Baselined, branchCache);
- Collection<TransactionRecord> commitTxs = new ArrayList<TransactionRecord>();
+ Collection<ITransaction> commitTxs = new ArrayList<ITransaction>();
Collection<ICommitConfigItem> configArtSet = new HashSet<ICommitConfigItem>();
commitTxs.add(txRecord);
Collection<Object> commitObjs =
- AtsBranchManagerCore.combineCommitTransactionsAndConfigItems(configArtSet, commitTxs);
+ AtsClientService.get().getBranchService().combineCommitTransactionsAndConfigItems(configArtSet, commitTxs);
assertTrue("commitObjs has wrong size", commitObjs.size() == 1);
Collection<ICommitConfigItem> configArtifactsConfiguredToCommitTo =
- AtsBranchManagerCore.getConfigArtifactsConfiguredToCommitTo(teamArt);
+ AtsClientService.get().getBranchService().getConfigArtifactsConfiguredToCommitTo(teamArt);
configArtSet.add(configArtifactsConfiguredToCommitTo.iterator().next());
- commitObjs = AtsBranchManagerCore.combineCommitTransactionsAndConfigItems(configArtSet, commitTxs);
+ commitObjs =
+ AtsClientService.get().getBranchService().combineCommitTransactionsAndConfigItems(configArtSet, commitTxs);
assertTrue("commitObjs has wrong size", commitObjs.size() == 1);
assertTrue("commitObjs has wrong object", commitObjs.contains(teamDef));
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsCoreClient_Branch_Suite.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsCoreClient_Branch_Suite.java
index 42a6798db6f..d5ae4b56a88 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsCoreClient_Branch_Suite.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/branch/AtsCoreClient_Branch_Suite.java
@@ -21,7 +21,7 @@ import org.junit.runners.Suite;
* @author Roberto E. Escobar
*/
@RunWith(Suite.class)
-@Suite.SuiteClasses({AtsBranchManagerCoreTest.class})
+@Suite.SuiteClasses({AtsBranchServiceImplTest.class})
public class AtsCoreClient_Branch_Suite {
@BeforeClass
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/createTasks/CreateTasksOperationTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/createTasks/CreateTasksOperationTest.java
index 1ca420dae82..22a704aecdf 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/createTasks/CreateTasksOperationTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/task/createTasks/CreateTasksOperationTest.java
@@ -24,7 +24,7 @@ import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.client.demo.DemoSawBuilds;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
+import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.task.createtasks.CreateTasksOperation;
import org.eclipse.osee.ats.core.client.task.createtasks.GenerateTaskOpList;
@@ -240,18 +240,20 @@ public class CreateTasksOperationTest {
ver3_TasksWithoutChanges.setName(ver3_TasksWithoutChanges.getName() + " TasksWithoutChanges");
AtsClientService.get().getVersionService().setTargetedVersion(destTeamWf1_Proper, ver1_Proper);
- AtsClientService.get().getVersionService().setTargetedVersion(destTeamWf2_ChangesWithoutTasks, ver2_ChangesWithoutTasks);
- AtsClientService.get().getVersionService().setTargetedVersion(destTeamWf3_TasksWithoutChanges, ver3_TasksWithoutChanges);
+ AtsClientService.get().getVersionService().setTargetedVersion(destTeamWf2_ChangesWithoutTasks,
+ ver2_ChangesWithoutTasks);
+ AtsClientService.get().getVersionService().setTargetedVersion(destTeamWf3_TasksWithoutChanges,
+ ver3_TasksWithoutChanges);
IAtsVersion verArt4 = AtsTestUtil.getVerArt4();
verArt4.setBaselineBranchUuid(DemoSawBuilds.SAW_Bld_1.getUuid());
verArt4.setAllowCreateBranch(true);
reqTeamWf = AtsTestUtil.getTeamWf4();
- Result result = AtsBranchManagerCore.createWorkingBranch_Validate(reqTeamWf);
+ Result result = AtsBranchUtil.createWorkingBranch_Validate(reqTeamWf);
Assert.assertTrue(result.isTrue());
- Job createBranchJob = AtsBranchManagerCore.createWorkingBranch_Create(reqTeamWf);
+ Job createBranchJob = AtsBranchUtil.createWorkingBranch_Create(reqTeamWf);
createBranchJob.join();
int count = 0;
while (count++ < 10 && reqTeamWf.getWorkingBranch() == null) {
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchManagerCore.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchManagerCore.java
deleted file mode 100644
index b6739aaa067..00000000000
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchManagerCore.java
+++ /dev/null
@@ -1,772 +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.core.client.branch;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.osee.ats.api.IAtsConfigObject;
-import org.eclipse.osee.ats.api.commit.CommitStatus;
-import org.eclipse.osee.ats.api.commit.ICommitConfigItem;
-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.IAtsDecisionReviewDefinition;
-import org.eclipse.osee.ats.api.workdef.IAtsPeerReviewDefinition;
-import org.eclipse.osee.ats.api.workdef.StateEventType;
-import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
-import org.eclipse.osee.ats.core.client.internal.Activator;
-import org.eclipse.osee.ats.core.client.internal.AtsClientService;
-import org.eclipse.osee.ats.core.client.review.DecisionReviewArtifact;
-import org.eclipse.osee.ats.core.client.review.DecisionReviewDefinitionManager;
-import org.eclipse.osee.ats.core.client.review.PeerReviewDefinitionManager;
-import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
-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.stateitem.AtsStateItemCoreManager;
-import org.eclipse.osee.ats.core.client.workflow.stateitem.IAtsStateItemCore;
-import org.eclipse.osee.ats.core.users.AtsCoreUsers;
-import org.eclipse.osee.ats.core.util.AtsUtilCore;
-import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.core.enums.BranchState;
-import org.eclipse.osee.framework.core.enums.BranchType;
-import org.eclipse.osee.framework.core.exception.MultipleBranchesExist;
-import org.eclipse.osee.framework.core.exception.OseeWrappedException;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.model.TransactionRecord;
-import org.eclipse.osee.framework.core.model.cache.BranchFilter;
-import org.eclipse.osee.framework.core.util.Result;
-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.Strings;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.plugin.core.util.CatchAndReleaseJob;
-import org.eclipse.osee.framework.plugin.core.util.IExceptionableRunnable;
-import org.eclipse.osee.framework.plugin.core.util.Jobs;
-import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
-import org.eclipse.osee.framework.skynet.core.conflict.ConflictManagerExternal;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
-
-/**
- * @author Donald G. Dunne
- */
-public class AtsBranchManagerCore {
-
- private static Map<String, IOseeBranch> idToWorkingBranchCache = new HashMap<String, IOseeBranch>();
- private static Map<String, Long> idToWorkingBranchCacheUpdated = new HashMap<String, Long>(50);
- public static Set<IOseeBranch> branchesInCommit = new HashSet<IOseeBranch>();
-
- /**
- * Return working branch associated with SMA whether it is committed or not; This data is cached across all workflows
- * with the cache being updated by local and remote events.
- */
- public static IOseeBranch getWorkingBranch(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- return getWorkingBranch(teamArt, false);
- }
-
- /**
- * Return working branch associated with SMA whether it is committed or not; This data is cached across all workflows
- * with the cache being updated by local and remote events.
- *
- * @param force == true does not used cached value
- */
- public static IOseeBranch getWorkingBranch(TeamWorkFlowArtifact teamArt, boolean force) throws OseeCoreException {
- long now = new Date().getTime();
- boolean notSet = idToWorkingBranchCacheUpdated.get(teamArt.getAtsId()) == null;
- if (AtsUtilCore.isInTest() || notSet || force || (now - idToWorkingBranchCacheUpdated.get(teamArt.getAtsId()) > 1000)) {
- idToWorkingBranchCache.put(
- teamArt.getAtsId(),
- getWorkingBranchExcludeStates(teamArt, BranchState.REBASELINED, BranchState.DELETED, BranchState.PURGED,
- BranchState.COMMIT_IN_PROGRESS, BranchState.CREATION_IN_PROGRESS, BranchState.DELETE_IN_PROGRESS,
- BranchState.PURGE_IN_PROGRESS));
- idToWorkingBranchCacheUpdated.put(teamArt.getAtsId(), now);
- }
- return idToWorkingBranchCache.get(teamArt.getAtsId());
- }
-
- public static IOseeBranch getCommittedWorkingBranch(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- BranchFilter branchFilter = new BranchFilter(BranchType.WORKING);
- branchFilter.setBranchStates(BranchState.COMMITTED);
- branchFilter.setAssociatedArtifact(teamArt);
- List<Branch> branches = BranchManager.getBranches(branchFilter);
- if (branches.isEmpty()) {
- return null;
- } else if (branches.size() > 1) {
- throw new MultipleBranchesExist(
- "Unexpected multiple associated un-deleted working branches found for workflow [%s]", teamArt.getAtsId());
- } else {
- return branches.get(0);
- }
- }
-
- /**
- * Return working branch associated with SMA, even if it's been archived; This data is cached across all workflows
- * with the cache being updated by local and remote events. Filters out rebaseline branches (which are working
- * branches also).
- */
- public static IOseeBranch getWorkingBranchExcludeStates(TeamWorkFlowArtifact teamArt, BranchState... negatedBranchStates) throws OseeCoreException {
- BranchFilter branchFilter = new BranchFilter(BranchType.WORKING, BranchType.BASELINE);
- branchFilter.setNegatedBranchStates(negatedBranchStates);
- branchFilter.setAssociatedArtifact(teamArt);
-
- List<Branch> branches = BranchManager.getBranches(branchFilter);
-
- if (branches.isEmpty()) {
- return null;
- } else if (branches.size() > 1) {
- throw new MultipleBranchesExist(
- "Unexpected multiple associated un-deleted working branches found for workflow [%s]", teamArt.getAtsId());
- } else {
- return branches.get(0);
- }
- }
-
- /**
- * @return whether there is a working branch that is not committed
- */
- public static boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException {
- TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) AtsClientService.get().getArtifact(teamWf);
- IOseeBranch branch = getWorkingBranch(teamArt);
- return branch != null && !BranchManager.getState(branch).isCommitted();
- }
-
- public static boolean isWorkingBranchInWork(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- IOseeBranch branch = getWorkingBranch(teamArt);
- return branch != null && !BranchManager.getState(branch).isCommitted();
- }
-
- /**
- * Return true if merge branch exists in DB (whether archived or not)
- */
- public static boolean isMergeBranchExists(TeamWorkFlowArtifact teamArt, IOseeBranch destinationBranch) throws OseeCoreException {
- return isMergeBranchExists(teamArt, getWorkingBranch(teamArt), destinationBranch);
- }
-
- /**
- * Method available for optimized checking of merge branches so don't have to re-acquire working branch if already
- * have
- */
- public static boolean isMergeBranchExists(TeamWorkFlowArtifact teamArt, IOseeBranch workingBranch, IOseeBranch destinationBranch) throws OseeCoreException {
- if (workingBranch == null) {
- return false;
- }
- return BranchManager.doesMergeBranchExist(workingBranch, destinationBranch);
- }
-
- public static boolean isMergeCompleted(TeamWorkFlowArtifact teamArt, IOseeBranch destinationBranch) throws OseeCoreException {
- ConflictManagerExternal conflictManager =
- new ConflictManagerExternal(destinationBranch, getWorkingBranch(teamArt));
- return !conflictManager.remainingConflictsExist();
- }
-
- public static TransactionRecord getCommitTransactionRecord(TeamWorkFlowArtifact teamArt, IOseeBranch branch) throws OseeCoreException {
- if (branch == null) {
- return null;
- }
-
- Collection<TransactionRecord> transactions = TransactionManager.getCommittedArtifactTransactionIds(teamArt);
- for (TransactionRecord transId : transactions) {
- if (transId.getBranchId() == branch.getUuid()) {
- return transId;
- }
- }
- return null;
- }
-
- public static TransactionRecord getCommitTransactionRecord(TeamWorkFlowArtifact teamArt, ICommitConfigItem configArt) throws OseeCoreException {
- IOseeBranch branch = AtsClientService.get().getBranchService().getBranch(configArt);
- return getCommitTransactionRecord(teamArt, branch);
- }
-
- public static CommitStatus getCommitStatus(TeamWorkFlowArtifact teamArt, ICommitConfigItem configArt) throws OseeCoreException {
- IOseeBranch destinationBranch = AtsClientService.get().getBranchService().getBranch(configArt);
- return getCommitStatus(teamArt, destinationBranch, null);
- }
-
- public static CommitStatus getCommitStatus(TeamWorkFlowArtifact teamArt, IOseeBranch destinationBranch, ICommitConfigItem configArt) throws OseeCoreException {
- Branch workingBranch = teamArt.getWorkingBranch();
- if (workingBranch != null) {
- if (workingBranch.getBranchState().isRebaselineInProgress()) {
- return CommitStatus.Rebaseline_In_Progress;
- }
- }
-
- if (destinationBranch == null) {
- return CommitStatus.Branch_Not_Configured;
- }
-
- Collection<TransactionRecord> transactions = TransactionManager.getCommittedArtifactTransactionIds(teamArt);
- boolean mergeBranchExists = AtsBranchManagerCore.isMergeBranchExists(teamArt, destinationBranch);
-
- for (TransactionRecord transId : transactions) {
- if (destinationBranch.equals(transId.getBranch())) {
- if (mergeBranchExists) {
- return CommitStatus.Committed_With_Merge;
- } else {
- return CommitStatus.Committed;
- }
- }
- }
-
- if (workingBranchCommittedToDestinationBranchParentPriorToDestinationBranchCreation(teamArt, destinationBranch,
- transactions)) {
- return CommitStatus.No_Commit_Needed;
- }
-
- Result result = new Result(false);
- if (configArt == null) {
- result = AtsBranchManagerCore.isCommitBranchAllowed(teamArt);
- } else {
- result = configArt.isAllowCommitBranchInherited();
- }
- if (result.isFalse()) {
- return CommitStatus.Branch_Commit_Disabled;
- }
- if (AtsBranchManagerCore.getWorkingBranch(teamArt) == null) {
- return CommitStatus.Working_Branch_Not_Created;
- }
- if (mergeBranchExists) {
- return CommitStatus.Merge_In_Progress;
- }
-
- return CommitStatus.Commit_Needed;
- }
-
- public static CommitStatus getCommitStatus(TeamWorkFlowArtifact teamArt, IOseeBranch destinationBranch) throws OseeCoreException {
- CommitStatus commitStatus = getCommitStatus(teamArt, destinationBranch, null);
- return commitStatus;
- }
-
- private static boolean workingBranchCommittedToDestinationBranchParentPriorToDestinationBranchCreation(TeamWorkFlowArtifact teamArt, IOseeBranch destinationBranch, Collection<TransactionRecord> commitTransactionIds) throws OseeCoreException {
- Branch destinationBranchParent = BranchManager.getParentBranch(destinationBranch);
- if (destinationBranchParent.getBranchType() == BranchType.SYSTEM_ROOT) {
- return false;
- }
-
- TransactionRecord committedToParentTransRecord = null;
- for (TransactionRecord transId : commitTransactionIds) {
- if (transId.getBranch().equals(destinationBranchParent)) {
- committedToParentTransRecord = transId;
- break;
- }
- }
- if (committedToParentTransRecord != null) {
- if (BranchManager.getBaseTransaction(destinationBranch).getTimeStamp().after(
- committedToParentTransRecord.getTimeStamp())) {
- return true;
- }
- }
- return workingBranchCommittedToDestinationBranchParentPriorToDestinationBranchCreation(teamArt,
- destinationBranchParent, commitTransactionIds);
- }
-
- public static Result isCommitBranchAllowed(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- if (!teamArt.isTeamWorkflow()) {
- return Result.FalseResult;
- }
- if (teamArt.getTeamDefinition().isTeamUsesVersions()) {
- if (!AtsClientService.get().getVersionService().hasTargetedVersion(teamArt)) {
- return new Result(false, "Workflow not targeted for Version");
- }
- IAtsVersion targetedVersion = AtsClientService.get().getVersionService().getTargetedVersion(teamArt);
- Result result = targetedVersion.isAllowCommitBranchInherited();
- if (result.isFalse()) {
- return result;
- }
-
- if (!AtsClientService.get().getBranchService().isBranchValid(targetedVersion)) {
- return new Result(false, "Parent Branch not configured for Version [" + targetedVersion + "]");
- }
- return Result.TrueResult;
-
- } else {
- Result result = teamArt.getTeamDefinition().isAllowCommitBranchInherited();
- if (result.isFalse()) {
- return result;
- }
-
- if (!AtsClientService.get().getBranchService().isBranchValid(teamArt.getTeamDefinition())) {
- return new Result(false,
- "Parent Branch not configured for Team Definition [" + teamArt.getTeamDefinition() + "]");
- }
- return Result.TrueResult;
- }
- }
-
- public static Result isCreateBranchAllowed(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- if (!teamArt.isTeamWorkflow()) {
- return Result.FalseResult;
- }
-
- if (teamArt.getTeamDefinition().isTeamUsesVersions()) {
- if (!AtsClientService.get().getVersionService().hasTargetedVersion(teamArt)) {
- return new Result(false, "Workflow not targeted for Version");
- }
- IAtsVersion targetedVersion = AtsClientService.get().getVersionService().getTargetedVersion(teamArt);
- Result result = targetedVersion.isAllowCreateBranchInherited();
- if (result.isFalse()) {
- return result;
- }
-
- if (!AtsClientService.get().getBranchService().isBranchValid(targetedVersion)) {
- return new Result(false, "Parent Branch not configured for Version [" + targetedVersion + "]");
- }
- IOseeBranch baselineBranch =
- AtsClientService.get().getBranchService().getBranch((IAtsConfigObject) targetedVersion);
- if (!BranchManager.getBranchType(baselineBranch).isBaselineBranch()) {
- return new Result(false, "Parent Branch must be of Baseline branch type. See Admin for configuration.");
- }
- return Result.TrueResult;
-
- } else {
- Result result = teamArt.getTeamDefinition().isAllowCreateBranchInherited();
- if (result.isFalse()) {
- return result;
- }
-
- if (!AtsClientService.get().getBranchService().isBranchValid(teamArt.getTeamDefinition())) {
- return new Result(false,
- "Parent Branch not configured for Team Definition [" + teamArt.getTeamDefinition() + "]");
- }
- IOseeBranch baselineBranch =
- AtsClientService.get().getBranchService().getBranch((IAtsConfigObject) teamArt.getTeamDefinition());
- if (!BranchManager.getBranchType(baselineBranch).isBaselineBranch()) {
- return new Result(false, "Parent Branch must be of Baseline branch type. See Admin for configuration.");
- }
- return Result.TrueResult;
- }
- }
-
- /**
- * Returns true if there was ever a commit of a working branch regardless of whether the working branch is archived
- * or not.
- */
- public static boolean isWorkingBranchEverCommitted(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- return getBranchesCommittedTo(teamArt).size() > 0;
- }
-
- public static Collection<ICommitConfigItem> getConfigArtifactsConfiguredToCommitTo(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- Set<ICommitConfigItem> configObjects = new HashSet<ICommitConfigItem>();
- if (teamArt.getTeamDefinition().isTeamUsesVersions()) {
- if (AtsClientService.get().getVersionService().hasTargetedVersion(teamArt)) {
- AtsClientService.get().getVersionService().getTargetedVersion(teamArt).getParallelVersions(configObjects);
- }
- } else {
- if (teamArt.isTeamWorkflow() && AtsClientService.get().getBranchService().isBranchValid(
- teamArt.getTeamDefinition())) {
- configObjects.add(teamArt.getTeamDefinition());
- }
- }
- return configObjects;
- }
-
- public static ICommitConfigItem getParentBranchConfigArtifactConfiguredToCommitTo(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- if (teamArt.getTeamDefinition().isTeamUsesVersions()) {
- if (AtsClientService.get().getVersionService().hasTargetedVersion(teamArt)) {
- return AtsClientService.get().getVersionService().getTargetedVersion(teamArt);
- }
- } else {
- if (teamArt.isTeamWorkflow() && AtsClientService.get().getBranchService().isBranchValid(
- teamArt.getTeamDefinition())) {
- return teamArt.getTeamDefinition();
- }
- }
- return null;
- }
-
- /**
- * @return false if any object in parallel configuration is not configured with a valid branch
- */
- public static boolean isAllObjectsToCommitToConfigured(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- Collection<ICommitConfigItem> configs = getConfigArtifactsConfiguredToCommitTo(teamArt);
- for (ICommitConfigItem config : configs) {
- if (!AtsClientService.get().getBranchService().isBranchValid(config)) {
- return false;
- }
- if (!BranchManager.branchExists(config.getBaselineBranchUuid())) {
- return false;
- }
- }
- return true;
- }
-
- public static Collection<IOseeBranch> getBranchesLeftToCommit(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- Set<IOseeBranch> branchesLeft = new HashSet<IOseeBranch>();
- Collection<IOseeBranch> committedTo = getBranchesCommittedTo(teamArt);
- for (IOseeBranch branchToCommit : getBranchesToCommitTo(teamArt)) {
- if (!committedTo.contains(branchToCommit) && !isNoCommitNeeded(teamArt, branchToCommit)) {
- branchesLeft.add(branchToCommit);
- }
- }
- return branchesLeft;
- }
-
- public static Collection<IOseeBranch> getBranchesToCommitTo(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- Set<IOseeBranch> branches = new HashSet<IOseeBranch>();
- for (ICommitConfigItem obj : getConfigArtifactsConfiguredToCommitTo(teamArt)) {
- if (AtsClientService.get().getBranchService().isBranchValid(obj)) {
- branches.add(AtsClientService.get().getBranchService().getBranch(obj));
- }
- }
- return branches;
- }
-
- public static Collection<IOseeBranch> getBranchesCommittedTo(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- Set<IOseeBranch> branches = new HashSet<IOseeBranch>();
- for (TransactionRecord transId : getTransactionIds(teamArt, false)) {
- branches.add(transId.getBranch());
- }
- return branches;
- }
-
- /**
- * @return true if at least one destination branch committed to
- */
- public static boolean isCommittedBranchExists(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- return !getBranchesCommittedTo(teamArt).isEmpty();
- }
-
- public static boolean isNoCommitNeeded(TeamWorkFlowArtifact teamArt, IOseeBranch destinationBranch) throws OseeCoreException {
- return getCommitStatus(teamArt, destinationBranch) == CommitStatus.No_Commit_Needed;
- }
-
- /**
- * Return true if all commit destination branches are configured and have been committed to
- */
- public static boolean isBranchesAllCommitted(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- Collection<IOseeBranch> committedTo = getBranchesCommittedTo(teamArt);
- for (IOseeBranch destBranch : getBranchesToCommitTo(teamArt)) {
- if (!committedTo.contains(destBranch) && !isNoCommitNeeded(teamArt, destBranch)) {
- return false;
- }
- }
- return true;
- }
-
- public static boolean isBranchesAllCommittedExcept(TeamWorkFlowArtifact teamArt, IOseeBranch branchToExclude) throws OseeCoreException {
- Collection<IOseeBranch> committedTo = getBranchesCommittedTo(teamArt);
- for (IOseeBranch destBranch : getBranchesToCommitTo(teamArt)) {
- if (!destBranch.equals(branchToExclude) && !committedTo.contains(destBranch) && !isNoCommitNeeded(teamArt,
- destBranch)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * @return Branch that is the configured branch to create working branch from.
- */
- public static IOseeBranch getConfiguredBranchForWorkflow(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- IOseeBranch parentBranch = null;
-
- // Check for parent branch uuid in Version artifact
- if (teamArt.getTeamDefinition().isTeamUsesVersions()) {
- IAtsVersion verArt = AtsClientService.get().getVersionService().getTargetedVersion(teamArt);
- if (verArt != null) {
- parentBranch = AtsClientService.get().getBranchService().getBranch((IAtsConfigObject) verArt);
- }
- }
-
- // If not defined in version, check for parent branch from team definition
- if (parentBranch == null && teamArt.isTeamWorkflow() && AtsClientService.get().getBranchService().isBranchValid(
- teamArt.getTeamDefinition())) {
- parentBranch =
- AtsClientService.get().getBranchService().getBranch((IAtsConfigObject) teamArt.getTeamDefinition());
- }
-
- // If not defined, return null
- return parentBranch;
- }
-
- public static boolean isBranchInCommit(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- if (!isWorkingBranchInWork(teamArt)) {
- return false;
- }
- return branchesInCommit.contains(getWorkingBranch(teamArt));
- }
-
- public static Long getId(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- IOseeBranch branch = getWorkingBranch(teamArt);
- if (branch == null) {
- return null;
- }
- return branch.getUuid();
- }
-
- /**
- * @return Logically combines the results from getConfigArtifactsConfiguredToCommitTo() and
- * getCommitTransactionsToUnarchivedBaselineBranchs() into a single Collection of Objects. Objects are selected from
- * getConfigArtifactsConfiguredToCommitTo() first. Then compared to the branches in the Collection of TxRecords from
- * getCommitTransactionsToUnarchivedBaselineBranchs(). The TxRecords take LESS priority than the ICommitConfigArts
- * from getConfigArtifactsConfiguredToCommitTo()
- */
- public static Collection<Object> getCommitTransactionsAndConfigItemsForTeamWf(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- Collection<ICommitConfigItem> configArtSet = getConfigArtifactsConfiguredToCommitTo(teamArt);
- Collection<TransactionRecord> commitTxs = getCommitTransactionsToUnarchivedBaselineBranchs(teamArt);
- Collection<Object> commitMgrInputObjs = combineCommitTransactionsAndConfigItems(configArtSet, commitTxs);
- return commitMgrInputObjs;
- }
-
- /**
- * This method was refactored from above so it could be tested independently
- */
- public static Collection<Object> combineCommitTransactionsAndConfigItems(Collection<ICommitConfigItem> configArtSet, Collection<TransactionRecord> commitTxs) throws OseeCoreException {
- // commitMgrInputObjs will hold a union of all commits from configArtSet and commitTxs.
- // - first, we addAll configArtSet
- // - next, we loop through commitTxs and for any tx that has the same branch as ANY pre-existing commit
- // in configArtSet we do NOT add it to commitMgrInputObjs.
- Collection<Object> commitMgrInputObjs = new HashSet<Object>();
- commitMgrInputObjs.addAll(configArtSet);
- //for each tx commit...
- for (TransactionRecord txRecord : commitTxs) {
- IOseeBranch txBranch = txRecord.getBranch();
- boolean isCommitAlreadyPresent = false;
- // ... compare the branch of the tx commit to all the parent branches in configArtSet and do NOT add the tx
- // commit if it is already represented.
- for (ICommitConfigItem configArt : configArtSet) {
- IOseeBranch configArtBranch = AtsClientService.get().getBranchService().getBranch(configArt);
- if (txBranch == configArtBranch) {
- isCommitAlreadyPresent = true;
- break;
- }
- }
- if (!isCommitAlreadyPresent) {
- commitMgrInputObjs.add(txRecord);
- }
- }
- return commitMgrInputObjs;
- }
-
- private static Collection<TransactionRecord> getCommitTransactionsToUnarchivedBaselineBranchs(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- Collection<TransactionRecord> committedTransactions =
- TransactionManager.getCommittedArtifactTransactionIds(teamArt);
-
- Collection<TransactionRecord> transactionIds = new ArrayList<TransactionRecord>();
- for (TransactionRecord transactionId : committedTransactions) {
- // exclude working branches including branch states that are re-baselined
- Branch branch = transactionId.getFullBranch();
- if (branch.getBranchType().isBaselineBranch() && branch.getArchiveState().isUnArchived()) {
- transactionIds.add(transactionId);
- }
- }
- return transactionIds;
- }
-
- /**
- * @return TransactionId associated with this state machine artifact
- */
- public static Collection<TransactionRecord> getTransactionIds(TeamWorkFlowArtifact teamArt, boolean forMergeBranches) throws OseeCoreException {
- if (forMergeBranches) {
- IOseeBranch workingBranch = getWorkingBranch(teamArt);
- // grab only the transaction that had merge conflicts
- Collection<TransactionRecord> transactionIds = new ArrayList<TransactionRecord>();
- for (TransactionRecord transactionId : getCommitTransactionsToUnarchivedBaselineBranchs(teamArt)) {
- if (isMergeBranchExists(teamArt, workingBranch, transactionId.getBranch())) {
- transactionIds.add(transactionId);
- }
- }
- return transactionIds;
- } else {
- return getCommitTransactionsToUnarchivedBaselineBranchs(teamArt);
- }
- }
-
- public static TransactionRecord getEarliestTransactionId(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- Collection<TransactionRecord> transactionIds = getTransactionIds(teamArt, false);
- TransactionRecord earliestTransactionId;
- if (transactionIds.isEmpty()) {
- earliestTransactionId = null;
- } else {
- earliestTransactionId = transactionIds.iterator().next();
- for (TransactionRecord transactionId : transactionIds) {
- if (transactionId.getId() < earliestTransactionId.getId()) {
- earliestTransactionId = transactionId;
- }
- }
- }
- return earliestTransactionId;
- }
-
- /**
- * Perform error checks and popup confirmation dialogs associated with creating a working branch.
- *
- * @param popup if true, errors are popped up to user; otherwise sent silently in Results
- * @return Result return of status
- */
- public static Result createWorkingBranch_Validate(TeamWorkFlowArtifact teamArt) {
- try {
- if (AtsBranchManagerCore.isCommittedBranchExists(teamArt)) {
- return new Result(
- "Committed branch already exists. Can not create another working branch once changes have been committed.");
- }
- IOseeBranch parentBranch = AtsBranchManagerCore.getConfiguredBranchForWorkflow(teamArt);
- if (parentBranch == null) {
- return new Result(
- "Parent Branch can not be determined.\n\nPlease specify " + "parent branch through Version Artifact or Team Definition Artifact.\n\n" + "Contact your team lead to configure this.");
- }
- Result result = AtsBranchManagerCore.isCreateBranchAllowed(teamArt);
- if (result.isFalse()) {
- return result;
- }
- } catch (Exception ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- return new Result("Exception occurred: " + ex.getLocalizedMessage());
- }
- return Result.TrueResult;
- }
-
- /**
- * Create a working branch associated with this Team Workflow. Call createWorkingBranch_Validate first to validate
- * that branch can be created.
- */
- public static Job createWorkingBranch_Create(final TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- return createWorkingBranch_Create(teamArt, false);
- }
-
- /**
- * Create a working branch associated with this state machine artifact. This should NOT be called by applications
- * except in test cases or automated tools. Use createWorkingBranchWithPopups
- */
- public static Job createWorkingBranch_Create(final TeamWorkFlowArtifact teamArt, boolean pend) throws OseeCoreException {
- final IOseeBranch parentBranch = AtsBranchManagerCore.getConfiguredBranchForWorkflow(teamArt);
- return createWorkingBranch_Create(teamArt, parentBranch, pend);
- }
-
- public static Job createWorkingBranch_Create(final TeamWorkFlowArtifact teamArt, final IOseeBranch parentBranch) throws OseeCoreException {
- return createWorkingBranch_Create(teamArt, parentBranch, false);
- }
-
- public static Job createWorkingBranch_Create(final TeamWorkFlowArtifact teamArt, final IOseeBranch parentBranch, boolean pend) throws OseeCoreException {
- Conditions.checkNotNull(teamArt, "Parent Team Workflow");
- Conditions.checkNotNull(parentBranch, "Parent Branch");
- TransactionRecord parentTransactionId = TransactionManager.getHeadTransaction(parentBranch);
- return createWorkingBranch(teamArt, parentTransactionId, pend);
- }
-
- public static Job createWorkingBranch(final TeamWorkFlowArtifact teamArt, final TransactionRecord parentTransactionId, boolean pend) throws OseeCoreException {
- final String branchName = Strings.truncate(TeamWorkFlowManager.getBranchName(teamArt), 195, true);
- Conditions.checkNotNull(teamArt, "Parent Team Workflow");
- Conditions.checkNotNull(parentTransactionId, "Parent Branch");
-
- IExceptionableRunnable runnable = new IExceptionableRunnable() {
-
- @Override
- public IStatus run(IProgressMonitor monitor) throws OseeCoreException {
- teamArt.setWorkingBranchCreationInProgress(true);
- BranchManager.createWorkingBranch(parentTransactionId, branchName, teamArt);
- teamArt.setWorkingBranchCreationInProgress(false);
- performPostBranchCreationTasks(teamArt);
- return Status.OK_STATUS;
- }
-
- };
-
- // Jobs.runInJob("Create Branch", runnable, Activator.class, Activator.PLUGIN_ID);
- Job job =
- Jobs.startJob(new CatchAndReleaseJob("Create Branch", runnable, Activator.class, Activator.PLUGIN_ID), true);
- if (pend) {
- try {
- job.join();
- } catch (InterruptedException ex) {
- throw new OseeWrappedException(ex);
- }
- }
- return job;
- }
-
- private static void performPostBranchCreationTasks(final TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- // Create reviews as necessary
- AtsChangeSet changes = new AtsChangeSet("Create Reviews upon Transition");
- boolean created =
- createNecessaryBranchEventReviews(StateEventType.CreateBranch, teamArt, new Date(), AtsCoreUsers.SYSTEM_USER,
- changes);
- if (created) {
- changes.execute();
- }
-
- // Notify extensions of branch creation
- for (IAtsStateItemCore item : AtsStateItemCoreManager.getStateItems()) {
- item.workingBranchCreated(teamArt);
- }
- }
-
- /**
- * @return true if one or more reviews were created
- */
- public static boolean createNecessaryBranchEventReviews(StateEventType stateEventType, TeamWorkFlowArtifact teamArt, Date createdDate, IAtsUser createdBy, IAtsChangeSet changes) throws OseeCoreException {
- boolean created = false;
- if (stateEventType != StateEventType.CommitBranch && stateEventType != StateEventType.CreateBranch) {
- throw new OseeStateException("Invalid stateEventType [%s]", stateEventType);
- }
- // Create any decision and peerToPeer reviews for createBranch and commitBranch
- for (IAtsDecisionReviewDefinition decRevDef : teamArt.getStateDefinition().getDecisionReviews()) {
- if (decRevDef.getStateEventType() != null && decRevDef.getStateEventType().equals(stateEventType)) {
- DecisionReviewArtifact decArt =
- DecisionReviewDefinitionManager.createNewDecisionReview(decRevDef, changes, teamArt, createdDate,
- createdBy);
- if (decArt != null) {
- created = true;
- changes.add(decArt);
- }
- }
- }
- for (IAtsPeerReviewDefinition peerRevDef : teamArt.getStateDefinition().getPeerReviews()) {
- if (peerRevDef.getStateEventType() != null && peerRevDef.getStateEventType().equals(stateEventType)) {
- PeerToPeerReviewArtifact peerArt =
- PeerReviewDefinitionManager.createNewPeerToPeerReview(peerRevDef, changes, teamArt, createdDate,
- createdBy);
- if (peerArt != null) {
- created = true;
- changes.add(peerArt);
- }
- }
- }
- return created;
- }
-
- public static Result deleteWorkingBranch(TeamWorkFlowArtifact teamArt, boolean pend) throws OseeCoreException {
- IOseeBranch branch = AtsBranchManagerCore.getWorkingBranch(teamArt);
- if (branch != null) {
- IStatus status = null;
- if (pend) {
- status = BranchManager.deleteBranchAndPend(branch);
- } else {
- Job job = BranchManager.deleteBranch(branch);
- job.schedule();
- try {
- job.join();
- } catch (InterruptedException ex) {
- throw new OseeWrappedException(ex);
- }
- status = job.getResult();
- }
- if (status.isOK()) {
- return Result.TrueResult;
- }
- return new Result(status.getMessage());
- }
- return Result.TrueResult;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchUtil.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchUtil.java
new file mode 100644
index 00000000000..ab19cf4bfef
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/AtsBranchUtil.java
@@ -0,0 +1,218 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.core.client.branch;
+
+import java.util.Date;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workdef.IAtsDecisionReviewDefinition;
+import org.eclipse.osee.ats.api.workdef.IAtsPeerReviewDefinition;
+import org.eclipse.osee.ats.api.workdef.StateEventType;
+import org.eclipse.osee.ats.core.client.internal.Activator;
+import org.eclipse.osee.ats.core.client.internal.AtsClientService;
+import org.eclipse.osee.ats.core.client.review.DecisionReviewArtifact;
+import org.eclipse.osee.ats.core.client.review.DecisionReviewDefinitionManager;
+import org.eclipse.osee.ats.core.client.review.PeerReviewDefinitionManager;
+import org.eclipse.osee.ats.core.client.review.PeerToPeerReviewArtifact;
+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.stateitem.AtsStateItemCoreManager;
+import org.eclipse.osee.ats.core.client.workflow.stateitem.IAtsStateItemCore;
+import org.eclipse.osee.ats.core.users.AtsCoreUsers;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.exception.OseeWrappedException;
+import org.eclipse.osee.framework.core.model.TransactionRecord;
+import org.eclipse.osee.framework.core.util.Result;
+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.Strings;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.plugin.core.util.CatchAndReleaseJob;
+import org.eclipse.osee.framework.plugin.core.util.IExceptionableRunnable;
+import org.eclipse.osee.framework.plugin.core.util.Jobs;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsBranchUtil {
+
+ /**
+ * @return true if one or more reviews were created
+ */
+ public static boolean createNecessaryBranchEventReviews(StateEventType stateEventType, TeamWorkFlowArtifact teamArt, Date createdDate, IAtsUser createdBy, IAtsChangeSet changes) throws OseeCoreException {
+ boolean created = false;
+ if (stateEventType != StateEventType.CommitBranch && stateEventType != StateEventType.CreateBranch) {
+ throw new OseeStateException("Invalid stateEventType [%s]", stateEventType);
+ }
+ // Create any decision and peerToPeer reviews for createBranch and commitBranch
+ for (IAtsDecisionReviewDefinition decRevDef : teamArt.getStateDefinition().getDecisionReviews()) {
+ if (decRevDef.getStateEventType() != null && decRevDef.getStateEventType().equals(stateEventType)) {
+ DecisionReviewArtifact decArt =
+ DecisionReviewDefinitionManager.createNewDecisionReview(decRevDef, changes, teamArt, createdDate,
+ createdBy);
+ if (decArt != null) {
+ created = true;
+ changes.add(decArt);
+ }
+ }
+ }
+ for (IAtsPeerReviewDefinition peerRevDef : teamArt.getStateDefinition().getPeerReviews()) {
+ if (peerRevDef.getStateEventType() != null && peerRevDef.getStateEventType().equals(stateEventType)) {
+ PeerToPeerReviewArtifact peerArt =
+ PeerReviewDefinitionManager.createNewPeerToPeerReview(peerRevDef, changes, teamArt, createdDate,
+ createdBy);
+ if (peerArt != null) {
+ created = true;
+ changes.add(peerArt);
+ }
+ }
+ }
+ return created;
+ }
+
+ /**
+ * Perform error checks and popup confirmation dialogs associated with creating a working branch.
+ *
+ * @param popup if true, errors are popped up to user; otherwise sent silently in Results
+ * @return Result return of status
+ */
+ public static Result createWorkingBranch_Validate(TeamWorkFlowArtifact teamArt) {
+ try {
+ if (AtsClientService.get().getBranchService().isCommittedBranchExists(teamArt)) {
+ return new Result(
+ "Committed branch already exists. Can not create another working branch once changes have been committed.");
+ }
+ IOseeBranch parentBranch = AtsClientService.get().getBranchService().getConfiguredBranchForWorkflow(teamArt);
+ if (parentBranch == null) {
+ return new Result(
+ "Parent Branch can not be determined.\n\nPlease specify " + "parent branch through Version Artifact or Team Definition Artifact.\n\n" + "Contact your team lead to configure this.");
+ }
+ Result result = AtsClientService.get().getBranchService().isCreateBranchAllowed(teamArt);
+ if (result.isFalse()) {
+ return result;
+ }
+ } catch (Exception ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ return new Result("Exception occurred: " + ex.getLocalizedMessage());
+ }
+ return Result.TrueResult;
+ }
+
+ /**
+ * Create a working branch associated with this Team Workflow. Call createWorkingBranch_Validate first to validate
+ * that branch can be created.
+ */
+ public static Job createWorkingBranch_Create(final TeamWorkFlowArtifact teamArt) throws OseeCoreException {
+ return createWorkingBranch_Create(teamArt, false);
+ }
+
+ /**
+ * Create a working branch associated with this state machine artifact. This should NOT be called by applications
+ * except in test cases or automated tools. Use createWorkingBranchWithPopups
+ */
+ public static Job createWorkingBranch_Create(final TeamWorkFlowArtifact teamArt, boolean pend) throws OseeCoreException {
+ final IOseeBranch parentBranch =
+ AtsClientService.get().getBranchService().getConfiguredBranchForWorkflow(teamArt);
+ return createWorkingBranch_Create(teamArt, parentBranch, pend);
+ }
+
+ public static Job createWorkingBranch_Create(final TeamWorkFlowArtifact teamArt, final IOseeBranch parentBranch) throws OseeCoreException {
+ return createWorkingBranch_Create(teamArt, parentBranch, false);
+ }
+
+ public static Job createWorkingBranch_Create(final TeamWorkFlowArtifact teamArt, final IOseeBranch parentBranch, boolean pend) throws OseeCoreException {
+ Conditions.checkNotNull(teamArt, "Parent Team Workflow");
+ Conditions.checkNotNull(parentBranch, "Parent Branch");
+ TransactionRecord parentTransactionId = TransactionManager.getHeadTransaction(parentBranch);
+ return createWorkingBranch(teamArt, parentTransactionId, pend);
+ }
+
+ public static Job createWorkingBranch(final TeamWorkFlowArtifact teamArt, final TransactionRecord parentTransactionId, boolean pend) throws OseeCoreException {
+ final String branchName = Strings.truncate(TeamWorkFlowManager.getBranchName(teamArt), 195, true);
+ Conditions.checkNotNull(teamArt, "Parent Team Workflow");
+ Conditions.checkNotNull(parentTransactionId, "Parent Branch");
+
+ IExceptionableRunnable runnable = new IExceptionableRunnable() {
+
+ @Override
+ public IStatus run(IProgressMonitor monitor) throws OseeCoreException {
+ teamArt.setWorkingBranchCreationInProgress(true);
+ BranchManager.createWorkingBranch(parentTransactionId, branchName, teamArt);
+ teamArt.setWorkingBranchCreationInProgress(false);
+ performPostBranchCreationTasks(teamArt);
+ return Status.OK_STATUS;
+ }
+
+ };
+
+ // Jobs.runInJob("Create Branch", runnable, Activator.class, Activator.PLUGIN_ID);
+ Job job =
+ Jobs.startJob(new CatchAndReleaseJob("Create Branch", runnable, Activator.class, Activator.PLUGIN_ID), true);
+ if (pend) {
+ try {
+ job.join();
+ } catch (InterruptedException ex) {
+ throw new OseeWrappedException(ex);
+ }
+ }
+ return job;
+ }
+
+ private static void performPostBranchCreationTasks(final TeamWorkFlowArtifact teamArt) throws OseeCoreException {
+ // Create reviews as necessary
+ AtsChangeSet changes = new AtsChangeSet("Create Reviews upon Transition");
+ boolean created =
+ createNecessaryBranchEventReviews(StateEventType.CreateBranch, teamArt, new Date(), AtsCoreUsers.SYSTEM_USER,
+ changes);
+ if (created) {
+ changes.execute();
+ }
+
+ // Notify extensions of branch creation
+ for (IAtsStateItemCore item : AtsStateItemCoreManager.getStateItems()) {
+ item.workingBranchCreated(teamArt);
+ }
+ }
+
+ public static Result deleteWorkingBranch(TeamWorkFlowArtifact teamArt, boolean pend) throws OseeCoreException {
+ IOseeBranch branch = AtsClientService.get().getBranchService().getWorkingBranch(teamArt);
+ if (branch != null) {
+ IStatus status = null;
+ if (pend) {
+ status = BranchManager.deleteBranchAndPend(branch);
+ } else {
+ Job job = BranchManager.deleteBranch(branch);
+ job.schedule();
+ try {
+ job.join();
+ } catch (InterruptedException ex) {
+ throw new OseeWrappedException(ex);
+ }
+ status = job.getResult();
+ }
+ if (status.isOK()) {
+ return Result.TrueResult;
+ }
+ return new Result(status.getMessage());
+ }
+ return Result.TrueResult;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/internal/AtsBranchServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/internal/AtsBranchServiceImpl.java
new file mode 100644
index 00000000000..e09c751586f
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/branch/internal/AtsBranchServiceImpl.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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.core.client.branch.internal;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import org.eclipse.osee.ats.api.IAtsServices;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.core.client.internal.AtsClientService;
+import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.util.AbstractAtsBranchService;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.ITransaction;
+import org.eclipse.osee.framework.core.enums.BranchArchivedState;
+import org.eclipse.osee.framework.core.enums.BranchState;
+import org.eclipse.osee.framework.core.enums.BranchType;
+import org.eclipse.osee.framework.core.exception.MultipleBranchesExist;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.TransactionRecord;
+import org.eclipse.osee.framework.core.model.cache.BranchFilter;
+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.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.conflict.ConflictManagerExternal;
+import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsBranchServiceImpl extends AbstractAtsBranchService {
+
+ public AtsBranchServiceImpl(IAtsServices atsServices) {
+ super(atsServices);
+ }
+
+ /**
+ * Return working branch associated with SMA, even if it's been archived; This data is cached across all workflows
+ * with the cache being updated by local and remote events. Filters out rebaseline branches (which are working
+ * branches also).
+ */
+ @Override
+ public IOseeBranch getWorkingBranchExcludeStates(IAtsTeamWorkflow teamWf, BranchState... negatedBranchStates) {
+ BranchFilter branchFilter = new BranchFilter(BranchType.WORKING, BranchType.BASELINE);
+ branchFilter.setNegatedBranchStates(negatedBranchStates);
+ branchFilter.setAssociatedArtifact((Artifact) teamWf.getStoreObject());
+
+ List<Branch> branches = BranchManager.getBranches(branchFilter);
+
+ if (branches.isEmpty()) {
+ return null;
+ } else if (branches.size() > 1) {
+ throw new MultipleBranchesExist(
+ "Unexpected multiple associated un-deleted working branches found for workflow [%s]", teamWf.getAtsId());
+ } else {
+ return branches.get(0);
+ }
+ }
+
+ @Override
+ public IOseeBranch getCommittedWorkingBranch(IAtsTeamWorkflow teamWf) {
+ BranchFilter branchFilter = new BranchFilter(BranchType.WORKING);
+ branchFilter.setBranchStates(BranchState.COMMITTED);
+ branchFilter.setAssociatedArtifact((Artifact) teamWf.getStoreObject());
+ List<Branch> branches = BranchManager.getBranches(branchFilter);
+ if (branches.isEmpty()) {
+ return null;
+ } else if (branches.size() > 1) {
+ throw new MultipleBranchesExist(
+ "Unexpected multiple associated un-deleted working branches found for workflow [%s]", teamWf.getAtsId());
+ } else {
+ return branches.get(0);
+ }
+ }
+
+ @Override
+ public BranchType getBranchType(IOseeBranch branch) {
+ return BranchManager.getBranchType(branch);
+ }
+
+ @Override
+ public BranchState getBranchState(IOseeBranch branch) {
+ return BranchManager.getState(branch);
+ }
+
+ @Override
+ public Collection<ITransaction> getCommittedArtifactTransactionIds(IAtsTeamWorkflow teamWf) {
+ List<ITransaction> transactions = new ArrayList<ITransaction>();
+ for (TransactionRecord trans : TransactionManager.getCommittedArtifactTransactionIds((Artifact) teamWf.getStoreObject())) {
+ transactions.add(trans);
+ }
+ return transactions;
+ }
+
+ /**
+ * Method available for optimized checking of merge branches so don't have to re-acquire working branch if already
+ * have
+ */
+ @Override
+ public boolean isMergeBranchExists(IAtsTeamWorkflow teamWf, IOseeBranch workingBranch, IOseeBranch destinationBranch) throws OseeCoreException {
+ if (workingBranch == null) {
+ return false;
+ }
+ return BranchManager.doesMergeBranchExist(workingBranch, destinationBranch);
+ }
+
+ public boolean isMergeCompleted(TeamWorkFlowArtifact teamWf, IOseeBranch destinationBranch) throws OseeCoreException {
+ ConflictManagerExternal conflictManager =
+ new ConflictManagerExternal(destinationBranch, AtsClientService.get().getBranchService().getWorkingBranch(
+ teamWf));
+ return !conflictManager.remainingConflictsExist();
+ }
+
+ @Override
+ public IOseeBranch getBranchByUuid(long branchUuid) {
+ return BranchManager.getBranch(branchUuid);
+ }
+
+ @Override
+ public boolean branchExists(long branchUuid) {
+ return BranchManager.branchExists(branchUuid);
+ }
+
+ @Override
+ public BranchArchivedState getArchiveState(IOseeBranch branch) {
+ return BranchManager.getBranch(branch).getArchiveState();
+ }
+
+ @Override
+ public IOseeBranch getBranch(ITransaction transaction) {
+ IOseeBranch result = null;
+ TransactionRecord txRecord = (TransactionRecord) transaction;
+ result = txRecord.getBranch();
+ if (result == null) {
+ result = TransactionManager.getTransactionId(transaction.getGuid()).getBranch();
+ }
+ return result;
+ }
+
+ @Override
+ public Date getTimeStamp(ITransaction transaction) {
+ return TransactionManager.getTransactionId(transaction.getGuid()).getTimeStamp();
+ }
+
+ @Override
+ public IOseeBranch getParentBranch(IOseeBranch destinationBranch) {
+ return BranchManager.getBranch(destinationBranch).getParentBranch();
+ }
+
+ @Override
+ public ITransaction getBaseTransaction(IOseeBranch destinationBranch) {
+ return BranchManager.getBranch(destinationBranch).getBaseTransaction();
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
index 68ef954ca76..1ba064ddc2f 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
@@ -45,6 +45,7 @@ import org.eclipse.osee.ats.api.workflow.state.IAtsWorkStateFactory;
import org.eclipse.osee.ats.core.client.IAtsClient;
import org.eclipse.osee.ats.core.client.IAtsUserServiceClient;
import org.eclipse.osee.ats.core.client.IAtsVersionAdmin;
+import org.eclipse.osee.ats.core.client.branch.internal.AtsBranchServiceImpl;
import org.eclipse.osee.ats.core.client.internal.config.ActionableItemFactory;
import org.eclipse.osee.ats.core.client.internal.config.AtsArtifactConfigCache;
import org.eclipse.osee.ats.core.client.internal.config.AtsConfigCacheProvider;
@@ -70,7 +71,6 @@ import org.eclipse.osee.ats.core.client.internal.workflow.AtsWorkItemServiceImpl
import org.eclipse.osee.ats.core.client.search.AtsArtifactQuery;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.AtsBranchServiceImpl;
import org.eclipse.osee.ats.core.column.IAtsColumnUtilities;
import org.eclipse.osee.ats.core.config.IActionableItemFactory;
import org.eclipse.osee.ats.core.config.IAtsConfig;
@@ -176,7 +176,7 @@ public class AtsClientImpl implements IAtsClient {
workDefAdmin =
new AtsWorkDefinitionAdminImpl(workDefCacheProvider, workItemService, workDefService, teamWorkflowProvider,
attributeResolverService);
- branchService = new AtsBranchServiceImpl();
+ branchService = new AtsBranchServiceImpl(this);
reviewService = new AtsReviewServiceImpl(this);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
index e3ae5d7b8c9..0694f02c3af 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
@@ -25,7 +25,6 @@ import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.core.client.action.ActionArtifact;
import org.eclipse.osee.ats.core.client.action.ActionArtifactRollup;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.config.ActionableItemManager;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
@@ -235,11 +234,11 @@ public class TeamWorkFlowArtifact extends AbstractTaskableArtifact implements IA
}
public Branch getWorkingBranchForceCacheUpdate() throws OseeCoreException {
- return (Branch) AtsBranchManagerCore.getWorkingBranch(this, true);
+ return (Branch) AtsClientService.get().getBranchService().getWorkingBranch(this, true);
}
public Branch getWorkingBranch() throws OseeCoreException {
- return (Branch) AtsBranchManagerCore.getWorkingBranch(this);
+ return (Branch) AtsClientService.get().getBranchService().getWorkingBranch(this);
}
public String getBranchName() {
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidator.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidator.java
index 505a1308dc8..b2671afe06a 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidator.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/validator/AtsXCommitManagerValidator.java
@@ -16,8 +16,9 @@ import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.RuleDefinitionOption;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workdef.WidgetStatus;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
+import org.eclipse.osee.ats.api.workflow.IAtsBranchService;
import org.eclipse.osee.ats.core.client.internal.Activator;
+import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.validator.AtsXWidgetValidator;
import org.eclipse.osee.ats.core.validator.IValueProvider;
@@ -34,15 +35,16 @@ public class AtsXCommitManagerValidator extends AtsXWidgetValidator {
WidgetResult result = WidgetResult.Valid;
if ("XCommitManager".equals(widgetDef.getXWidgetName())) {
try {
+ IAtsBranchService branchService = AtsClientService.get().getBranchService();
if (provider instanceof ArtifactValueProvider && ((ArtifactValueProvider) provider).getArtifact() instanceof TeamWorkFlowArtifact) {
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) ((ArtifactValueProvider) provider).getArtifact();
- if (!AtsBranchManagerCore.isAllObjectsToCommitToConfigured(teamArt)) {
+ if (!branchService.isAllObjectsToCommitToConfigured(teamArt)) {
return new WidgetResult(WidgetStatus.Invalid_Incompleted, widgetDef,
"All branches must be configured for commit.");
}
boolean changesExistToCommit =
- AtsBranchManagerCore.isWorkingBranchInWork(teamArt) || AtsBranchManagerCore.isCommittedBranchExists(teamArt);
- if (changesExistToCommit && !transitionToWithWorkingBranchRuleExists(toStateDef) && !AtsBranchManagerCore.isBranchesAllCommitted(teamArt)) {
+ branchService.isWorkingBranchInWork(teamArt) || branchService.isCommittedBranchExists(teamArt);
+ if (changesExistToCommit && !transitionToWithWorkingBranchRuleExists(toStateDef) && !branchService.isBranchesAllCommitted(teamArt)) {
return new WidgetResult(WidgetStatus.Invalid_Incompleted, widgetDef,
"All branches must be committed.");
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsBranchServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsBranchServiceImpl.java
deleted file mode 100644
index 3bb9aeb0b12..00000000000
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsBranchServiceImpl.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 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.core.client.workflow;
-
-import org.eclipse.osee.ats.api.IAtsConfigObject;
-import org.eclipse.osee.ats.api.commit.ICommitConfigItem;
-import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
-import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
-import org.eclipse.osee.ats.api.version.IAtsVersion;
-import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
-import org.eclipse.osee.ats.core.client.internal.AtsClientService;
-import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.util.AbstractAtsBranchService;
-import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
-
-/**
- * @author Donald G. Dunne
- */
-public class AtsBranchServiceImpl extends AbstractAtsBranchService {
-
- @Override
- public boolean isBranchInCommit(IAtsTeamWorkflow teamWf) throws OseeCoreException {
- return AtsBranchManagerCore.isBranchInCommit((TeamWorkFlowArtifact) teamWf);
- }
-
- @Override
- public boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException {
- return AtsBranchManagerCore.isWorkingBranchInWork(teamWf);
- }
-
- @Override
- public IOseeBranch getBranch(IAtsTeamWorkflow teamWf) throws OseeCoreException {
- return AtsBranchManagerCore.getWorkingBranch((TeamWorkFlowArtifact) teamWf);
- }
-
- @Override
- public Branch getBranch(IAtsConfigObject configObject) {
- Branch branch = null;
- if (configObject instanceof IAtsVersion) {
- IAtsVersion version = (IAtsVersion) configObject;
- if (version.getBaselineBranchUuid() > 0) {
- branch = BranchManager.getBranchByUuid(version.getBaselineBranchUuid());
- }
- }
- if (branch == null && (configObject instanceof IAtsTeamDefinition)) {
- IAtsTeamDefinition teamDef = (IAtsTeamDefinition) configObject;
- if (teamDef.getBaselineBranchUuid() > 0) {
- branch = BranchManager.getBranchByUuid(teamDef.getBaselineBranchUuid());
- }
- }
- if (branch == null) {
- Artifact artifact = AtsClientService.get().getArtifact(configObject);
- if (artifact != null) {
- String branchUuid = artifact.getSoleAttributeValue(AtsAttributeTypes.BaselineBranchUuid, "");
- if (Strings.isValid(branchUuid)) {
- branch = BranchManager.getBranch(branchUuid);
- }
- }
- }
- return branch;
- }
-
- @Override
- public String getBranchShortName(ICommitConfigItem commitConfigArt) {
- return ((Branch) getBranch(commitConfigArt)).getShortName();
- }
-
- @Override
- public IOseeBranch getBranchInherited(IAtsVersion version) {
- IOseeBranch branch = null;
- long branchUuid = version.getBaselineBranchUuidInherited();
- if (branchUuid > 0) {
- branch = BranchManager.getBranch(branchUuid);
- }
- return branch;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsBranchService.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsBranchService.java
index a2703533081..e5e23df121c 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsBranchService.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsBranchService.java
@@ -10,16 +10,352 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.util;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
import org.eclipse.osee.ats.api.IAtsConfigObject;
+import org.eclipse.osee.ats.api.IAtsServices;
+import org.eclipse.osee.ats.api.commit.CommitStatus;
import org.eclipse.osee.ats.api.commit.ICommitConfigItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.ats.api.version.IAtsVersionService;
import org.eclipse.osee.ats.api.workflow.IAtsBranchService;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.ITransaction;
+import org.eclipse.osee.framework.core.enums.BranchState;
+import org.eclipse.osee.framework.core.enums.BranchType;
+import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
* @author Donald G Dunne
*/
public abstract class AbstractAtsBranchService implements IAtsBranchService {
+ protected static Map<String, IOseeBranch> idToWorkingBranchCache = new HashMap<String, IOseeBranch>();
+ protected static Map<String, Long> idToWorkingBranchCacheUpdated = new HashMap<String, Long>(50);
+ private final IAtsServices atsServices;
+ private static final int SHORT_NAME_LIMIT = 35;
+ private static Set<IOseeBranch> branchesInCommit = new HashSet<IOseeBranch>();
+
+ public AbstractAtsBranchService(IAtsServices atsServices) {
+ this.atsServices = atsServices;
+ }
+
+ /**
+ * Returns true if there was ever a commit of a working branch regardless of whether the working branch is archived
+ * or not.
+ */
+ @Override
+ public boolean isWorkingBranchEverCommitted(IAtsTeamWorkflow teamWf) {
+ return getBranchesCommittedTo(teamWf).size() > 0;
+ }
+
+ @Override
+ public Collection<IOseeBranch> getBranchesToCommitTo(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ Set<IOseeBranch> branches = new HashSet<IOseeBranch>();
+ for (ICommitConfigItem obj : getConfigArtifactsConfiguredToCommitTo(teamWf)) {
+ if (isBranchValid(obj)) {
+ branches.add(getBranch(obj));
+ }
+ }
+ return branches;
+ }
+
+ public ITransaction getCommitTransactionRecord(IAtsTeamWorkflow teamWf, ICommitConfigItem configArt) throws OseeCoreException {
+ IOseeBranch branch = getBranch(configArt);
+ return getCommitTransactionRecord(teamWf, branch);
+ }
+
+ /**
+ * Return working branch associated with SMA whether it is committed or not; This data is cached across all workflows
+ * with the cache being updated by local and remote events.
+ *
+ * @param force == true does not used cached value
+ */
+ @Override
+ public IOseeBranch getWorkingBranch(IAtsTeamWorkflow teamWf, boolean force) {
+ long now = new Date().getTime();
+ boolean notSet = idToWorkingBranchCacheUpdated.get(teamWf.getAtsId()) == null;
+ if (AtsUtilCore.isInTest() || notSet || force || (now - idToWorkingBranchCacheUpdated.get(teamWf.getAtsId()) > 1000)) {
+ idToWorkingBranchCache.put(
+ teamWf.getAtsId(),
+ getWorkingBranchExcludeStates(teamWf, BranchState.REBASELINED, BranchState.DELETED, BranchState.PURGED,
+ BranchState.COMMIT_IN_PROGRESS, BranchState.CREATION_IN_PROGRESS, BranchState.DELETE_IN_PROGRESS,
+ BranchState.PURGE_IN_PROGRESS));
+ idToWorkingBranchCacheUpdated.put(teamWf.getAtsId(), now);
+ }
+ return idToWorkingBranchCache.get(teamWf.getAtsId());
+ }
+
+ /**
+ * @return Branch that is the configured branch to create working branch from.
+ */
+ @Override
+ public IOseeBranch getConfiguredBranchForWorkflow(IAtsTeamWorkflow teamWf) {
+ IOseeBranch parentBranch = null;
+
+ // Check for parent branch uuid in Version artifact
+ if (teamWf.getTeamDefinition().isTeamUsesVersions()) {
+ IAtsVersion verArt = atsServices.getVersionService().getTargetedVersion(teamWf);
+ if (verArt != null) {
+ parentBranch = getBranch((IAtsConfigObject) verArt);
+ }
+ }
+
+ // If not defined in version, check for parent branch from team definition
+ if (parentBranch == null && teamWf.isTeamWorkflow() && isBranchValid(teamWf.getTeamDefinition())) {
+ parentBranch = getBranch((IAtsConfigObject) teamWf.getTeamDefinition());
+ }
+
+ // If not defined, return null
+ return parentBranch;
+ }
+
+ @Override
+ public CommitStatus getCommitStatus(IAtsTeamWorkflow teamWf, IOseeBranch destinationBranch) {
+ CommitStatus commitStatus = getCommitStatus(teamWf, destinationBranch, null);
+ return commitStatus;
+ }
+
+ @Override
+ public ITransaction getCommitTransactionRecord(IAtsTeamWorkflow teamWf, IOseeBranch branch) {
+ if (branch == null) {
+ return null;
+ }
+
+ Collection<ITransaction> transactions = getCommittedArtifactTransactionIds(teamWf);
+ for (ITransaction transId : transactions) {
+ if (getBranch(transId).getUuid() == branch.getUuid()) {
+ return transId;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public ICommitConfigItem getParentBranchConfigArtifactConfiguredToCommitTo(IAtsTeamWorkflow teamWf) {
+ if (teamWf.getTeamDefinition().isTeamUsesVersions()) {
+ if (atsServices.getVersionService().hasTargetedVersion(teamWf)) {
+ return atsServices.getVersionService().getTargetedVersion(teamWf);
+ }
+ } else {
+ if (teamWf.isTeamWorkflow() && isBranchValid(teamWf.getTeamDefinition())) {
+ return teamWf.getTeamDefinition();
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public ITransaction getEarliestTransactionId(IAtsTeamWorkflow teamWf) {
+ Collection<ITransaction> transactionIds = getTransactionIds(teamWf, false);
+ ITransaction earliestTransactionId;
+ if (transactionIds.isEmpty()) {
+ earliestTransactionId = null;
+ } else {
+ earliestTransactionId = transactionIds.iterator().next();
+ for (ITransaction transactionId : transactionIds) {
+ if (transactionId.getGuid() < earliestTransactionId.getGuid()) {
+ earliestTransactionId = transactionId;
+ }
+ }
+ }
+ return earliestTransactionId;
+ }
+
+ @Override
+ public boolean isBranchesAllCommittedExcept(IAtsTeamWorkflow teamWf, IOseeBranch branchToExclude) {
+ Collection<IOseeBranch> committedTo = getBranchesCommittedTo(teamWf);
+ for (IOseeBranch destBranch : getBranchesToCommitTo(teamWf)) {
+ if (!destBranch.equals(branchToExclude) && !committedTo.contains(destBranch) && !isNoCommitNeeded(teamWf,
+ destBranch)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public Collection<IOseeBranch> getBranchesCommittedTo(IAtsTeamWorkflow teamWf) {
+ Set<IOseeBranch> branches = new HashSet<IOseeBranch>();
+ for (ITransaction transId : getTransactionIds(teamWf, false)) {
+ branches.add(getBranch(transId));
+ }
+ return branches;
+ }
+
+ @Override
+ public Collection<IOseeBranch> getBranchesLeftToCommit(IAtsTeamWorkflow teamWf) {
+ Set<IOseeBranch> branchesLeft = new HashSet<IOseeBranch>();
+ Collection<IOseeBranch> committedTo = getBranchesCommittedTo(teamWf);
+ for (IOseeBranch branchToCommit : getBranchesToCommitTo(teamWf)) {
+ if (!committedTo.contains(branchToCommit) && !isNoCommitNeeded(teamWf, branchToCommit)) {
+ branchesLeft.add(branchToCommit);
+ }
+ }
+ return branchesLeft;
+ }
+
+ @Override
+ public CommitStatus getCommitStatus(IAtsTeamWorkflow teamWf, ICommitConfigItem configArt) {
+ return getCommitStatus((IAtsTeamWorkflow) teamWf.getStoreObject(), configArt);
+ }
+
+ @Override
+ public boolean isBranchInCommit(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ if (!isWorkingBranchInWork(teamWf)) {
+ return false;
+ }
+ return branchesInCommit.contains(getWorkingBranch(teamWf));
+ }
+
+ @Override
+ public Collection<ICommitConfigItem> getConfigArtifactsConfiguredToCommitTo(IAtsTeamWorkflow teamWf) {
+ Set<ICommitConfigItem> configObjects = new HashSet<ICommitConfigItem>();
+ if (teamWf.getTeamDefinition().isTeamUsesVersions()) {
+ if (atsServices.getVersionService().hasTargetedVersion(teamWf)) {
+ atsServices.getVersionService().getTargetedVersion(teamWf).getParallelVersions(configObjects);
+ }
+ } else {
+ if (teamWf.isTeamWorkflow() && isBranchValid(teamWf.getTeamDefinition())) {
+ configObjects.add(teamWf.getTeamDefinition());
+ }
+ }
+ return configObjects;
+ }
+
+ @Override
+ public Collection<ITransaction> getCommitTransactionsToUnarchivedBaselineBranchs(IAtsTeamWorkflow teamWf) {
+ Collection<ITransaction> committedTransactions = getCommittedArtifactTransactionIds(teamWf);
+
+ Collection<ITransaction> transactionIds = new ArrayList<ITransaction>();
+ for (ITransaction transactionId : committedTransactions) {
+ // exclude working branches including branch states that are re-baselined
+ IOseeBranch branch = getBranch(transactionId);
+ if (getBranchType(branch).isBaselineBranch() && getArchiveState(branch).isUnArchived()) {
+ transactionIds.add(transactionId);
+ }
+ }
+ return transactionIds;
+ }
+
+ public boolean isNoCommitNeeded(IAtsTeamWorkflow teamWf, IOseeBranch destinationBranch) throws OseeCoreException {
+ return getCommitStatus(teamWf, destinationBranch) == CommitStatus.No_Commit_Needed;
+ }
+
+ /**
+ * Return true if all commit destination branches are configured and have been committed to
+ */
+ @Override
+ public boolean isBranchesAllCommitted(IAtsTeamWorkflow teamWf) {
+ Collection<IOseeBranch> committedTo = getBranchesCommittedTo(teamWf);
+ for (IOseeBranch destBranch : getBranchesToCommitTo(teamWf)) {
+ if (!committedTo.contains(destBranch) && !isNoCommitNeeded(teamWf, destBranch)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Return working branch associated with SMA whether it is committed or not; This data is cached across all workflows
+ * with the cache being updated by local and remote events.
+ */
+ @Override
+ public IOseeBranch getWorkingBranch(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ return getWorkingBranch(teamWf, false);
+ }
+
+ /**
+ * @return true if at least one destination branch committed to
+ */
+ @Override
+ public boolean isCommittedBranchExists(IAtsTeamWorkflow teamWf) {
+ return !getBranchesCommittedTo(teamWf).isEmpty();
+ }
+
+ /**
+ * @return false if any object in parallel configuration is not configured with a valid branch
+ */
+ @Override
+ public boolean isAllObjectsToCommitToConfigured(IAtsTeamWorkflow teamWf) {
+ Collection<ICommitConfigItem> configs = getConfigArtifactsConfiguredToCommitTo(teamWf);
+ for (ICommitConfigItem config : configs) {
+ if (!isBranchValid(config)) {
+ return false;
+ }
+ if (!branchExists(config.getBaselineBranchUuid())) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public String getBranchShortName(ICommitConfigItem commitConfigItem) {
+ return Strings.truncate(commitConfigItem.getName(), SHORT_NAME_LIMIT);
+ }
+
+ @Override
+ public IOseeBranch getBranchInherited(IAtsVersion version) {
+ IOseeBranch branch = null;
+ long branchUuid = version.getBaselineBranchUuidInherited();
+ if (branchUuid > 0) {
+ branch = getBranchByUuid(branchUuid);
+ }
+ return branch;
+ }
+
+ @Override
+ public boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ IOseeBranch branch = getWorkingBranch(teamWf);
+ return branch != null && !getBranchState(branch).isCommitted();
+ }
+
+ @Override
+ public IOseeBranch getBranch(IAtsConfigObject configObject) {
+ IOseeBranch branch = null;
+ if (configObject instanceof IAtsVersion) {
+ IAtsVersion version = (IAtsVersion) configObject;
+ if (version.getBaselineBranchUuid() > 0) {
+ branch = getBranchByUuid(version.getBaselineBranchUuid());
+ }
+ }
+ if (branch == null && (configObject instanceof IAtsTeamDefinition)) {
+ IAtsTeamDefinition teamDef = (IAtsTeamDefinition) configObject;
+ if (teamDef.getBaselineBranchUuid() > 0) {
+ branch = getBranchByUuid(teamDef.getBaselineBranchUuid());
+ }
+ }
+ if (branch == null) {
+ String branchUuid =
+ atsServices.getAttributeResolver().getSoleAttributeValueAsString(configObject,
+ AtsAttributeTypes.BaselineBranchUuid, "");
+ if (Strings.isValid(branchUuid)) {
+ branch = getBranchByUuid(Long.valueOf(branchUuid));
+ }
+ }
+ return branch;
+ }
+
+ /**
+ * Return working branch associated with SMA whether it is committed or not; This data is cached across all workflows
+ * with the cache being updated by local and remote events.
+ */
+ @Override
+ public IOseeBranch getBranch(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ return getWorkingBranch(teamWf, false);
+ }
+
@Override
public IOseeBranch getBranch(ICommitConfigItem configObject) {
return getBranch((IAtsConfigObject) configObject);
@@ -34,4 +370,235 @@ public abstract class AbstractAtsBranchService implements IAtsBranchService {
return validBranch;
}
+ /**
+ * This method was refactored from above so it could be tested independently
+ */
+ @Override
+ public Collection<Object> combineCommitTransactionsAndConfigItems(Collection<ICommitConfigItem> configArtSet, Collection<ITransaction> commitTxs) throws OseeCoreException {
+ // commitMgrInputObjs will hold a union of all commits from configArtSet and commitTxs.
+ // - first, we addAll configArtSet
+ // - next, we loop through commitTxs and for any tx that has the same branch as ANY pre-existing commit
+ // in configArtSet we do NOT add it to commitMgrInputObjs.
+ Collection<Object> commitMgrInputObjs = new HashSet<Object>();
+ commitMgrInputObjs.addAll(configArtSet);
+ //for each tx commit...
+ for (ITransaction txRecord : commitTxs) {
+ IOseeBranch txBranch = getBranch(txRecord);
+ boolean isCommitAlreadyPresent = false;
+ // ... compare the branch of the tx commit to all the parent branches in configArtSet and do NOT add the tx
+ // commit if it is already represented.
+ for (ICommitConfigItem configArt : configArtSet) {
+ IOseeBranch configArtBranch = getBranch(configArt);
+ if (txBranch == configArtBranch) {
+ isCommitAlreadyPresent = true;
+ break;
+ }
+ }
+ if (!isCommitAlreadyPresent) {
+ commitMgrInputObjs.add(txRecord);
+ }
+ }
+ return commitMgrInputObjs;
+ }
+
+ /**
+ * @return Logically combines the results from getConfigArtifactsConfiguredToCommitTo() and
+ * getCommitTransactionsToUnarchivedBaselineBranchs() into a single Collection of Objects. Objects are selected from
+ * getConfigArtifactsConfiguredToCommitTo() first. Then compared to the branches in the Collection of TxRecords from
+ * getCommitTransactionsToUnarchivedBaselineBranchs(). The TxRecords take LESS priority than the ICommitConfigArts
+ * from getConfigArtifactsConfiguredToCommitTo()
+ */
+ @Override
+ public Collection<Object> getCommitTransactionsAndConfigItemsForTeamWf(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ Collection<ICommitConfigItem> configArtSet = getConfigArtifactsConfiguredToCommitTo(teamWf);
+ Collection<ITransaction> commitTxs = getCommitTransactionsToUnarchivedBaselineBranchs(teamWf);
+ Collection<Object> commitMgrInputObjs = combineCommitTransactionsAndConfigItems(configArtSet, commitTxs);
+ return commitMgrInputObjs;
+ }
+
+ @Override
+ public Result isCommitBranchAllowed(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ if (!teamWf.isTeamWorkflow()) {
+ return Result.FalseResult;
+ }
+ if (teamWf.getTeamDefinition().isTeamUsesVersions()) {
+ IAtsVersionService versionService = atsServices.getVersionService();
+ if (!versionService.hasTargetedVersion(teamWf)) {
+ return new Result(false, "Workflow not targeted for Version");
+ }
+ IAtsVersion targetedVersion = versionService.getTargetedVersion(teamWf);
+ Result result = targetedVersion.isAllowCommitBranchInherited();
+ if (result.isFalse()) {
+ return result;
+ }
+
+ if (!isBranchValid(targetedVersion)) {
+ return new Result(false, "Parent Branch not configured for Version [" + targetedVersion + "]");
+ }
+ return Result.TrueResult;
+
+ } else {
+ Result result = teamWf.getTeamDefinition().isAllowCommitBranchInherited();
+ if (result.isFalse()) {
+ return result;
+ }
+
+ if (!isBranchValid(teamWf.getTeamDefinition())) {
+ return new Result(false,
+ "Parent Branch not configured for Team Definition [" + teamWf.getTeamDefinition() + "]");
+ }
+ return Result.TrueResult;
+ }
+ }
+
+ @Override
+ public Result isCreateBranchAllowed(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ if (!teamWf.isTeamWorkflow()) {
+ return Result.FalseResult;
+ }
+
+ if (teamWf.getTeamDefinition().isTeamUsesVersions()) {
+ IAtsVersionService versionService = atsServices.getVersionService();
+ if (!versionService.hasTargetedVersion(teamWf)) {
+ return new Result(false, "Workflow not targeted for Version");
+ }
+ IAtsVersion targetedVersion = versionService.getTargetedVersion(teamWf);
+ Result result = targetedVersion.isAllowCreateBranchInherited();
+ if (result.isFalse()) {
+ return result;
+ }
+
+ if (!isBranchValid(targetedVersion)) {
+ return new Result(false, "Parent Branch not configured for Version [" + targetedVersion + "]");
+ }
+ IOseeBranch baselineBranch = getBranch((IAtsConfigObject) targetedVersion);
+ if (!getBranchType(baselineBranch).isBaselineBranch()) {
+ return new Result(false, "Parent Branch must be of Baseline branch type. See Admin for configuration.");
+ }
+ return Result.TrueResult;
+
+ } else {
+ Result result = teamWf.getTeamDefinition().isAllowCreateBranchInherited();
+ if (result.isFalse()) {
+ return result;
+ }
+
+ if (!isBranchValid(teamWf.getTeamDefinition())) {
+ return new Result(false,
+ "Parent Branch not configured for Team Definition [" + teamWf.getTeamDefinition() + "]");
+ }
+ IOseeBranch baselineBranch = getBranch((IAtsConfigObject) teamWf.getTeamDefinition());
+ if (!getBranchType(baselineBranch).isBaselineBranch()) {
+ return new Result(false, "Parent Branch must be of Baseline branch type. See Admin for configuration.");
+ }
+ return Result.TrueResult;
+ }
+ }
+
+ @Override
+ public CommitStatus getCommitStatus(IAtsTeamWorkflow teamWf, IOseeBranch destinationBranch, ICommitConfigItem configArt) {
+ IOseeBranch workingBranch = getWorkingBranch(teamWf);
+ if (workingBranch != null) {
+ if (getBranchState(workingBranch).isRebaselineInProgress()) {
+ return CommitStatus.Rebaseline_In_Progress;
+ }
+ }
+
+ if (destinationBranch == null) {
+ return CommitStatus.Branch_Not_Configured;
+ }
+
+ Collection<ITransaction> transactions = getCommittedArtifactTransactionIds(teamWf);
+ boolean mergeBranchExists = isMergeBranchExists(teamWf, destinationBranch);
+
+ for (ITransaction transId : transactions) {
+ if (destinationBranch.equals(getBranch(transId))) {
+ if (mergeBranchExists) {
+ return CommitStatus.Committed_With_Merge;
+ } else {
+ return CommitStatus.Committed;
+ }
+ }
+ }
+
+ if (workingBranchCommittedToDestinationBranchParentPriorToDestinationBranchCreation(teamWf, destinationBranch,
+ transactions)) {
+ return CommitStatus.No_Commit_Needed;
+ }
+
+ Result result = new Result(false);
+ if (configArt == null) {
+ result = isCommitBranchAllowed(teamWf);
+ } else {
+ result = configArt.isAllowCommitBranchInherited();
+ }
+ if (result.isFalse()) {
+ return CommitStatus.Branch_Commit_Disabled;
+ }
+ if (getWorkingBranch(teamWf) == null) {
+ return CommitStatus.Working_Branch_Not_Created;
+ }
+ if (mergeBranchExists) {
+ return CommitStatus.Merge_In_Progress;
+ }
+
+ return CommitStatus.Commit_Needed;
+ }
+
+ /**
+ * @return TransactionId associated with this state machine artifact
+ */
+ @Override
+ public Collection<ITransaction> getTransactionIds(IAtsTeamWorkflow teamWf, boolean forMergeBranches) {
+ if (forMergeBranches) {
+ IOseeBranch workingBranch = getWorkingBranch(teamWf);
+ // grab only the transaction that had merge conflicts
+ Collection<ITransaction> transactionIds = new ArrayList<ITransaction>();
+ for (ITransaction transactionId : getCommitTransactionsToUnarchivedBaselineBranchs(teamWf)) {
+ if (isMergeBranchExists(teamWf, workingBranch, getBranch(transactionId))) {
+ transactionIds.add(transactionId);
+ }
+ }
+ return transactionIds;
+ } else {
+ return getCommitTransactionsToUnarchivedBaselineBranchs(teamWf);
+ }
+ }
+
+ /**
+ * Return true if merge branch exists in DB (whether archived or not)
+ */
+ @Override
+ public boolean isMergeBranchExists(IAtsTeamWorkflow teamWf, IOseeBranch destinationBranch) throws OseeCoreException {
+ return isMergeBranchExists(teamWf, getWorkingBranch(teamWf), destinationBranch);
+ }
+
+ @Override
+ public Set<IOseeBranch> getBranchesInCommit() {
+ return branchesInCommit;
+ }
+
+ @Override
+ public boolean workingBranchCommittedToDestinationBranchParentPriorToDestinationBranchCreation(IAtsTeamWorkflow teamWf, IOseeBranch destinationBranch, Collection<ITransaction> commitTransactionIds) throws OseeCoreException {
+ IOseeBranch destinationBranchParent = getParentBranch(destinationBranch);
+ if (getBranchType(destinationBranchParent) == BranchType.SYSTEM_ROOT) {
+ return false;
+ }
+
+ ITransaction committedToParentTransRecord = null;
+ for (ITransaction transId : commitTransactionIds) {
+ if (getBranch(transId).equals(destinationBranchParent)) {
+ committedToParentTransRecord = transId;
+ break;
+ }
+ }
+ if (committedToParentTransRecord != null) {
+ if (getTimeStamp(getBaseTransaction(destinationBranch)).after(getTimeStamp(committedToParentTransRecord))) {
+ return true;
+ }
+ }
+ return workingBranchCommittedToDestinationBranchParentPriorToDestinationBranchCreation(teamWf,
+ destinationBranchParent, commitTransactionIds);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.impl/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.impl/META-INF/MANIFEST.MF
index 38285b03872..10dda2a04dd 100644
--- a/plugins/org.eclipse.osee.ats.impl/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.impl/META-INF/MANIFEST.MF
@@ -36,6 +36,7 @@ Import-Package: com.google.inject,
org.eclipse.osee.framework.core.model,
org.eclipse.osee.framework.core.util,
org.eclipse.osee.framework.database,
+ org.eclipse.osee.framework.database.core,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
org.eclipse.osee.framework.logging,
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java
index 86e99f5548a..c7ef5a6608a 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsServerImpl.java
@@ -145,7 +145,7 @@ public class AtsServerImpl implements IAtsServer {
configItemFactory = new ConfigItemFactory(logger, this);
workItemService = new AtsWorkItemServiceImpl(this, this);
- branchService = new AtsBranchServiceImpl(orcsApi);
+ branchService = new AtsBranchServiceImpl(this, orcsApi, dbService);
reviewService = new AtsReviewServiceImpl(this, workItemService);
workDefCacheProvider = new AtsWorkDefinitionCacheProvider(workDefService);
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsBranchServiceImpl.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsBranchServiceImpl.java
index 039d1c124ac..2537a956865 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsBranchServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/util/AtsBranchServiceImpl.java
@@ -10,22 +10,27 @@
*******************************************************************************/
package org.eclipse.osee.ats.impl.internal.util;
-import org.eclipse.osee.ats.api.IAtsConfigObject;
-import org.eclipse.osee.ats.api.commit.ICommitConfigItem;
-import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
-import org.eclipse.osee.ats.api.version.IAtsVersion;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import org.eclipse.osee.ats.api.IAtsServices;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.core.util.AbstractAtsBranchService;
import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.ITransaction;
+import org.eclipse.osee.framework.core.enums.BranchArchivedState;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
-import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
+import org.eclipse.osee.framework.core.model.TransactionRecord;
+import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.data.ArtifactReadable;
-import org.eclipse.osee.orcs.data.BranchReadable;
import org.eclipse.osee.orcs.search.BranchQuery;
/**
@@ -33,96 +38,181 @@ import org.eclipse.osee.orcs.search.BranchQuery;
*/
public class AtsBranchServiceImpl extends AbstractAtsBranchService {
+ private final String SELECT_MERGE_BRANCH =
+ "select branch_id from osee_merge where source_branch_id = ? and dest_branch_id = ?";
+ private final String SELECT_WORKING_BRANCH =
+ "select branch_id from osee_branch where associated_art_id = %d and branch_type = 0 and archived = 0 %s";
+ private final String SELECT_COMMITTED_WORKING_BRANCH =
+ "select branch_id from osee_branch where associated_art_id = %d and branch_type = 0 and archived = 0 and branch_state = 2";
+ private final String SELECT_BRANCH_STATE = "select branch_state from osee_branch where branch_id = ?";
+ private final String SELECT_BRANCH_PARENT_ID = "select parent_branch_id from osee_branch where branch_id = ?";
+ private final String SELECT_BRANCH_BASE_TRANSACTION_ID =
+ "select base_transaction_id from osee_branch where branch_id = ?";
+ private final String SELECT_BRANCH_TYPE = "select branch_type from osee_branch where branch_id = ?";
+ private final String SELECT_BRANCH_ARCHIVE_STATE = "select archived from osee_branch where branch_id = ?";
+ private final String SELECT_COMMIT_TRANSACTIONS =
+ "SELECT transaction_id FROM osee_tx_details WHERE commit_art_id = ?";
+ private final String SELECT_TRANSACTION = "SELECT * FROM osee_tx_details WHERE transaction_id = ?";
+ private final IOseeDatabaseService dbService;
private final OrcsApi orcsApi;
+ private static final HashMap<Integer, List<ITransaction>> commitArtifactIdMap =
+ new HashMap<Integer, List<ITransaction>>();
- public AtsBranchServiceImpl(OrcsApi orcsApi) {
+ public AtsBranchServiceImpl(IAtsServices atsServices, OrcsApi orcsApi, IOseeDatabaseService dbService) {
+ super(atsServices);
this.orcsApi = orcsApi;
+ this.dbService = dbService;
}
@Override
- public boolean isBranchInCommit(IAtsTeamWorkflow teamWf) throws OseeCoreException {
- IOseeBranch branch = getBranch(teamWf);
+ public IOseeBranch getCommittedWorkingBranch(IAtsTeamWorkflow teamWf) {
+ Long longId =
+ dbService.runPreparedQueryFetchObject(0L,
+ String.format(SELECT_COMMITTED_WORKING_BRANCH, ((ArtifactReadable) teamWf.getStoreObject()).getLocalId()));
+ if (longId == null) {
+ return null;
+ }
+ return orcsApi.getQueryFactory(null).branchQuery().andUuids(longId).getResults().getExactlyOne();
+ }
- BranchQuery query = orcsApi.getQueryFactory(null).branchQuery();
- BranchReadable branchReadable = query.andIds(branch).getResults().getExactlyOne();
+ @Override
+ public IOseeBranch getWorkingBranchExcludeStates(IAtsTeamWorkflow teamWf, BranchState... negatedBranchStates) {
+ String negatedStr = "";
+ if (negatedBranchStates.length > 0) {
+ negatedStr = "and branch_state not in (";
+ for (BranchState state : negatedBranchStates) {
+ negatedStr += state.getValue() + ",";
+ }
+ negatedStr = negatedStr.replaceFirst(",$", ")");
+ }
+ Long longId =
+ dbService.runPreparedQueryFetchObject(0L,
+ String.format(SELECT_WORKING_BRANCH, ((ArtifactReadable) teamWf.getStoreObject()).getLocalId(), negatedStr));
+ if (longId == null) {
+ return null;
+ }
+ return orcsApi.getQueryFactory(null).branchQuery().andUuids(longId).getResults().getExactlyOne();
+ }
+
+ @Override
+ public BranchType getBranchType(IOseeBranch branch) {
+ String branchType = dbService.runPreparedQueryFetchObject("", SELECT_BRANCH_TYPE, branch.getUuid());
+ if (!Strings.isValid(branchType)) {
+ return null;
+ }
+ return BranchType.valueOf(branchType);
+ }
- return branchReadable.getBranchState() == BranchState.COMMIT_IN_PROGRESS;
+ @Override
+ public BranchState getBranchState(IOseeBranch branch) {
+ String branchState = dbService.runPreparedQueryFetchObject("", SELECT_BRANCH_STATE, branch.getUuid());
+ if (!Strings.isValid(branchState)) {
+ return null;
+ }
+ return BranchState.valueOf(branchState);
}
+ /**
+ * Return true if merge branch exists in DB (whether archived or not)
+ */
@Override
- public boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException {
- boolean inWork = false;
- IOseeBranch branch = getBranch(teamWf);
- if (branch != null) {
- BranchQuery query = orcsApi.getQueryFactory(null).branchQuery();
- BranchReadable branchReadable = query.andIds(branch).getResults().getExactlyOne();
- if (branchReadable != null) {
- BranchState state = branchReadable.getBranchState();
- inWork = state == BranchState.CREATED || state == BranchState.MODIFIED;
- }
+ public boolean isMergeBranchExists(IAtsTeamWorkflow teamWf, IOseeBranch destinationBranch) throws OseeCoreException {
+ return isMergeBranchExists(teamWf, getWorkingBranch(teamWf), destinationBranch);
+ }
+
+ /**
+ * Method available for optimized checking of merge branches so don't have to re-acquire working branch if already
+ * have
+ */
+ @Override
+ public boolean isMergeBranchExists(IAtsTeamWorkflow teamWf, IOseeBranch workingBranch, IOseeBranch destinationBranch) throws OseeCoreException {
+ if (workingBranch == null) {
+ return false;
}
- return inWork;
+ Long longId =
+ dbService.runPreparedQueryFetchObject(0L, SELECT_MERGE_BRANCH, workingBranch.getUuid(),
+ destinationBranch.getUuid());
+ return longId != null && longId > 0;
}
@Override
- public IOseeBranch getBranch(IAtsTeamWorkflow teamWf) throws OseeCoreException {
- IOseeBranch results = null;
+ public IOseeBranch getBranchByUuid(long branchUuid) {
+ return orcsApi.getQueryFactory(null).branchQuery().andUuids(branchUuid).getResults().getExactlyOne();
+ }
+
+ @Override
+ public boolean branchExists(long branchUuid) {
BranchQuery query = orcsApi.getQueryFactory(null).branchQuery();
- ResultSet<BranchReadable> branches = query.excludeArchived().andIsOfType(BranchType.WORKING).getResults();
-
- if (!branches.isEmpty()) {
- ArtifactReadable artifact = null;
- if (teamWf.getStoreObject() != null) {
- artifact = (ArtifactReadable) teamWf.getStoreObject();
- } else {
- artifact =
- orcsApi.getQueryFactory(null).fromBranch(AtsUtilServer.getAtsBranch()).andGuid(teamWf.getGuid()).getResults().getExactlyOne();
- }
- for (BranchReadable branch : branches) {
- if (branch.getAssociatedArtifactId() == artifact.getLocalId()) {
- results = branch;
- break;
- }
- }
+ return query.andUuids(branchUuid).getCount() > 0;
+ }
+
+ @Override
+ public BranchArchivedState getArchiveState(IOseeBranch branch) {
+ String archived = dbService.runPreparedQueryFetchObject("0", SELECT_BRANCH_ARCHIVE_STATE, branch.getUuid());
+ if (!Strings.isValid(archived)) {
+ return null;
}
- return results;
+ return BranchArchivedState.valueOf(archived);
+ }
+
+ @Override
+ public IOseeBranch getBranch(ITransaction transaction) {
+ return getBranchByUuid(((TransactionRecord) transaction).getBranchId());
}
@Override
- public IOseeBranch getBranch(IAtsConfigObject configObject) {
- IOseeBranch branch = null;
- ArtifactReadable artifact =
- orcsApi.getQueryFactory(null).fromBranch(AtsUtilServer.getAtsBranch()).andGuid(configObject.getGuid()).getResults().getExactlyOne();
- if (artifact != null) {
- String branchUuid = artifact.getSoleAttributeValue(AtsAttributeTypes.BaselineBranchUuid, "");
- if (Strings.isValid(branchUuid)) {
- BranchQuery query = orcsApi.getQueryFactory(null).branchQuery();
- ResultSet<BranchReadable> branches = query.andUuids(Long.valueOf(branchUuid)).getResults();
- if (!branches.isEmpty()) {
- branch = branches.iterator().next();
+ public Date getTimeStamp(ITransaction transaction) {
+ return ((TransactionRecord) transaction).getTimeStamp();
+ }
+
+ @Override
+ public Collection<ITransaction> getCommittedArtifactTransactionIds(IAtsTeamWorkflow teamWf) {
+ ArtifactReadable artifactReadable = (ArtifactReadable) teamWf;
+ List<ITransaction> transactionIds = commitArtifactIdMap.get(artifactReadable.getLocalId());
+ // Cache the transactionIds first time through. Other commits will be added to cache as they
+ // happen in this client or as remote commit events come through
+ if (transactionIds == null) {
+ transactionIds = new ArrayList<ITransaction>(5);
+ IOseeStatement chStmt = dbService.getStatement();
+ try {
+ chStmt.runPreparedQuery(SELECT_COMMIT_TRANSACTIONS, artifactReadable.getLocalId());
+ while (chStmt.next()) {
+ transactionIds.add(getTransactionId(chStmt.getInt("transaction_id")));
}
+ commitArtifactIdMap.put(artifactReadable.getLocalId(), transactionIds);
+ } finally {
+ chStmt.close();
}
}
- return branch;
+ return transactionIds;
+ }
+
+ private TransactionRecord getTransactionId(int int1) {
+ IOseeStatement chStmt = dbService.getStatement();
+ try {
+ chStmt.runPreparedQuery(SELECT_TRANSACTION, int1);
+ while (chStmt.next()) {
+ TransactionDetailsType txType = TransactionDetailsType.toEnum(chStmt.getInt("tx_type"));
+ return new TransactionRecord(int1, chStmt.getLong("branch_id"), chStmt.getString("osee_comment"),
+ chStmt.getTimestamp("time"), chStmt.getInt("author"), chStmt.getInt("commit_art_id"), txType, null);
+ }
+ } finally {
+ chStmt.close();
+ }
+ return null;
}
@Override
- public String getBranchShortName(ICommitConfigItem commitConfigArt) {
- return ((Branch) getBranch(commitConfigArt)).getShortName();
+ public IOseeBranch getParentBranch(IOseeBranch branch) {
+ long parentId = dbService.runPreparedQueryFetchObject(0L, SELECT_BRANCH_PARENT_ID, branch.getUuid());
+ return getBranchByUuid(parentId);
}
@Override
- public IOseeBranch getBranchInherited(IAtsVersion version) {
- IOseeBranch branch = null;
- long branchUuid = version.getBaselineBranchUuidInherited();
- if (branchUuid > 0) {
- BranchQuery query = orcsApi.getQueryFactory(null).branchQuery();
- ResultSet<BranchReadable> branches = query.andUuids(branchUuid).getResults();
- if (!branches.isEmpty()) {
- branch = branches.iterator().next();
- }
- }
- return branch;
+ public ITransaction getBaseTransaction(IOseeBranch branch) {
+ int baseTransactionId =
+ dbService.runPreparedQueryFetchObject(0, SELECT_BRANCH_BASE_TRANSACTION_ID, branch.getUuid());
+ return getTransactionId(baseTransactionId);
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/PortPairsOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/PortPairsOperation.java
index 5611681e2ce..4808126b534 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/PortPairsOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/PortPairsOperation.java
@@ -16,10 +16,11 @@ import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
+import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.model.Branch;
@@ -115,7 +116,7 @@ public final class PortPairsOperation extends AbstractOperation {
private void doPortWork(TeamWorkFlowArtifact sourceWorkflow, TeamWorkFlowArtifact destinationWorkflow) throws OseeCoreException {
if (destinationWorkflow.getWorkingBranchForceCacheUpdate() == null) {
- AtsBranchManagerCore.createWorkingBranch_Create(destinationWorkflow, true);
+ AtsBranchUtil.createWorkingBranch_Create(destinationWorkflow, true);
}
Branch destinationBranch = destinationWorkflow.getWorkingBranchForceCacheUpdate();
@@ -148,7 +149,8 @@ public final class PortPairsOperation extends AbstractOperation {
BranchManager.getBranchesByName(String.format("Porting [%s] branch", sourceWorkflow.getAtsId()));
if (branches.isEmpty()) {
- TransactionRecord transRecord = AtsBranchManagerCore.getEarliestTransactionId(sourceWorkflow);
+ TransactionRecord transRecord =
+ (TransactionRecord) AtsClientService.get().getBranchService().getEarliestTransactionId(sourceWorkflow);
if (transRecord == null) {
return null;
} else {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowBranchChangeDataAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowBranchChangeDataAction.java
index 1c2ffc6703f..44a3ca53e92 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowBranchChangeDataAction.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowBranchChangeDataAction.java
@@ -13,9 +13,9 @@ package org.eclipse.osee.ats.actions;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsBranchManager;
import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -45,7 +45,8 @@ public class ShowBranchChangeDataAction extends AbstractAtsAction {
return;
}
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) awa;
- if (!AtsBranchManagerCore.isWorkingBranchInWork(teamArt) && !AtsBranchManagerCore.isWorkingBranchEverCommitted(teamArt)) {
+ if (!AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt) && !AtsClientService.get().getBranchService().isWorkingBranchEverCommitted(
+ teamArt)) {
AWorkbench.popup("Working branch never created or committed.");
return;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowChangeReportAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowChangeReportAction.java
index 3b0e3e9bf44..1228ee15b21 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowChangeReportAction.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowChangeReportAction.java
@@ -12,9 +12,9 @@ package org.eclipse.osee.ats.actions;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsBranchManager;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -37,10 +37,10 @@ public class ShowChangeReportAction extends Action {
setToolTipText(getText());
boolean enabled = false;
try {
- if (AtsBranchManagerCore.isWorkingBranchInWork(teamArt)) {
+ if (AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt)) {
enabled = true;
} else {
- enabled = AtsBranchManagerCore.isCommittedBranchExists(teamArt);
+ enabled = AtsClientService.get().getBranchService().isCommittedBranchExists(teamArt);
}
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowMergeManagerAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowMergeManagerAction.java
index 9ab4b2c700c..c1756d541ee 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowMergeManagerAction.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/ShowMergeManagerAction.java
@@ -13,9 +13,9 @@ package org.eclipse.osee.ats.actions;
import java.util.logging.Level;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsBranchManager;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -37,7 +37,8 @@ public class ShowMergeManagerAction extends Action {
setText("Show Merge Manager");
setToolTipText(getText());
try {
- setEnabled(AtsBranchManagerCore.isWorkingBranchInWork(teamArt) || AtsBranchManagerCore.isCommittedBranchExists(teamArt));
+ setEnabled(AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt) || AtsClientService.get().getBranchService().isCommittedBranchExists(
+ teamArt));
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AbstractBranchColumn.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AbstractBranchColumn.java
index f0c1eafdf33..e6079032f50 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AbstractBranchColumn.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/AbstractBranchColumn.java
@@ -16,9 +16,9 @@ import org.eclipse.nebula.widgets.xviewer.IXViewerValueColumn;
import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.core.client.action.ActionManager;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.xviewer.column.XViewerAtsColumn;
import org.eclipse.osee.ats.world.WorldXViewerFactory;
import org.eclipse.osee.framework.core.data.IOseeBranch;
@@ -49,11 +49,11 @@ public abstract class AbstractBranchColumn extends XViewerAtsColumn implements I
if (teamArt != null) {
try {
IOseeBranch workingBranch = null;
- if (AtsBranchManagerCore.isWorkingBranchInWork(teamArt)) {
- workingBranch = AtsBranchManagerCore.getWorkingBranch(teamArt);
+ if (AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt)) {
+ workingBranch = AtsClientService.get().getBranchService().getWorkingBranch(teamArt);
}
if (workingBranch == null) {
- workingBranch = AtsBranchManagerCore.getCommittedWorkingBranch(teamArt);
+ workingBranch = AtsClientService.get().getBranchService().getCommittedWorkingBranch(teamArt);
}
if (workingBranch != null) {
result = getColumnText((Branch) workingBranch);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/BranchStatusColumn.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/BranchStatusColumn.java
index 0d751694b37..cd6905fba2a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/BranchStatusColumn.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/BranchStatusColumn.java
@@ -16,8 +16,8 @@ import org.eclipse.nebula.widgets.xviewer.IXViewerValueColumn;
import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.core.client.action.ActionManager;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.xviewer.column.XViewerAtsColumn;
import org.eclipse.osee.ats.world.WorldXViewerFactory;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -70,10 +70,11 @@ public class BranchStatusColumn extends XViewerAtsColumn implements IXViewerValu
if (Artifacts.isOfType(element, AtsArtifactTypes.TeamWorkflow)) {
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) element;
try {
- if (AtsBranchManagerCore.isWorkingBranchInWork(teamArt)) {
+ if (AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt)) {
return "Working";
- } else if (AtsBranchManagerCore.isCommittedBranchExists(teamArt)) {
- if (!AtsBranchManagerCore.isAllObjectsToCommitToConfigured(teamArt) || !AtsBranchManagerCore.isBranchesAllCommitted(teamArt)) {
+ } else if (AtsClientService.get().getBranchService().isCommittedBranchExists(teamArt)) {
+ if (!AtsClientService.get().getBranchService().isAllObjectsToCommitToConfigured(teamArt) || !AtsClientService.get().getBranchService().isBranchesAllCommitted(
+ teamArt)) {
return "Needs Commit";
}
return "Committed";
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorArtifactEventManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorArtifactEventManager.java
index 16c0e64aa79..514acefeef6 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorArtifactEventManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorArtifactEventManager.java
@@ -20,7 +20,6 @@ import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.core.client.action.ActionArtifact;
import org.eclipse.osee.ats.core.client.action.ActionManager;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
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.task.AbstractTaskableArtifact;
@@ -30,6 +29,7 @@ import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
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;
@@ -205,7 +205,7 @@ public class SMAEditorArtifactEventManager implements IArtifactEventListener {
try {
// Retrieve all config to commit items for this team Wf, which will contain all parallel version artifacts
Collection<ICommitConfigItem> configArtifactsConfiguredToCommitTo =
- AtsBranchManagerCore.getConfigArtifactsConfiguredToCommitTo(teamWf);
+ AtsClientService.get().getBranchService().getConfigArtifactsConfiguredToCommitTo(teamWf);
for (Object obj : configArtifactsConfiguredToCommitTo) {
if (obj instanceof IAtsVersion) {
IAtsVersion version = (IAtsVersion) obj;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java
index c254e67e70a..01eef16eca9 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorBranchEventManager.java
@@ -14,10 +14,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
@@ -97,7 +97,7 @@ public class SMAEditorBranchEventManager implements IBranchEventListener {
case Committed:
if (awa instanceof TeamWorkFlowArtifact) {
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) awa;
- IOseeBranch assocBranch = AtsBranchManagerCore.getWorkingBranch(teamArt);
+ IOseeBranch assocBranch = AtsClientService.get().getBranchService().getWorkingBranch(teamArt);
if (assocBranch != null && branchUuid.equals(assocBranch.getUuid())) {
Displays.ensureInDisplayThread(new Runnable() {
@Override
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java
index 64557da4749..633b8c5f2a6 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java
@@ -42,7 +42,6 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.workdef.IWorkDefinitionMatch;
import org.eclipse.osee.ats.artifact.WorkflowManager;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.config.AtsBulkLoad;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
@@ -51,6 +50,7 @@ import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.client.workflow.note.NoteItem;
import org.eclipse.osee.ats.help.ui.AtsHelpContext;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.walker.action.OpenActionViewAction;
import org.eclipse.osee.ats.workdef.StateXWidgetPage;
import org.eclipse.osee.ats.world.IWorldViewerEventHandler;
@@ -465,7 +465,9 @@ public class SMAWorkFlowTab extends FormPage implements IWorldViewerEventHandler
IToolBarManager toolBarMgr = managedForm.getForm().getToolBarManager();
toolBarMgr.removeAll();
- if (awa.isTeamWorkflow() && (AtsBranchManagerCore.isCommittedBranchExists(((TeamWorkFlowArtifact) awa)) || AtsBranchManagerCore.isWorkingBranchInWork(((TeamWorkFlowArtifact) awa)))) {
+ if (awa.isTeamWorkflow() && (AtsClientService.get().getBranchService().isCommittedBranchExists(
+ ((TeamWorkFlowArtifact) awa)) || AtsClientService.get().getBranchService().isWorkingBranchInWork(
+ ((TeamWorkFlowArtifact) awa)))) {
toolBarMgr.add(new ShowMergeManagerAction((TeamWorkFlowArtifact) awa));
toolBarMgr.add(new ShowChangeReportAction((TeamWorkFlowArtifact) awa));
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
index d0ab02eafd8..1bf417c24bc 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
@@ -39,7 +39,6 @@ import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogItem;
import org.eclipse.osee.ats.api.workflow.log.LogType;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
import org.eclipse.osee.ats.core.client.review.AtsReviewCache;
import org.eclipse.osee.ats.core.client.review.defect.ReviewDefectManager;
@@ -763,10 +762,11 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
if (artifact.isOfType(AtsArtifactTypes.TeamWorkflow)) {
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) artifact;
try {
- Branch workingBranch = (Branch) AtsBranchManagerCore.getWorkingBranch(teamArt);
+ Branch workingBranch = (Branch) AtsClientService.get().getBranchService().getWorkingBranch(teamArt);
if (workingBranch != null && workingBranch.getBranchType() != BranchType.BASELINE) {
if (workingBranch.getBranchState() != BranchState.COMMITTED) {
- Collection<IOseeBranch> branchesCommittedTo = AtsBranchManagerCore.getBranchesCommittedTo(teamArt);
+ Collection<IOseeBranch> branchesCommittedTo =
+ AtsClientService.get().getBranchService().getBranchesCommittedTo(teamArt);
if (branchesCommittedTo.size() > 0) {
results.log(
artifact,
@@ -775,7 +775,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
}
} else if (workingBranch.getBranchState() == BranchState.COMMITTED && !workingBranch.getArchiveState().isArchived()) {
Collection<IOseeBranch> branchesLeftToCommit =
- AtsBranchManagerCore.getBranchesLeftToCommit(teamArt);
+ AtsClientService.get().getBranchService().getBranchesLeftToCommit(teamArt);
if (branchesLeftToCommit.size() == 0) {
results.log(
artifact,
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsOseeCmService.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsOseeCmService.java
index 74d72353b84..e83e96c5033 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsOseeCmService.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/AtsOseeCmService.java
@@ -22,7 +22,6 @@ import org.eclipse.osee.ats.actions.wizard.NewActionJob;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.team.ChangeType;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.search.AtsArtifactQuery;
import org.eclipse.osee.ats.core.client.task.AbstractTaskableArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
@@ -168,7 +167,9 @@ public class AtsOseeCmService implements IOseeCmService {
boolean toReturn = false;
if (art instanceof TeamWorkFlowArtifact) {
try {
- toReturn = AtsBranchManagerCore.isBranchesAllCommittedExcept((TeamWorkFlowArtifact) art, branch);
+ toReturn =
+ AtsClientService.get().getBranchService().isBranchesAllCommittedExcept((TeamWorkFlowArtifact) art,
+ branch);
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex.toString(), ex);
toReturn = false;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/report/CreateActionArtifactChangeReportJob.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/report/CreateActionArtifactChangeReportJob.java
index 5aa50a67be8..03435b68482 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/report/CreateActionArtifactChangeReportJob.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/report/CreateActionArtifactChangeReportJob.java
@@ -22,7 +22,6 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osee.ats.api.commit.ICommitConfigItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
@@ -118,7 +117,8 @@ public class CreateActionArtifactChangeReportJob extends Job {
teamArt.getTeamDefinition().getName());
monitor.subTask(result);
rd.log("\nRPCR " + rcprId);
- for (ICommitConfigItem commitConfigArt : AtsBranchManagerCore.getConfigArtifactsConfiguredToCommitTo(teamArt)) {
+ for (ICommitConfigItem commitConfigArt : AtsClientService.get().getBranchService().getConfigArtifactsConfiguredToCommitTo(
+ teamArt)) {
processTeam(teamArt, AtsClientService.get().getBranchService().getBranchShortName(commitConfigArt),
attributeType, commitConfigArt, rd);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateWorkingBranchFromTxBlam.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateWorkingBranchFromTxBlam.java
index 2e61c08f354..1450df0d740 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateWorkingBranchFromTxBlam.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/CreateWorkingBranchFromTxBlam.java
@@ -15,10 +15,11 @@ import java.util.Arrays;
import java.util.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
+import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil;
import org.eclipse.osee.ats.core.client.search.AtsArtifactQuery;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -57,11 +58,11 @@ public class CreateWorkingBranchFromTxBlam extends AbstractBlam {
Artifact art = AtsArtifactQuery.getArtifactFromId(idNumber);
if (art.isOfType(AtsArtifactTypes.TeamWorkflow)) {
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) art;
- if (AtsBranchManagerCore.isCommittedBranchExists(teamArt)) {
+ if (AtsClientService.get().getBranchService().isCommittedBranchExists(teamArt)) {
AWorkbench.popup("Committed branch already exists. Can not create another working branch once changes have been committed.");
return;
}
- AtsBranchManagerCore.createWorkingBranch(teamArt, parentTransactionId, true);
+ AtsBranchUtil.createWorkingBranch(teamArt, parentTransactionId, true);
} else {
AWorkbench.popup("ERROR", "Must enter a Team Workflow ID");
return;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java
index 7ae449f9d53..836386ba637 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ExportChangeReportOperation.java
@@ -25,9 +25,9 @@ import java.util.Set;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.core.model.TransactionRecord;
@@ -141,10 +141,10 @@ public final class ExportChangeReportOperation extends AbstractOperation {
List<Change> changes = new ArrayList<Change>();
IOperation operation = null;
- if (AtsBranchManagerCore.isCommittedBranchExists(teamArt)) {
+ if (AtsClientService.get().getBranchService().isCommittedBranchExists(teamArt)) {
operation = ChangeManager.comparedToPreviousTx(pickTransaction(workflow), changes);
} else {
- IOseeBranch workingBranch = AtsBranchManagerCore.getWorkingBranch(teamArt);
+ IOseeBranch workingBranch = AtsClientService.get().getBranchService().getWorkingBranch(teamArt);
if (workingBranch != null && !BranchManager.getBranchType(workingBranch).isBaselineBranch()) {
operation = ChangeManager.comparedToParent(workingBranch, changes);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskToChangedArtifactReferenceAttributeAdapter.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskToChangedArtifactReferenceAttributeAdapter.java
index 40874a9648a..204ce59584c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskToChangedArtifactReferenceAttributeAdapter.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/AtsTaskToChangedArtifactReferenceAttributeAdapter.java
@@ -14,9 +14,9 @@ import java.util.Arrays;
import java.util.Collection;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
@@ -59,14 +59,15 @@ public class AtsTaskToChangedArtifactReferenceAttributeAdapter implements Attrib
if (derivedArt != null && derivedArt instanceof TeamWorkFlowArtifact) {
TeamWorkFlowArtifact derivedTeamWf = (TeamWorkFlowArtifact) derivedArt;
// First, attempt to get from Working Branch if still exists
- IOseeBranch workingBranch = AtsBranchManagerCore.getWorkingBranch(derivedTeamWf);
+ IOseeBranch workingBranch = AtsClientService.get().getBranchService().getWorkingBranch(derivedTeamWf);
if (workingBranch != null) {
retArt = ArtifactQuery.getArtifactFromId(guid, workingBranch, DeletionFlag.EXCLUDE_DELETED);
} else {
// Else get from first commit transaction
// NOTE: Each workflow has it's own commit in parallel dev
TransactionRecord earliestTransactionId =
- AtsBranchManagerCore.getEarliestTransactionId(derivedTeamWf);
+ (TransactionRecord) AtsClientService.get().getBranchService().getEarliestTransactionId(
+ derivedTeamWf);
if (earliestTransactionId != null) {
retArt =
ArtifactQuery.getHistoricalArtifactFromId(guid, earliestTransactionId,
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java
index 38948948e9f..00343f114fe 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchCommitOperation.java
@@ -16,7 +16,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.api.workdef.StateEventType;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
+import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil;
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;
@@ -61,7 +61,7 @@ public class AtsBranchCommitOperation extends AbstractOperation {
protected void doWork(IProgressMonitor monitor) throws Exception {
Branch workflowWorkingBranch = teamArt.getWorkingBranch();
try {
- AtsBranchManagerCore.branchesInCommit.add(workflowWorkingBranch);
+ AtsClientService.get().getBranchService().getBranchesInCommit().add(workflowWorkingBranch);
if (workflowWorkingBranch == null) {
throw new OseeStateException("Commit Branch Failed: Can not locate branch for workflow [%s]",
teamArt.getAtsId());
@@ -119,7 +119,7 @@ public class AtsBranchCommitOperation extends AbstractOperation {
// Create reviews as necessary
AtsChangeSet changes = new AtsChangeSet("Create Reviews upon Commit");
boolean added =
- AtsBranchManagerCore.createNecessaryBranchEventReviews(StateEventType.CommitBranch, teamArt, new Date(),
+ AtsBranchUtil.createNecessaryBranchEventReviews(StateEventType.CommitBranch, teamArt, new Date(),
AtsCoreUsers.SYSTEM_USER, changes);
if (added) {
changes.execute();
@@ -127,7 +127,7 @@ public class AtsBranchCommitOperation extends AbstractOperation {
}
} finally {
if (workflowWorkingBranch != null) {
- AtsBranchManagerCore.branchesInCommit.remove(workflowWorkingBranch);
+ AtsClientService.get().getBranchService().getBranchesInCommit().remove(workflowWorkingBranch);
}
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java
index 2948cdf2557..d0e3af840de 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java
@@ -19,11 +19,13 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.osee.ats.api.commit.ICommitConfigItem;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
+import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.widgets.dialog.SingleItemSelecitonDialog;
import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.ITransaction;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.MergeBranch;
import org.eclipse.osee.framework.core.model.TransactionRecord;
@@ -33,6 +35,7 @@ import org.eclipse.osee.framework.core.util.Result;
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.Collections;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
@@ -110,11 +113,15 @@ public final class AtsBranchManager {
}
public static void showMergeManager(TeamWorkFlowArtifact teamArt, IOseeBranch destinationBranch) throws OseeCoreException {
- if (AtsBranchManagerCore.isWorkingBranchInWork(teamArt)) {
- MergeView.openView((Branch) AtsBranchManagerCore.getWorkingBranch(teamArt), (Branch) destinationBranch,
- BranchManager.getBaseTransaction(AtsBranchManagerCore.getWorkingBranch(teamArt)));
- } else if (AtsBranchManagerCore.isCommittedBranchExists(teamArt)) {
- for (TransactionRecord transactionId : AtsBranchManagerCore.getTransactionIds(teamArt, true)) {
+ if (AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt)) {
+ MergeView.openView((Branch) AtsClientService.get().getBranchService().getWorkingBranch(teamArt),
+ (Branch) destinationBranch,
+ BranchManager.getBaseTransaction(AtsClientService.get().getBranchService().getWorkingBranch(teamArt)));
+ } else if (AtsClientService.get().getBranchService().isCommittedBranchExists(teamArt)) {
+ Collection<ITransaction> transactions =
+ AtsClientService.get().getBranchService().getTransactionIds(teamArt, true);
+ Collection<TransactionRecord> trs = Collections.castAll(transactions);
+ for (TransactionRecord transactionId : trs) {
if (transactionId.getBranchId() == destinationBranch.getUuid()) {
MergeView.openView(transactionId);
}
@@ -127,11 +134,11 @@ public final class AtsBranchManager {
*/
public static void showWorkingBranch(TeamWorkFlowArtifact teamArt) {
try {
- if (!AtsBranchManagerCore.isWorkingBranchInWork(teamArt)) {
+ if (!AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt)) {
AWorkbench.popup("ERROR", "No Current Working Branch");
return;
}
- BranchView.revealBranch((Branch) AtsBranchManagerCore.getWorkingBranch(teamArt));
+ BranchView.revealBranch((Branch) AtsClientService.get().getBranchService().getWorkingBranch(teamArt));
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
}
@@ -143,7 +150,7 @@ public final class AtsBranchManager {
public static void deleteWorkingBranch(TeamWorkFlowArtifact teamArt, boolean promptUser) {
boolean isExecutionAllowed = !promptUser;
try {
- IOseeBranch branch = AtsBranchManagerCore.getWorkingBranch(teamArt);
+ IOseeBranch branch = AtsClientService.get().getBranchService().getWorkingBranch(teamArt);
if (promptUser) {
StringBuilder message = new StringBuilder();
if (BranchManager.hasChanges(branch)) {
@@ -161,7 +168,7 @@ public final class AtsBranchManager {
Exception exception = null;
Result result = null;
try {
- result = AtsBranchManagerCore.deleteWorkingBranch(teamArt, true);
+ result = AtsBranchUtil.deleteWorkingBranch(teamArt, true);
} catch (Exception ex) {
exception = ex;
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, "Problem deleting branch.", ex);
@@ -183,7 +190,11 @@ public final class AtsBranchManager {
*/
public static TransactionRecord getTransactionIdOrPopupChoose(TeamWorkFlowArtifact teamArt, String title, boolean showMergeManager) throws OseeCoreException {
Collection<TransactionRecord> transactionIds = new HashSet<TransactionRecord>();
- for (TransactionRecord id : AtsBranchManagerCore.getTransactionIds(teamArt, showMergeManager)) {
+ Collection<ITransaction> transactions =
+ AtsClientService.get().getBranchService().getTransactionIds(teamArt, showMergeManager);
+ Collection<TransactionRecord> trs = Collections.castAll(transactions);
+
+ for (TransactionRecord id : trs) {
// ignore working branches that have been committed
if (id.getFullBranch().getBranchType().isWorkingBranch() && id.getFullBranch().getBranchState().isCommitted()) {
continue;
@@ -229,9 +240,9 @@ public final class AtsBranchManager {
*/
public static void showChangeReport(TeamWorkFlowArtifact teamArt) {
try {
- if (AtsBranchManagerCore.isWorkingBranchInWork(teamArt)) {
- ChangeUiUtil.open(AtsBranchManagerCore.getWorkingBranch(teamArt));
- } else if (AtsBranchManagerCore.isCommittedBranchExists(teamArt)) {
+ if (AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt)) {
+ ChangeUiUtil.open(AtsClientService.get().getBranchService().getWorkingBranch(teamArt));
+ } else if (AtsClientService.get().getBranchService().isCommittedBranchExists(teamArt)) {
TransactionRecord transactionId = getTransactionIdOrPopupChoose(teamArt, "Show Change Report", false);
if (transactionId == null) {
return;
@@ -250,7 +261,10 @@ public final class AtsBranchManager {
*/
public static void showChangeReportForBranch(TeamWorkFlowArtifact teamArt, IOseeBranch destinationBranch) {
try {
- for (TransactionRecord transactionId : AtsBranchManagerCore.getTransactionIds(teamArt, false)) {
+ Collection<ITransaction> transactions =
+ AtsClientService.get().getBranchService().getTransactionIds(teamArt, false);
+ Collection<TransactionRecord> trs = Collections.castAll(transactions);
+ for (TransactionRecord transactionId : trs) {
if (transactionId.getBranch() == destinationBranch) {
ChangeUiUtil.open(transactionId);
}
@@ -266,7 +280,7 @@ public final class AtsBranchManager {
* used for developmental testing or automation
*/
public static IOperation commitWorkingBranch(final TeamWorkFlowArtifact teamArt, final boolean commitPopup, final boolean overrideStateValidation, IOseeBranch destinationBranch, boolean archiveWorkingBranch) throws OseeCoreException {
- if (AtsBranchManagerCore.isBranchInCommit(teamArt)) {
+ if (AtsClientService.get().getBranchService().isBranchInCommit(teamArt)) {
throw new OseeCoreException("Branch is currently being committed.");
}
return new AtsBranchCommitOperation(teamArt, commitPopup, overrideStateValidation, destinationBranch,
@@ -289,16 +303,19 @@ public final class AtsBranchManager {
Collection<Change> changes = new ArrayList<Change>();
IOperation operation = null;
- if (AtsBranchManagerCore.isWorkingBranchInWork(teamArt)) {
- operation = ChangeManager.comparedToParent(AtsBranchManagerCore.getWorkingBranch(teamArt), changes);
+ if (AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt)) {
+ operation =
+ ChangeManager.comparedToParent(AtsClientService.get().getBranchService().getWorkingBranch(teamArt), changes);
Operations.executeWorkAndCheckStatus(operation);
} else {
- if (AtsBranchManagerCore.isCommittedBranchExists(teamArt)) {
+ if (AtsClientService.get().getBranchService().isCommittedBranchExists(teamArt)) {
TransactionRecord transactionId = null;
if (commitConfigArt == null) {
- transactionId = AtsBranchManagerCore.getEarliestTransactionId(teamArt);
+ transactionId =
+ (TransactionRecord) AtsClientService.get().getBranchService().getEarliestTransactionId(teamArt);
} else {
- Collection<TransactionRecord> transIds = AtsBranchManagerCore.getTransactionIds(teamArt, false);
+ Collection<TransactionRecord> transIds =
+ Collections.castAll(AtsClientService.get().getBranchService().getTransactionIds(teamArt, false));
if (transIds.size() == 1) {
transactionId = transIds.iterator().next();
} else {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
index 44ffbd03b3b..916225a0c9f 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranch.java
@@ -18,7 +18,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
+import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
import org.eclipse.osee.ats.internal.Activator;
@@ -154,13 +154,14 @@ public class XWorkingBranch extends GenericXWidget implements IArtifactWidget, I
}
refreshEnablement();
// Create working branch
- Result result = AtsBranchManagerCore.createWorkingBranch_Validate(teamArt);
+ Result result = AtsBranchUtil.createWorkingBranch_Validate(teamArt);
if (result.isFalse()) {
AWorkbench.popup(result);
return;
}
try {
- IOseeBranch parentBranch = AtsBranchManagerCore.getConfiguredBranchForWorkflow(teamArt);
+ IOseeBranch parentBranch =
+ AtsClientService.get().getBranchService().getConfiguredBranchForWorkflow(teamArt);
// Retrieve parent branch to create working branch from
if (!MessageDialog.openConfirm(
Displays.getActiveShell(),
@@ -170,7 +171,7 @@ public class XWorkingBranch extends GenericXWidget implements IArtifactWidget, I
refreshEnablement();
return;
}
- AtsBranchManagerCore.createWorkingBranch_Create(teamArt);
+ AtsBranchUtil.createWorkingBranch_Create(teamArt);
Thread.sleep(2000);
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
@@ -269,7 +270,8 @@ public class XWorkingBranch extends GenericXWidget implements IArtifactWidget, I
private void markWorkingBranchAsFavorite() {
try {
User user =
- AtsClientService.get().getUserServiceClient().getOseeUser(AtsClientService.get().getUserService().getCurrentUser());
+ AtsClientService.get().getUserServiceClient().getOseeUser(
+ AtsClientService.get().getUserService().getCurrentUser());
if (user.isSystemUser()) {
AWorkbench.popup("Can't set preference as System User = " + user);
return;
@@ -373,7 +375,7 @@ public class XWorkingBranch extends GenericXWidget implements IArtifactWidget, I
}
public static boolean isPurgeBranchButtonEnabled(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
- return AtsBranchManagerCore.isWorkingBranchInWork(teamArt);
+ return AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt);
}
@Override
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchButtonCreate.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchButtonCreate.java
index d1cbbee7212..f9c5d55e0a2 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchButtonCreate.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchButtonCreate.java
@@ -11,8 +11,9 @@
package org.eclipse.osee.ats.util.widgets;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
+import org.eclipse.osee.ats.core.client.branch.AtsBranchUtil;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -43,13 +44,14 @@ public class XWorkingBranchButtonCreate extends XWorkingBranchButtonAbstract {
disableAll = true;
refreshEnablement(button);
// Create working branch
- Result result = AtsBranchManagerCore.createWorkingBranch_Validate(getTeamArt());
+ Result result = AtsBranchUtil.createWorkingBranch_Validate(getTeamArt());
if (result.isFalse()) {
AWorkbench.popup(result);
return;
}
try {
- IOseeBranch parentBranch = AtsBranchManagerCore.getConfiguredBranchForWorkflow(getTeamArt());
+ IOseeBranch parentBranch =
+ AtsClientService.get().getBranchService().getConfiguredBranchForWorkflow(getTeamArt());
// Retrieve parent branch to create working branch from
if (!MessageDialog.openConfirm(
Displays.getActiveShell(),
@@ -59,7 +61,7 @@ public class XWorkingBranchButtonCreate extends XWorkingBranchButtonAbstract {
refreshEnablement(button);
return;
}
- AtsBranchManagerCore.createWorkingBranch_Create(getTeamArt(), true);
+ AtsBranchUtil.createWorkingBranch_Create(getTeamArt(), true);
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchDeleteMerge.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchDeleteMerge.java
index fa741c75dc6..9df5e5ec53d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchDeleteMerge.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchDeleteMerge.java
@@ -16,8 +16,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.widgets.dialog.MultipleBranchSelectionDialog;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.model.Branch;
@@ -52,7 +52,7 @@ public class XWorkingBranchDeleteMerge extends XWorkingBranchButtonAbstract {
if (isWorkingBranchCommitWithMergeInProgress()) {
List<Branch> selectedBranches = new ArrayList<Branch>();
Collection<IOseeBranch> branchesAlreadyCommitted =
- AtsBranchManagerCore.getBranchesCommittedTo(getTeamArt());
+ AtsClientService.get().getBranchService().getBranchesCommittedTo(getTeamArt());
List<MergeBranch> mergeBranches = BranchManager.getMergeBranches(workingBranch);
Set<Branch> destinationMinusAlreadyCommitted = new HashSet<Branch>();
@@ -97,7 +97,8 @@ public class XWorkingBranchDeleteMerge extends XWorkingBranchButtonAbstract {
try {
if (isWorkingBranchCommitWithMergeInProgress()) {
List<MergeBranch> mergeBranches = BranchManager.getMergeBranches(getWorkingBranch());
- Collection<IOseeBranch> committedBranches = AtsBranchManagerCore.getBranchesCommittedTo(getTeamArt());
+ Collection<IOseeBranch> committedBranches =
+ AtsClientService.get().getBranchService().getBranchesCommittedTo(getTeamArt());
List<MergeBranch> remainingMergeBranches = new ArrayList<MergeBranch>();
for (MergeBranch mergeBranch : mergeBranches) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchEnablement.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchEnablement.java
index 18c191c2499..c224ad2abd4 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchEnablement.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchEnablement.java
@@ -12,9 +12,9 @@ package org.eclipse.osee.ats.util.widgets;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.widgets.XWorkingBranch.BranchStatus;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.model.Branch;
@@ -140,11 +140,14 @@ public class XWorkingBranchEnablement {
public BranchEnablementData call() throws Exception {
BranchEnablementData enablementData = new BranchEnablementData(teamArt);
if (teamArt != null) {
- Branch workingBranch = (Branch) AtsBranchManagerCore.getWorkingBranch(teamArt, true);
+ Branch workingBranch =
+ (Branch) AtsClientService.get().getBranchService().getWorkingBranch(teamArt, true);
enablementData.setWorkingBranch(workingBranch);
- enablementData.setWorkingBranchInWork(AtsBranchManagerCore.isWorkingBranchInWork(teamArt));
- enablementData.setCommittedBranchExists(AtsBranchManagerCore.isCommittedBranchExists(teamArt));
+ enablementData.setWorkingBranchInWork(AtsClientService.get().getBranchService().isWorkingBranchInWork(
+ teamArt));
+ enablementData.setCommittedBranchExists(AtsClientService.get().getBranchService().isCommittedBranchExists(
+ teamArt));
enablementData.setDisableAll(enablementData.isWorkingBranchCommitInProgress());
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchWidgetAbstract.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchWidgetAbstract.java
index 1c34fd1224b..0cdf9abaae3 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchWidgetAbstract.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWorkingBranchWidgetAbstract.java
@@ -15,10 +15,10 @@ import java.util.logging.Level;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.widgets.XWorkingBranch.BranchStatus;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.model.Branch;
@@ -134,19 +134,19 @@ public abstract class XWorkingBranchWidgetAbstract extends GenericXWidget implem
}
private void updateBranchState() throws OseeCoreException {
- workingBranch = (Branch) AtsBranchManagerCore.getWorkingBranch(teamArt, true);
+ workingBranch = (Branch) AtsClientService.get().getBranchService().getWorkingBranch(teamArt, true);
workingBranchCreationInProgress =
teamArt.isWorkingBranchCreationInProgress() || (workingBranch != null && workingBranch.getBranchState() == BranchState.CREATION_IN_PROGRESS);
workingBranchCommitInProgress =
teamArt.isWorkingBranchCommitInProgress() || workingBranch != null && workingBranch.getBranchState() == BranchState.COMMIT_IN_PROGRESS;
- workingBranchInWork = AtsBranchManagerCore.isWorkingBranchInWork(teamArt);
+ workingBranchInWork = AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt);
if (workingBranch == null) {
workingBranchCommitInProgress = false;
} else {
workingBranchCommitWithMergeInProgress =
BranchManager.hasMergeBranches(workingBranch) && !workingBranch.getBranchState().isRebaselineInProgress();
}
- committedBranchExists = AtsBranchManagerCore.isCommittedBranchExists(teamArt);
+ committedBranchExists = AtsClientService.get().getBranchService().isCommittedBranchExists(teamArt);
disableAll = workingBranchCommitInProgress;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/CommitXManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/CommitXManager.java
index b29f1728207..1ab5d4008b3 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/CommitXManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/CommitXManager.java
@@ -18,7 +18,6 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.nebula.widgets.xviewer.XViewer;
import org.eclipse.osee.ats.api.commit.CommitStatus;
import org.eclipse.osee.ats.api.commit.ICommitConfigItem;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsBranchManager;
@@ -101,7 +100,7 @@ public class CommitXManager extends XViewer {
}
CommitStatus commitStatus =
- AtsBranchManagerCore.getCommitStatus(xCommitManager.getTeamArt(), branch, configArt);
+ AtsClientService.get().getBranchService().getCommitStatus(xCommitManager.getTeamArt(), branch, configArt);
if (commitStatus == CommitStatus.Rebaseline_In_Progress) {
RebaselineInProgressHandler.handleRebaselineInProgress(xCommitManager.getTeamArt().getWorkingBranch());
} else if (commitStatus == CommitStatus.Working_Branch_Not_Created) {
@@ -117,8 +116,13 @@ public class CommitXManager extends XViewer {
"Talk to project lead as to why commit disabled for version [" + displayName + "]");
} else if (commitStatus == CommitStatus.Commit_Needed || commitStatus == CommitStatus.Merge_In_Progress) {
IOperation operation =
- AtsBranchManager.commitWorkingBranch(xCommitManager.getTeamArt(), true, false, branch,
- AtsBranchManagerCore.isBranchesAllCommittedExcept(xCommitManager.getTeamArt(), branch));
+ AtsBranchManager.commitWorkingBranch(
+ xCommitManager.getTeamArt(),
+ true,
+ false,
+ branch,
+ AtsClientService.get().getBranchService().isBranchesAllCommittedExcept(xCommitManager.getTeamArt(),
+ branch));
Operations.executeAsJob(operation, true);
} else if (commitStatus == CommitStatus.Committed) {
AtsBranchManager.showChangeReportForBranch(xCommitManager.getTeamArt(), branch);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitLabelProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitLabelProvider.java
index 512350510db..9f3eec88eec 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitLabelProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitLabelProvider.java
@@ -18,7 +18,6 @@ import org.eclipse.osee.ats.api.commit.CommitStatus;
import org.eclipse.osee.ats.api.commit.ICommitConfigItem;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.version.IAtsVersion;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.core.data.IOseeBranch;
@@ -67,7 +66,8 @@ public class XCommitLabelProvider extends XViewerLabelProvider {
if (xCol.equals(CommitXManagerFactory.Status_Col)) {
try {
CommitStatus commitStatus =
- AtsBranchManagerCore.getCommitStatus(commitXManager.getXCommitViewer().getTeamArt(), branch);
+ AtsClientService.get().getBranchService().getCommitStatus(
+ commitXManager.getXCommitViewer().getTeamArt(), branch);
if (commitStatus == CommitStatus.Branch_Not_Configured || commitStatus == CommitStatus.Branch_Commit_Disabled ||
//
commitStatus == CommitStatus.Commit_Needed || commitStatus == CommitStatus.Working_Branch_Not_Created) {
@@ -88,7 +88,8 @@ public class XCommitLabelProvider extends XViewerLabelProvider {
} else if (xCol.equals(CommitXManagerFactory.Merge_Col)) {
try {
CommitStatus commitStatus =
- AtsBranchManagerCore.getCommitStatus(commitXManager.getXCommitViewer().getTeamArt(), branch);
+ AtsClientService.get().getBranchService().getCommitStatus(
+ commitXManager.getXCommitViewer().getTeamArt(), branch);
if (commitStatus == CommitStatus.Merge_In_Progress || commitStatus == CommitStatus.Committed_With_Merge) {
return ImageManager.getImage(FrameworkImage.OUTGOING_MERGED);
}
@@ -118,7 +119,8 @@ public class XCommitLabelProvider extends XViewerLabelProvider {
}
if (xCol.equals(CommitXManagerFactory.Status_Col)) {
- return AtsBranchManagerCore.getCommitStatus(commitXManager.getXCommitViewer().getTeamArt(), branch).getDisplayName();
+ return AtsClientService.get().getBranchService().getCommitStatus(
+ commitXManager.getXCommitViewer().getTeamArt(), branch).getDisplayName();
} else if (xCol.equals(CommitXManagerFactory.Merge_Col)) {
return "";
} else if (xCol.equals(CommitXManagerFactory.Version_Col)) {
@@ -157,7 +159,8 @@ public class XCommitLabelProvider extends XViewerLabelProvider {
private String handleCommitDateColumn(IOseeBranch branch) throws OseeCoreException {
TransactionRecord transactionRecord =
- AtsBranchManagerCore.getCommitTransactionRecord(commitXManager.getXCommitViewer().getTeamArt(), branch);
+ (TransactionRecord) AtsClientService.get().getBranchService().getCommitTransactionRecord(
+ commitXManager.getXCommitViewer().getTeamArt(), branch);
if (transactionRecord != null) {
new DateUtil();
return DateUtil.getMMDDYYHHMM(transactionRecord.getTimeStamp());
@@ -167,7 +170,8 @@ public class XCommitLabelProvider extends XViewerLabelProvider {
private String handleCommitCommentColumn(IOseeBranch branch) throws OseeCoreException {
TransactionRecord transactionRecord =
- AtsBranchManagerCore.getCommitTransactionRecord(commitXManager.getXCommitViewer().getTeamArt(), branch);
+ (TransactionRecord) AtsClientService.get().getBranchService().getCommitTransactionRecord(
+ commitXManager.getXCommitViewer().getTeamArt(), branch);
if (transactionRecord != null) {
return transactionRecord.getComment();
}
@@ -198,7 +202,8 @@ public class XCommitLabelProvider extends XViewerLabelProvider {
private String handleActionColumn(IOseeBranch branch) throws OseeCoreException {
CommitStatus commitStatus =
- AtsBranchManagerCore.getCommitStatus(commitXManager.getXCommitViewer().getTeamArt(), branch);
+ AtsClientService.get().getBranchService().getCommitStatus(commitXManager.getXCommitViewer().getTeamArt(),
+ branch);
if (commitStatus == CommitStatus.Rebaseline_In_Progress) {
return "Finish Update";
} else if (commitStatus == CommitStatus.Branch_Not_Configured) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
index ae07fbecd9e..a92434a7e55 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/commit/XCommitManager.java
@@ -24,12 +24,12 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
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.AtsUtilClient;
import org.eclipse.osee.ats.editor.SMAEditor;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsBranchManager;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.framework.core.data.IOseeBranch;
@@ -132,7 +132,8 @@ public class XCommitManager extends GenericXWidget implements IArtifactWidget, I
try {
if (teamArt.isWorkingBranchCreationInProgress()) {
labelWidget.setText(getLabel() + ": Branch Creation in Progress");
- } else if (!AtsBranchManagerCore.isWorkingBranchInWork(teamArt) && !AtsBranchManagerCore.isCommittedBranchExists(teamArt)) {
+ } else if (!AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt) && !AtsClientService.get().getBranchService().isCommittedBranchExists(
+ teamArt)) {
labelWidget.setText(getLabel() + ": No Working Branch or Committed changes available.");
} else {
@@ -158,7 +159,8 @@ public class XCommitManager extends GenericXWidget implements IArtifactWidget, I
try {
// commit all branches in order
Map<Long, Branch> branchUuidToBranchMap = new HashMap<Long, Branch>();
- for (IOseeBranch destinationBranch : AtsBranchManagerCore.getBranchesLeftToCommit(teamArt)) {
+ for (IOseeBranch destinationBranch : AtsClientService.get().getBranchService().getBranchesLeftToCommit(
+ teamArt)) {
branchUuidToBranchMap.put(destinationBranch.getUuid(), (Branch) destinationBranch);
}
List<Long> branchUuids = new ArrayList<Long>();
@@ -259,7 +261,7 @@ public class XCommitManager extends GenericXWidget implements IArtifactWidget, I
try {
if (xCommitManager != null && teamArt != null && xCommitManager.getContentProvider() != null) {
Collection<Object> commitMgrInputObjs =
- AtsBranchManagerCore.getCommitTransactionsAndConfigItemsForTeamWf(teamArt);
+ AtsClientService.get().getBranchService().getCommitTransactionsAndConfigItemsForTeamWf(teamArt);
xCommitManager.setInput(commitMgrInputObjs);
xCommitManager.refresh();
refresh();
@@ -334,7 +336,8 @@ public class XCommitManager extends GenericXWidget implements IArtifactWidget, I
int backgroundColor = SWT.COLOR_BLACK;
String infoStr = "Double-click item to perform Action";
if (xCommitManager != null && xCommitManager.getXCommitViewer() != null && xCommitManager.getXCommitViewer().getTeamArt() != null && xCommitManager.getXCommitViewer().getTeamArt() != null) {
- if (!AtsBranchManagerCore.isAllObjectsToCommitToConfigured(xCommitManager.getXCommitViewer().getTeamArt())) {
+ if (!AtsClientService.get().getBranchService().isAllObjectsToCommitToConfigured(
+ xCommitManager.getXCommitViewer().getTeamArt())) {
infoStr = "All branches must be configured - Double-click item to perform Action";
backgroundColor = SWT.COLOR_RED;
returnStatus =
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java
index c2421746d4a..01102f6a272 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleIdSearchOperation.java
@@ -24,11 +24,11 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.artifact.SmaWorkflowLabelProvider;
import org.eclipse.osee.ats.core.client.action.ActionManager;
-import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.search.AtsArtifactQuery;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.editor.SMAEditor;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsBranchManager;
import org.eclipse.osee.ats.util.AtsEditor;
import org.eclipse.osee.ats.util.AtsUtil;
@@ -114,14 +114,16 @@ public class MultipleIdSearchOperation extends AbstractOperation implements IWor
for (Artifact artifact : artifacts) {
if (artifact.isOfType(AtsArtifactTypes.Action)) {
for (TeamWorkFlowArtifact team : ActionManager.getTeams(artifact)) {
- if (AtsBranchManagerCore.isCommittedBranchExists(team) || AtsBranchManagerCore.isWorkingBranchInWork(team)) {
+ if (AtsClientService.get().getBranchService().isCommittedBranchExists(team) || AtsClientService.get().getBranchService().isWorkingBranchInWork(
+ team)) {
addedArts.add(team);
}
}
}
if (artifact.isOfType(AtsArtifactTypes.TeamWorkflow)) {
TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) artifact;
- if (AtsBranchManagerCore.isCommittedBranchExists(teamArt) || AtsBranchManagerCore.isWorkingBranchInWork(teamArt)) {
+ if (AtsClientService.get().getBranchService().isCommittedBranchExists(teamArt) || AtsClientService.get().getBranchService().isWorkingBranchInWork(
+ teamArt)) {
addedArts.add(artifact);
}
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java
index a9c9a3b3eba..bd3abd04649 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionManager.java
@@ -194,8 +194,8 @@ public final class TransactionManager {
Date transactionTime = GlobalTime.GreenwichMeanTimestamp();
TransactionRecordFactory factory = ServiceUtil.getTransactionFactory();
TransactionRecord transactionId =
- factory.createOrUpdate(getTransactionCache(), transactionNumber, branch.getUuid(), comment,
- transactionTime, authorArtId, 0, txType, getBranchCache());
+ factory.createOrUpdate(getTransactionCache(), transactionNumber, branch.getUuid(), comment, transactionTime,
+ authorArtId, 0, txType, getBranchCache());
return transactionId;
}
@@ -214,7 +214,8 @@ public final class TransactionManager {
IOseeStatement chStmt = ConnectionHandler.getStatement();
try {
- chStmt.runPreparedQuery(SELECT_BRANCH_TRANSACTION_BY_DATE, branchUuid, new Timestamp(maxDateExclusive.getTime()));
+ chStmt.runPreparedQuery(SELECT_BRANCH_TRANSACTION_BY_DATE, branchUuid,
+ new Timestamp(maxDateExclusive.getTime()));
if (chStmt.next()) {
int transactionId = chStmt.getInt("transaction_id");
if (chStmt.wasNull()) {

Back to the top