1 | @Override | | 1 | @Override |
2 | public boolean predicate2(Object dm, Designer dsgr) { | | 2 | public boolean predicate2(Object dm, Designer dsgr) { |
3 | if (!(Model.getFacade().isAPseudostate(dm))) { | | 3 | if (!(Model.getFacade().isAPseudostate(dm))) { |
4 | return NO_PROBLEM; | | 4 | return NO_PROBLEM; |
5 | } | | 5 | } |
6 | Object k = Model.getFacade().getKind(dm); | | 6 | Object k = Model.getFacade().getKind(dm); |
7 | if (!Model.getFacade().equalsPseudostateKind( | | 7 | if (!Model.getFacade().equalsPseudostateKind(k, |
8 | k, | | 8 | Model.getPseudostateKind().getDeepHistory())) { |
9 | Model.getPseudostateKind().getInitial())) { | | 9 | return NO_PROBLEM; |
10 | return NO_PROBLEM; | | 10 | } |
11 | } | | 11 | |
12 | | | 12 | // container state / composite state |
13 | // container state / composite state | | 13 | Object cs = Model.getFacade().getContainer(dm); |
14 | Object cs = Model.getFacade().getContainer(dm); | | 14 | if (cs == null) { |
15 | if (cs == null) { | | 15 | LOG.debug("null parent state"); |
16 | LOG.debug("null parent state"); | | 16 | return NO_PROBLEM; |
17 | return NO_PROBLEM; | | 17 | } |
18 | } | | 18 | Collection peers = Model.getFacade().getSubvertices(cs); |
19 | | | 19 | int initialStateCount = 0; |
20 | int initialStateCount = 0; | | 20 | for (Iterator iter = peers.iterator(); iter.hasNext();) { |
21 | Collection peers = Model.getFacade().getSubvertices(cs); | | 21 | Object sv = iter.next(); |
22 | for (Object sv : peers) { | | 22 | if (Model.getFacade().isAPseudostate(sv) |
23 | if (Model.getFacade().isAPseudostate(sv) | | 23 | && Model.getFacade().equalsPseudostateKind( |
24 | && Model.getFacade(). | | 24 | Model.getFacade().getKind(sv), |
25 | equalsPseudostateKind( | | 25 | Model.getPseudostateKind().getDeepHistory())) { |
26 | Model.getFacade().getKind(sv), | | 26 | initialStateCount++; |
27 | Model.getPseudostateKind().getInitial())) { | | 27 | } |
28 | initialStateCount++; | | 28 | } |
29 | } | | 29 | if (initialStateCount > 1) { |
30 | } | | 30 | return PROBLEM_FOUND; |
31 | if (initialStateCount > 1) { | | 31 | } |
32 | return PROBLEM_FOUND; | | 32 | return NO_PROBLEM; |
33 | } | | 33 | } |
34 | return NO_PROBLEM; | | | |
35 | } | | | |