Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormegumi.telles2013-07-14 04:15:09 +0000
committerGerrit Code Review @ Eclipse.org2013-09-13 21:10:10 +0000
commit084007d42a021474f8f3ffbbddfc1a01038a7f79 (patch)
treeb73cd51853a459ea37be9bac189638a84de6a819 /plugins
parent98b93fa8d9dbe3c59778a779eecda5154eb44415 (diff)
downloadorg.eclipse.osee-084007d42a021474f8f3ffbbddfc1a01038a7f79.tar.gz
org.eclipse.osee-084007d42a021474f8f3ffbbddfc1a01038a7f79.tar.xz
org.eclipse.osee-084007d42a021474f8f3ffbbddfc1a01038a7f79.zip
feature[ats_7SNLZ]: Create RelationTypeValidity
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTestSuite.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTypeValidityTest.java234
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java15
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationNode.java31
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationTypeValidity.java133
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/MultiplicityState.java18
6 files changed, 422 insertions, 11 deletions
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTestSuite.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTestSuite.java
index 73c788b4b8..d92a06ce3d 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTestSuite.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTestSuite.java
@@ -19,7 +19,7 @@ import org.junit.runners.Suite;
* @author Roberto E. Escobar
*/
@RunWith(Suite.class)
-@Suite.SuiteClasses({OrderTestSuite.class, SorterTestSuite.class})
+@Suite.SuiteClasses({OrderTestSuite.class, SorterTestSuite.class, RelationTypeValidityTest.class})
public class RelationTestSuite {
// Test Suite
}
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTypeValidityTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTypeValidityTest.java
new file mode 100644
index 0000000000..7f1e29ca9c
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTypeValidityTest.java
@@ -0,0 +1,234 @@
+/*******************************************************************************
+ * 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.orcs.core.internal.relation;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.data.IRelationType;
+import org.eclipse.osee.framework.core.data.IRelationTypeSide;
+import org.eclipse.osee.framework.core.enums.RelationSide;
+import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeStateException;
+import org.eclipse.osee.orcs.core.internal.util.MultiplicityState;
+import org.eclipse.osee.orcs.data.RelationTypes;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+/**
+ * Test Case for {@link RelationTypeValidity}
+ *
+ * @author Roberto E. Escobar
+ * @author Megumi Telles
+ */
+public class RelationTypeValidityTest {
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ // @formatter:off
+ @Mock private RelationTypes cache;
+ @Mock private RelationNode node;
+ @Mock private IArtifactType artifactType;
+ @Mock private IArtifactType artifactType2;
+ @Mock private IRelationType relationType1;
+ @Mock private IRelationType relationType2;
+ @Mock private IRelationType relationType3;
+ @Mock private IRelationType relationType4;
+ @Mock private IRelationTypeSide typeSide1;
+ // @formatter:on
+
+ private RelationTypeValidity validity;
+
+ @Before
+ public void init() throws OseeCoreException {
+ MockitoAnnotations.initMocks(this);
+
+ validity = new RelationTypeValidity(cache);
+
+ when(typeSide1.getGuid()).thenReturn(11L);
+ when(typeSide1.getSide()).thenReturn(RelationSide.SIDE_B);
+ when(typeSide1.getName()).thenReturn("typeSide1");
+
+ when(cache.getByUuid(typeSide1.getGuid())).thenReturn(relationType1);
+ }
+
+ @Test
+ public void testMaximumRelationAllowedNullArtifactType() throws OseeCoreException {
+ thrown.expect(OseeArgumentException.class);
+ thrown.expectMessage("artifactType cannot be null");
+ validity.getMaximumRelationsAllowed(null, typeSide1);
+ }
+
+ @Test
+ public void testMaximumRelationAllowedNullRelationTypeSide() throws OseeCoreException {
+ thrown.expect(OseeArgumentException.class);
+ thrown.expectMessage("relationTypeSide cannot be null");
+ validity.getMaximumRelationsAllowed(artifactType, null);
+ }
+
+ @Test
+ public void testValidRelationTypesNullArtifactType() throws OseeCoreException {
+ thrown.expect(OseeArgumentException.class);
+ thrown.expectMessage("artifactType cannot be null");
+ validity.getValidRelationTypes(null);
+ }
+
+ @Test
+ public void testMaximumRelationAllowed1() throws OseeCoreException {
+ when(cache.isArtifactTypeAllowed(relationType1, RelationSide.SIDE_B, artifactType)).thenReturn(true);
+ when(cache.getMultiplicity(relationType1)).thenReturn(RelationTypeMultiplicity.MANY_TO_MANY);
+
+ int actual = validity.getMaximumRelationsAllowed(artifactType, typeSide1);
+ assertEquals(Integer.MAX_VALUE, actual);
+ }
+
+ @Test
+ public void testMaximumRelationAllowed2() throws OseeCoreException {
+ when(cache.isArtifactTypeAllowed(relationType1, RelationSide.SIDE_B, artifactType)).thenReturn(true);
+ when(cache.getMultiplicity(relationType1)).thenReturn(RelationTypeMultiplicity.MANY_TO_ONE);
+
+ int actual = validity.getMaximumRelationsAllowed(artifactType, typeSide1);
+ assertEquals(1, actual);
+ }
+
+ @Test
+ public void testMaximumRelationAllowed3() throws OseeCoreException {
+ when(cache.isArtifactTypeAllowed(relationType1, RelationSide.SIDE_A, artifactType)).thenReturn(true);
+
+ int actual = validity.getMaximumRelationsAllowed(artifactType, typeSide1);
+ assertEquals(0, actual);
+ }
+
+ @Test
+ public void testValidRelationTypes() throws OseeCoreException {
+ final Collection<? extends IRelationType> types =
+ Arrays.asList(relationType1, relationType2, relationType3, relationType4);
+ when(cache.getAll()).thenAnswer(new Answer<Collection<? extends IRelationType>>() {
+
+ @Override
+ public Collection<? extends IRelationType> answer(InvocationOnMock invocation) throws Throwable {
+ return types;
+ }
+
+ });
+ when(cache.isArtifactTypeAllowed(relationType1, RelationSide.SIDE_B, artifactType)).thenReturn(true);
+ when(cache.getMultiplicity(relationType1)).thenReturn(RelationTypeMultiplicity.MANY_TO_MANY);
+
+ when(cache.isArtifactTypeAllowed(relationType2, RelationSide.SIDE_A, artifactType)).thenReturn(false);
+ when(cache.getMultiplicity(relationType2)).thenReturn(RelationTypeMultiplicity.MANY_TO_ONE);
+
+ when(cache.isArtifactTypeAllowed(relationType3, RelationSide.SIDE_A, artifactType)).thenReturn(true);
+ when(cache.getMultiplicity(relationType3)).thenReturn(RelationTypeMultiplicity.ONE_TO_ONE);
+
+ when(cache.isArtifactTypeAllowed(relationType4, RelationSide.SIDE_A, artifactType)).thenReturn(false);
+ when(cache.getMultiplicity(relationType4)).thenReturn(RelationTypeMultiplicity.ONE_TO_MANY);
+
+ List<IRelationType> actual = validity.getValidRelationTypes(artifactType);
+
+ assertEquals(2, actual.size());
+ assertTrue(actual.contains(relationType1));
+ assertFalse(actual.contains(relationType2));
+ assertTrue(actual.contains(relationType3));
+ assertFalse(actual.contains(relationType4));
+ }
+
+ @Test
+ public void testGetRelationMultiplicityState() throws OseeCoreException {
+ when(cache.getMultiplicity(relationType1)).thenReturn(RelationTypeMultiplicity.ONE_TO_ONE);
+
+ MultiplicityState state = validity.getRelationMultiplicityState(typeSide1, 0);
+ assertEquals(MultiplicityState.IS_VALID, state);
+
+ state = validity.getRelationMultiplicityState(typeSide1, 1);
+ assertEquals(MultiplicityState.IS_VALID, state);
+
+ state = validity.getRelationMultiplicityState(typeSide1, 2);
+ assertEquals(MultiplicityState.MAX_VIOLATION, state);
+ }
+
+ @Test
+ public void testCheckRelationTypeMultiplicity() throws OseeCoreException {
+ when(cache.getMultiplicity(relationType1)).thenReturn(RelationTypeMultiplicity.ONE_TO_ONE);
+ when(node.getExceptionString()).thenReturn("node message");
+
+ thrown.expect(OseeStateException.class);
+ thrown.expectMessage(String.format("Relation type [%s] exceeds max occurrence rule on [node message]", typeSide1,
+ node.getExceptionString()));
+
+ validity.checkRelationTypeMultiplicity(node, typeSide1, 2);
+ }
+
+ @Test
+ public void testCheckRelationTypeMultiplicityNoException() throws OseeCoreException {
+ when(cache.getMultiplicity(relationType1)).thenReturn(RelationTypeMultiplicity.ONE_TO_ONE);
+ when(node.getExceptionString()).thenReturn("node message");
+
+ ExpectedException.none();
+ validity.checkRelationTypeMultiplicity(node, typeSide1, 0);
+ }
+
+ @Test
+ public void testIsRelationTypeValid() throws OseeCoreException {
+ when(cache.isArtifactTypeAllowed(relationType1, RelationSide.SIDE_A, artifactType)).thenReturn(true);
+
+ boolean actual = validity.isRelationTypeValid(artifactType, typeSide1);
+ assertEquals(false, actual);
+
+ when(cache.isArtifactTypeAllowed(relationType1, RelationSide.SIDE_B, artifactType)).thenReturn(true);
+ when(cache.getMultiplicity(relationType1)).thenReturn(RelationTypeMultiplicity.ONE_TO_ONE);
+
+ actual = validity.isRelationTypeValid(artifactType, typeSide1);
+ assertEquals(true, actual);
+ }
+
+ @Test
+ public void testCheckRelationTypeValid() throws OseeCoreException {
+ when(artifactType.toString()).thenReturn("artType1");
+ when(artifactType2.toString()).thenReturn("artType2");
+
+ when(relationType1.toString()).thenReturn("relationType1Name");
+ when(cache.isArtifactTypeAllowed(relationType1, RelationSide.SIDE_A, artifactType)).thenReturn(true);
+
+ when(cache.getArtifactType(relationType1, RelationSide.SIDE_B)).thenReturn(artifactType2);
+
+ when(node.getArtifactType()).thenReturn(artifactType);
+ when(node.getExceptionString()).thenReturn("node message");
+
+ thrown.expect(OseeArgumentException.class);
+ thrown.expectMessage("Relation validity error for [node message] - ArtifactType [artType1] does not belong on side [SIDE_B] of relation [relationType1Name] - only items of type [artType2] are allowed");
+ validity.checkRelationTypeValid(node, typeSide1);
+ }
+
+ @Test
+ public void testCheckRelationTypeValidNoException() throws OseeCoreException {
+ when(node.getArtifactType()).thenReturn(artifactType);
+ when(cache.isArtifactTypeAllowed(relationType1, RelationSide.SIDE_B, artifactType)).thenReturn(true);
+ when(cache.getMultiplicity(relationType1)).thenReturn(RelationTypeMultiplicity.ONE_TO_ONE);
+
+ ExpectedException.none();
+ validity.checkRelationTypeValid(node, typeSide1);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
index 60495421af..4366230a74 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
@@ -35,6 +35,7 @@ import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.orcs.core.ds.ArtifactData;
import org.eclipse.osee.orcs.core.ds.HasOrcsData;
+import org.eclipse.osee.orcs.core.internal.util.MultiplicityState;
import org.eclipse.osee.orcs.data.AttributeReadable;
import org.eclipse.osee.orcs.data.AttributeWriteable;
@@ -456,22 +457,16 @@ public abstract class AttributeManagerImpl extends AbstractIdentity<String> impl
MultiplicityState state = getAttributeMuliplicityState(attributeType, count);
switch (state) {
case MAX_VIOLATION:
- throw new OseeStateException("Attribute type [%s] exceeds max occurrence rule on artifacts [%s]",
- attributeType, getExceptionString());
+ throw new OseeStateException("Attribute type [%s] exceeds max occurrence rule on [%s]", attributeType,
+ getExceptionString());
case MIN_VIOLATION:
- throw new OseeStateException("Attribute type [%s] is less than min occurrence rule on artifacts [%s]",
- attributeType, getExceptionString());
+ throw new OseeStateException("Attribute type [%s] is less than min occurrence rule on [%s]", attributeType,
+ getExceptionString());
default:
break;
}
}
- private static enum MultiplicityState {
- IS_VALID,
- MAX_VIOLATION,
- MIN_VIOLATION;
- }
-
private MultiplicityState getAttributeMuliplicityState(IAttributeType attributeType, int count) throws OseeCoreException {
MultiplicityState state = MultiplicityState.IS_VALID;
if (count > attributeFactory.getMaxOccurrenceLimit(attributeType)) {
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationNode.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationNode.java
new file mode 100644
index 0000000000..2b5f09768a
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationNode.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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.orcs.core.internal.relation;
+
+import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.data.Identifiable;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.orcs.core.internal.relation.order.OrderStore;
+import org.eclipse.osee.orcs.data.CanDelete;
+import org.eclipse.osee.orcs.data.HasLocalId;
+
+/**
+ * @author Roberto E. Escobar
+ * @author Megumi Telles
+ */
+
+public interface RelationNode extends Identifiable, CanDelete, HasLocalId, OrderStore {
+
+ IArtifactType getArtifactType() throws OseeCoreException;
+
+ String getExceptionString();
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationTypeValidity.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationTypeValidity.java
new file mode 100644
index 0000000000..71f1a686b6
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationTypeValidity.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * 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.orcs.core.internal.relation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.data.IRelationType;
+import org.eclipse.osee.framework.core.data.IRelationTypeSide;
+import org.eclipse.osee.framework.core.enums.RelationSide;
+import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeStateException;
+import org.eclipse.osee.framework.core.util.Conditions;
+import org.eclipse.osee.orcs.core.internal.util.MultiplicityState;
+import org.eclipse.osee.orcs.data.RelationTypes;
+
+/**
+ * @author Roberto E. Escobar
+ * @author Megumi Telles
+ */
+public class RelationTypeValidity {
+
+ private final RelationTypes relationTypes;
+
+ public RelationTypeValidity(RelationTypes relationTypes) {
+ super();
+ this.relationTypes = relationTypes;
+ }
+
+ public void checkRelationTypeMultiplicity(RelationNode node, IRelationTypeSide typeAndSide, int count) throws OseeCoreException {
+ MultiplicityState state = getRelationMultiplicityState(typeAndSide, count);
+ switch (state) {
+ case MAX_VIOLATION:
+ throw new OseeStateException("Relation type [%s] exceeds max occurrence rule on [%s]", typeAndSide,
+ node.getExceptionString());
+ case MIN_VIOLATION:
+ throw new OseeStateException("Relation type [%s] is less than min occurrence rule on [%s]", typeAndSide,
+ node.getExceptionString());
+ default:
+ break;
+ }
+ }
+
+ public boolean isRelationTypeValid(IArtifactType artifactType, IRelationTypeSide relationTypeSide) throws OseeCoreException {
+ IRelationType relationType = relationTypes.getByUuid(relationTypeSide.getGuid());
+ RelationSide relationSide = relationTypeSide.getSide();
+ return isRelationTypeValid(artifactType, relationType, relationSide);
+ }
+
+ public void checkRelationTypeValid(RelationNode node, IRelationTypeSide relationTypeSide) throws OseeCoreException {
+ IRelationType relationType = relationTypes.getByUuid(relationTypeSide.getGuid());
+ RelationSide relationSide = relationTypeSide.getSide();
+ IArtifactType artifactType = node.getArtifactType();
+ boolean isValid = isRelationTypeValid(artifactType, relationType, relationSide);
+ Conditions.checkExpressionFailOnTrue(
+ !isValid,
+ "Relation validity error for [%s] - ArtifactType [%s] does not belong on side [%s] of relation [%s] - only items of type [%s] are allowed",
+ node.getExceptionString(), artifactType, relationSide.name(), relationType,
+ relationTypes.getArtifactType(relationType, relationSide));
+ }
+
+ public int getMaximumRelationsAllowed(IArtifactType artifactType, IRelationTypeSide relationTypeSide) throws OseeCoreException {
+ Conditions.checkNotNull(artifactType, "artifactType");
+ Conditions.checkNotNull(relationTypeSide, "relationTypeSide");
+ int toReturn = 0;
+ IRelationType relationType = relationTypes.getByUuid(relationTypeSide.getGuid());
+ RelationSide relationSide = relationTypeSide.getSide();
+ if (relationTypes.isArtifactTypeAllowed(relationType, relationSide, artifactType)) {
+ toReturn = relationTypes.getMultiplicity(relationType).getLimit(relationSide);
+ }
+ return toReturn;
+ }
+
+ public MultiplicityState getRelationMultiplicityState(IRelationTypeSide relationTypeSide, int count) throws OseeCoreException {
+ IRelationType relationType = relationTypes.getByUuid(relationTypeSide.getGuid());
+ RelationSide relationSide = relationTypeSide.getSide();
+ RelationTypeMultiplicity multiplicity = relationTypes.getMultiplicity(relationType);
+
+ MultiplicityState toReturn = MultiplicityState.IS_VALID;
+ int limit = multiplicity.getLimit(relationSide);
+ if (count > limit) {
+ toReturn = MultiplicityState.MAX_VIOLATION;
+ }
+ return toReturn;
+ }
+
+ public List<IRelationType> getValidRelationTypes(IArtifactType artifactType) throws OseeCoreException {
+ Conditions.checkNotNull(artifactType, "artifactType");
+ Collection<? extends IRelationType> types = relationTypes.getAll();
+ List<IRelationType> toReturn = new ArrayList<IRelationType>();
+ for (IRelationType relationType : types) {
+ if (isTypeAllowed(artifactType, relationType)) {
+ toReturn.add(relationType);
+ }
+ }
+ return toReturn;
+ }
+
+ private boolean isRelationTypeValid(IArtifactType artifactType, IRelationType relationType, RelationSide relationSide) throws OseeCoreException {
+ return getRelationSideMax(artifactType, relationType, relationSide) > 0;
+ }
+
+ private boolean isTypeAllowed(IArtifactType artifactType, IRelationType relationType) throws OseeCoreException {
+ boolean result = false;
+ for (RelationSide side : RelationSide.values()) {
+ int sideMax = getRelationSideMax(artifactType, relationType, side);
+ if (sideMax > 0) {
+ result = true;
+ break;
+ }
+ }
+ return result;
+ }
+
+ private int getRelationSideMax(IArtifactType artifactType, IRelationType relationType, RelationSide relationSide) throws OseeCoreException {
+ int toReturn = 0;
+ if (relationTypes.isArtifactTypeAllowed(relationType, relationSide, artifactType)) {
+ toReturn = relationTypes.getMultiplicity(relationType).getLimit(relationSide);
+ }
+ return toReturn;
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/MultiplicityState.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/MultiplicityState.java
new file mode 100644
index 0000000000..b31fe60a2e
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/MultiplicityState.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * 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 @@ -8,14 8,13 @@
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.core.internal.util;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public enum MultiplicityState {
+ IS_VALID,
+ MAX_VIOLATION,
+ MIN_VIOLATION;
+} \ No newline at end of file

Back to the top