1 package org.andromda.cartridges.bpm4struts.metafacades;
2
3 import org.andromda.metafacades.uml.PseudostateFacade;
4
5 import java.util.Collection;
6
7
8 /**
9 * MetafacadeLogic implementation.
10 *
11 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsActivityGraph
12 */
13 public class StrutsActivityGraphLogicImpl
14 extends StrutsActivityGraphLogic
15 {
16 public StrutsActivityGraphLogicImpl(
17 java.lang.Object metaObject,
18 java.lang.String context)
19 {
20 super(metaObject, context);
21 }
22
23 protected Object handleGetFirstAction()
24 {
25 Object firstAction = null;
26 final Collection initialStates = getInitialStates();
27 if (!initialStates.isEmpty())
28 {
29 final PseudostateFacade initialState = (PseudostateFacade)initialStates.iterator().next();
30 final Collection outgoing = initialState.getOutgoing();
31 firstAction = (outgoing.isEmpty()) ? null : outgoing.iterator().next();
32 }
33 return firstAction;
34 }
35 }