1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
/*******************************************************************************
* 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.impl.internal.workitem;
import java.rmi.activation.Activator;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
import org.eclipse.osee.ats.impl.internal.AtsServerService;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.orcs.data.ArtifactReadable;
/**
* @author Donald G Dunne
*/
public class ActionableItem extends AtsConfigObject implements IAtsActionableItem {
public ActionableItem(ArtifactReadable artifact) {
super(artifact);
}
@Override
public Collection<IAtsActionableItem> getChildrenActionableItems() {
Set<IAtsActionableItem> children = new HashSet<IAtsActionableItem>();
try {
for (ArtifactReadable childArt : artifact.getRelated(CoreRelationTypes.Default_Hierarchical__Child)) {
IAtsActionableItem childTeamDef = AtsServerService.get().getWorkItemFactory().getActionableItem(childArt);
children.add(childTeamDef);
}
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
return children;
}
@Override
public IAtsActionableItem getParentActionableItem() {
IAtsActionableItem parent = null;
try {
ResultSet<ArtifactReadable> related = artifact.getRelated(CoreRelationTypes.Default_Hierarchical__Parent);
if (!related.isEmpty()) {
parent = AtsServerService.get().getWorkItemFactory().getActionableItem(related.iterator().next());
}
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
return parent;
}
@Override
public IAtsTeamDefinition getTeamDefinition() {
IAtsTeamDefinition teamDef = null;
try {
ResultSet<ArtifactReadable> related = artifact.getRelated(AtsRelationTypes.TeamActionableItem_Team);
if (!related.isEmpty()) {
teamDef = AtsServerService.get().getWorkItemFactory().getTeamDef(related.iterator().next());
}
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
return teamDef;
}
@Override
public IAtsTeamDefinition getTeamDefinitionInherited() {
return TeamDefinitions.getImpactedTeamDef(this);
}
@Override
public void setParentActionableItem(IAtsActionableItem parentActionableItem) {
OseeLog.log(TeamDefinition.class, Level.SEVERE, "ActionableItem.setParentActionableItem not implemented");
}
@Override
public void setTeamDefinition(IAtsTeamDefinition teamDef) {
OseeLog.log(TeamDefinition.class, Level.SEVERE, "ActionableItem.setTeamDefinition not implemented");
}
@Override
public void setActionable(boolean actionable) {
OseeLog.log(TeamDefinition.class, Level.SEVERE, "ActionableItem.setActionable not implemented");
}
@Override
public void setActive(boolean active) {
OseeLog.log(TeamDefinition.class, Level.SEVERE, "ActionableItem.setActive not implemented");
}
@Override
public String getTypeName() {
return "Actionable Item";
}
}
|