1 package org.andromda.metafacades.emf.uml22;
2
3 import java.util.Collection;
4 import org.andromda.metafacades.uml.StateFacade;
5 import org.eclipse.uml2.uml.Element;
6 import org.eclipse.uml2.uml.Region;
7 import org.eclipse.uml2.uml.StateMachine;
8 import org.eclipse.uml2.uml.UseCase;
9
10
11
12
13
14
15
16
17
18
19 public class ActivityGraphFacadeLogicImpl
20 extends ActivityGraphFacadeLogic
21 {
22 private static final long serialVersionUID = 34L;
23
24
25
26
27 public ActivityGraphFacadeLogicImpl(
28 final StateMachine metaObject,
29 final String context)
30 {
31 super(metaObject, context);
32 }
33
34
35
36
37 @Override
38 protected Collection<StateFacade> handleGetActionStates()
39 {
40
41
42 return this.getStates();
43 }
44
45
46
47
48 @Override
49 protected Collection handleGetObjectFlowStates()
50 {
51
52 return null;
53 }
54
55
56
57
58 @Override
59 protected UseCase handleGetUseCase()
60 {
61 final Element owner = this.metaObject.getOwner();
62 if (owner instanceof UseCase)
63 {
64 return (UseCase)owner;
65 }
66
67 return null;
68 }
69
70
71
72
73 @Override
74 protected Collection<Region> handleGetPartitions()
75 {
76
77
78 return this.metaObject.getRegions();
79 }
80
81
82
83
84 @Override
85 public Object getValidationOwner()
86 {
87 Object validationOwner = getUseCase();
88
89 if (validationOwner == null)
90 {
91 validationOwner = getStateMachineContext();
92 }
93 if (validationOwner == null)
94 {
95 validationOwner = getPackage();
96 }
97
98 return validationOwner;
99 }
100 }