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