1 package org.andromda.metafacades.emf.uml22;
2
3 import org.andromda.metafacades.uml.TransitionFacade;
4 import org.eclipse.uml2.uml.Action;
5 import org.eclipse.uml2.uml.Element;
6 import org.eclipse.uml2.uml.State;
7 import org.eclipse.uml2.uml.Transition;
8
9
10
11
12
13
14 public class ActionFacadeLogicImpl
15 extends ActionFacadeLogic
16 {
17 private static final long serialVersionUID = 9314317024410067L;
18
19
20
21
22
23 public ActionFacadeLogicImpl(
24 final Action metaObjectIn,
25 final String context)
26 {
27 super(metaObjectIn, context);
28 }
29
30
31
32
33 @Override
34 protected Transition handleGetTransition()
35 {
36 final Element owner = this.metaObject.getActivity().getOwner();
37 return (Transition)(owner instanceof Transition ? owner : null);
38 }
39
40
41
42
43 @Override
44 protected State handleGetActionState()
45 {
46 final Element owner = this.metaObject.getActivity().getOwner();
47 return (State)(owner instanceof State ? owner : null);
48 }
49
50
51
52
53
54 public TransitionFacade handleGetValidationOwner()
55 {
56 Object validationOwner = getTransition();
57
58 if (validationOwner == null)
59 {
60 validationOwner = getActionState();
61 }
62
63 return (TransitionFacade)validationOwner;
64 }
65 }