diff options
Diffstat (limited to 'plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AbstractReview.java')
-rw-r--r-- | plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AbstractReview.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AbstractReview.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AbstractReview.java new file mode 100644 index 00000000000..48e4288fb5c --- /dev/null +++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AbstractReview.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * 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.rest.internal.workitem; + +import java.util.HashSet; +import java.util.Set; +import org.eclipse.osee.ats.api.ai.IAtsActionableItem; +import org.eclipse.osee.ats.api.data.AtsAttributeTypes; +import org.eclipse.osee.ats.api.review.IAtsAbstractReview; +import org.eclipse.osee.ats.rest.internal.AtsServerImpl; +import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; +import org.eclipse.osee.orcs.data.ArtifactReadable; + +/** + * @author Donald G. Dunne + */ +public abstract class AbstractReview extends WorkItem implements IAtsAbstractReview { + + public AbstractReview(ArtifactReadable artifact) { + super(artifact); + } + + @Override + public Set<IAtsActionableItem> getActionableItems() throws OseeCoreException { + Set<IAtsActionableItem> ais = new HashSet<IAtsActionableItem>(); + for (Object aiGuidObj : artifact.getAttributeValues(AtsAttributeTypes.ActionableItem)) { + String aiGuid = (String) aiGuidObj; + ArtifactReadable aiArt = AtsServerImpl.get().getArtifactByGuid(aiGuid); + IAtsActionableItem ai = AtsServerImpl.get().getWorkItemFactory().getActionableItem(aiArt); + ais.add(ai); + } + return ais; + } + +} |