*
* @see org.andromda.metafacades.uml.FrontEndControllerOperation#getDeferringActions()
*/
public java.util.List getDeferringActions()
{
final Collection deferringActions = new LinkedHashSet();
final FrontEndActivityGraph graph = getActivityGraph();
if (graph != null)
{
final Collection actionStates = graph.getActionStates();
for (final Iterator actionStateIterator = actionStates.iterator(); actionStateIterator.hasNext();)
{
final Object actionStateObject = actionStateIterator.next();
if (actionStateObject instanceof StrutsActionState)
{
final StrutsActionState actionState = (StrutsActionState)actionStateObject;
final Collection controllerCalls = actionState.getControllerCalls();
for (final Iterator controllerCallIterator = controllerCalls.iterator();
controllerCallIterator.hasNext();)
{
final OperationFacade operation = (OperationFacade)controllerCallIterator.next();
if (this.equals(operation))
{
deferringActions.addAll(actionState.getContainerActions());
}
}
}
}
final Collection transitions = graph.getTransitions();
for (final Iterator transitionIterator = transitions.iterator(); transitionIterator.hasNext();)
{
final StrutsForward transition = (StrutsForward)transitionIterator.next();
final EventFacade event = transition.getTrigger();
if (event instanceof StrutsTrigger)
{
final StrutsTrigger trigger = (StrutsTrigger)event;
final FrontEndControllerOperation operation = trigger.getControllerCall();
if (this.equals(operation))
{
// we have two types of controller calls: the ones in action states and the ones for decisions
final StateVertexFacade source = transition.getSource();
if (source instanceof StrutsActionState)
{
final StrutsActionState sourceActionState = (StrutsActionState)source;
deferringActions.addAll(sourceActionState.getContainerActions());
}
// test for decision
final StateVertexFacade target = transition.getTarget();
if (target instanceof StrutsPseudostate)
{
final StrutsPseudostate targetPseudoState = (StrutsPseudostate)target;
if (targetPseudoState.isDecisionPoint())
{
deferringActions.addAll(targetPseudoState.getContainerActions());
}
}
}
}
}