/**
* @see org.andromda.metafacades.uml.FrontEndControllerOperation#getDeferringActions()
*/
protected java.util.List handleGetDeferringActions()
{
final Collection deferringActions = new LinkedHashSet();
final FrontEndActivityGraph graph = this.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 FrontEndActionState)
{
final FrontEndActionState actionState = (FrontEndActionState)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 FrontEndForward transition = (FrontEndForward)transitionIterator.next();
final EventFacade event = transition.getTrigger();
if (event instanceof FrontEndEvent)
{
final FrontEndEvent trigger = (FrontEndEvent)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 FrontEndActionState)
{
final FrontEndActionState sourceActionState = (FrontEndActionState)source;
deferringActions.addAll(sourceActionState.getContainerActions());
}
// test for decision
final StateVertexFacade target = transition.getTarget();
if (target instanceof FrontEndPseudostate)
{
final FrontEndPseudostate targetPseudoState = (FrontEndPseudostate)target;
if (targetPseudoState.isDecisionPoint())
{
deferringActions.addAll(targetPseudoState.getContainerActions());
}
}
}
}
}