Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraudrey.e.denk2021-01-11 17:02:33 +0000
committerAudrey Denk2021-01-14 15:32:23 +0000
commitf33d869315427f69d5f5de5599206db44c0250e0 (patch)
tree7672241bc6063369c04b7d772acf56ad74142c0d
parent9db1817e34c4ee9fefe1c51c6dfc0f6c926c70a4 (diff)
downloadorg.eclipse.osee-f33d869315427f69d5f5de5599206db44c0250e0.tar.gz
org.eclipse.osee-f33d869315427f69d5f5de5599206db44c0250e0.tar.xz
org.eclipse.osee-f33d869315427f69d5f5de5599206db44c0250e0.zip
bug[TW17832]: Publish config tags of members of ConfigurationGroup
Change-Id: I1b5750faa4097b6a48900918f010a5be93977efc Signed-off-by: audrey.e.denk <audrey.e.denk@boeing.com>
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/BlockApplicabilityOps.java23
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/OrcsApplicabilityOps.java1
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ApplicabilityQueryImpl.java2
3 files changed, 21 insertions, 5 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/BlockApplicabilityOps.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/BlockApplicabilityOps.java
index 0e627da4ff7..05243d421e1 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/BlockApplicabilityOps.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/BlockApplicabilityOps.java
@@ -40,6 +40,7 @@ import org.eclipse.osee.framework.core.util.WordCoreUtil;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
/**
* @author Ryan D. Brooks
@@ -208,7 +209,7 @@ public class BlockApplicabilityOps {
return viewInCfgGroup;
}
- private String getValidConfigurationContent(BranchId branch, ArtifactToken view, ApplicabilityType type, String fullText, HashMap<String, List<String>> id_value_map) {
+ private String getValidConfigurationContent(BranchId branch, ArtifactToken view, ApplicabilityType type, String fullText, HashMap<String, List<String>> configIdValuesMap) {
Matcher match = WordCoreUtil.ELSE_PATTERN.matcher(fullText);
String beginningText = fullText;
String elseText = "";
@@ -223,19 +224,33 @@ public class BlockApplicabilityOps {
String toReturn = "";
// Note: this assumes only OR's are put in between configurations
- List<String> values = id_value_map.get(view.getName().toUpperCase());
+ List<String> matchingTags = new ArrayList<String>();
+ if (view.isTypeEqual(CoreArtifactTypes.GroupArtifact)) {
+ for (ArtifactReadable memberConfig : orcsApi.getQueryFactory().fromBranch(branch).andId(
+ view).getArtifact().getRelated(CoreRelationTypes.PlConfigurationGroup_BranchView).getList()) {
+ if (configIdValuesMap.containsKey(memberConfig.getName().toUpperCase())) {
+ matchingTags.add("Config = " + memberConfig.getName());
+ }
+ }
+ if (matchingTags.isEmpty()) {
+ matchingTags = null;
+ }
+
+ } else {
+ matchingTags = configIdValuesMap.get(view.getName().toUpperCase());
+ }
if (type.equals(ApplicabilityType.NotConfiguration)) {
//Note when publishing with view=configurationgroup, do not publish Configuration Not[configA] text
if (orcsApi.getQueryFactory().fromBranch(branch).andId(view).andIsOfType(
CoreArtifactTypes.BranchView).exists()) {
- if (values != null) {
+ if (matchingTags != null) {
toReturn = elseText;
} else {
toReturn = beginningText;
}
}
- } else if (values == null) {
+ } else if (matchingTags == null) {
toReturn = elseText;
} else {
toReturn = beginningText;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/OrcsApplicabilityOps.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/OrcsApplicabilityOps.java
index 567731d1d17..3ce4d3d71d1 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/OrcsApplicabilityOps.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/applicability/OrcsApplicabilityOps.java
@@ -1083,6 +1083,7 @@ public class OrcsApplicabilityOps implements OrcsApplicability {
//relate to group
tx.relate(cfgGroup, CoreRelationTypes.PlConfigurationGroup_Group, view);
tx.createApplicabilityForView(view, "ConfigurationGroup = " + groupName);
+ tx.createApplicabilityForView(cfgGroup, "Config = " + view.getName());
tx.commit();
} catch (Exception ex) {
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ApplicabilityQueryImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ApplicabilityQueryImpl.java
index 3d4b4f8411b..093d27d45fe 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ApplicabilityQueryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/ApplicabilityQueryImpl.java
@@ -87,7 +87,7 @@ public class ApplicabilityQueryImpl implements ApplicabilityQuery {
for (ApplicabilityToken app : appTokens.values()) {
apps.add(app.getName());
}
- for (ArtifactToken view : getViewsForBranch(branch)) {
+ for (ArtifactToken view : getConfigurationsForBranch(branch)) {
apps.add("Config = " + view.getName());
}
for (FeatureDefinition feature : getFeatureDefinitionData(branch)) {

Back to the top