Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-05-16 17:13:43 -0400
committerdonald.g.dunne2017-05-17 16:34:25 -0400
commitf72a9cc0a3ee0eae7350b8f42677bbc2984cbb59 (patch)
tree686113c879927fcf13852105029ecfa8f924a6d9
parent75ad6385ba9e36058569f4484a3541f413fb0210 (diff)
downloadorg.eclipse.osee-f72a9cc0a3ee0eae7350b8f42677bbc2984cbb59.tar.gz
org.eclipse.osee-f72a9cc0a3ee0eae7350b8f42677bbc2984cbb59.tar.xz
org.eclipse.osee-f72a9cc0a3ee0eae7350b8f42677bbc2984cbb59.zip
feature[ats_ATS371066]: HLR - Changes in support of action
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/ITeamWorkflowProvider.java8
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ActionFactory.java10
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AtsWorkItemServiceImpl.java5
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java14
5 files changed, 29 insertions, 10 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/ITeamWorkflowProvider.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/ITeamWorkflowProvider.java
index 781c5a127b..4a6f6dec73 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/ITeamWorkflowProvider.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/ITeamWorkflowProvider.java
@@ -16,9 +16,7 @@ import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
/**
* @author Donald G. Dunne
*/
-public
-
-interface ITeamWorkflowProvider {
+public interface ITeamWorkflowProvider {
public default String getWorkflowDefinitionId(IAtsWorkItem workItem) {
return null;
@@ -47,4 +45,8 @@ interface ITeamWorkflowProvider {
}
public boolean isResponsibleFor(IAtsWorkItem workItem);
+
+ public default String getOverrideWorkflowDefinitionId(IAtsTeamWorkflow teamWf) {
+ return null;
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java
index d1bd79110b..0ad29d9274 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java
@@ -55,4 +55,6 @@ public interface IAtsWorkItemService {
String getCombinedPcrId(IAtsWorkItem workItem) throws OseeCoreException;
IAtsWorkItemNotes getNotes(IAtsWorkItem workItem);
+
+ ITeamWorkflowProvidersLazy getTeamWorkflowProviders();
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ActionFactory.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ActionFactory.java
index 119e2e5f50..7d1b1a50d1 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ActionFactory.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ActionFactory.java
@@ -30,6 +30,7 @@ import org.eclipse.osee.ats.api.team.ChangeType;
import org.eclipse.osee.ats.api.team.CreateTeamOption;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.team.IAtsWorkItemFactory;
+import org.eclipse.osee.ats.api.team.ITeamWorkflowProvider;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.util.IAtsUtilService;
@@ -219,6 +220,15 @@ public class ActionFactory implements IAtsActionFactory {
changes.setSoleAttributeValue(teamWf, AtsAttributeTypes.WorkflowDefinition, overrideWorkDefId);
}
}
+ // else if work def is specified by provider, set as attribute
+ else {
+ for (ITeamWorkflowProvider provider : services.getWorkItemService().getTeamWorkflowProviders().getProviders()) {
+ String overrideWorkDefId = provider.getOverrideWorkflowDefinitionId(teamWf);
+ if (Strings.isValid(overrideWorkDefId)) {
+ changes.setSoleAttributeValue(teamWf, AtsAttributeTypes.WorkflowDefinition, overrideWorkDefId);
+ }
+ }
+ }
// Initialize state machine
String workDefinitionName = getWorkDefinitionName(teamDef);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AtsWorkItemServiceImpl.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AtsWorkItemServiceImpl.java
index 406d4d0224..3d70b66d49 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AtsWorkItemServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/AtsWorkItemServiceImpl.java
@@ -179,4 +179,9 @@ public class AtsWorkItemServiceImpl implements IAtsWorkItemService {
return new AtsWorkItemNotes(new ArtifactNote(workItem, services), services);
}
+ @Override
+ public ITeamWorkflowProvidersLazy getTeamWorkflowProviders() {
+ return teamWorkflowProvidersLazy;
+ }
+
}
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 e6af58607f..e59597d701 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
@@ -287,25 +287,25 @@ public final class AtsBranchManager {
*
* @param commitConfigArt that configures commit or null
*/
- public static ChangeData getChangeData(TeamWorkFlowArtifact teamArt, ICommitConfigItem commitConfigArt) throws OseeCoreException {
+ public static ChangeData getChangeData(IAtsTeamWorkflow teamWf, ICommitConfigItem commitConfigArt) throws OseeCoreException {
if (commitConfigArt != null && !isBaselinBranchConfigured(commitConfigArt)) {
throw new OseeArgumentException("Parent Branch not configured for [%s]", commitConfigArt);
}
Collection<Change> changes = new ArrayList<>();
IOperation operation = null;
- if (AtsClientService.get().getBranchService().isWorkingBranchInWork(teamArt)) {
- operation = ChangeManager.comparedToParent(AtsClientService.get().getBranchService().getWorkingBranch(teamArt),
- changes);
+ if (AtsClientService.get().getBranchService().isWorkingBranchInWork(teamWf)) {
+ operation =
+ ChangeManager.comparedToParent(AtsClientService.get().getBranchService().getWorkingBranch(teamWf), changes);
Operations.executeWorkAndCheckStatus(operation);
} else {
- if (AtsClientService.get().getBranchService().isCommittedBranchExists(teamArt)) {
+ if (AtsClientService.get().getBranchService().isCommittedBranchExists(teamWf)) {
TransactionToken transactionId = null;
if (commitConfigArt == null) {
- transactionId = AtsClientService.get().getBranchService().getEarliestTransactionId(teamArt);
+ transactionId = AtsClientService.get().getBranchService().getEarliestTransactionId(teamWf);
} else {
Collection<TransactionRecord> transIds =
- AtsClientService.get().getBranchService().getTransactionIds(teamArt, false);
+ AtsClientService.get().getBranchService().getTransactionIds(teamWf, false);
if (transIds.size() == 1) {
transactionId = transIds.iterator().next();
} else {

Back to the top