IState state = (IState) getHost().getModel();
if ((ae.getType() == IActionElement.ACTION_TYPE.ACTION && state instanceof IActionState)
|| (ae.getType() == IActionElement.ACTION_TYPE.RENDER_ACTION && state instanceof IViewState)
|| (ae.getType() == IActionElement.ACTION_TYPE.ENTRY_ACTION && state instanceof IState)
|| (ae.getType() == IActionElement.ACTION_TYPE.EXIT_ACTION && state instanceof ITransitionableFrom)) {
ActionCloneCommand orphan = new ActionCloneCommand();
orphan.setChild((IActionElement) ((EditPart) parts.get(i))
.getModel());
orphan.setNewState((IWebflowModelElement) getHost()
.getModel());
result.add(orphan);
}
}
else if (part.getModel() instanceof IExceptionHandler) {
IState state = (IState) getHost().getModel();
if (!(state instanceof IWebflowState)
&& !(state instanceof IInlineFlowState)) {
ExceptionHandlerCloneCommand orphan = new ExceptionHandlerCloneCommand();
orphan.setChild((IExceptionHandler) ((EditPart) parts.get(i))
.getModel());
orphan.setNewState((IWebflowModelElement) getHost()
.getModel());
result.add(orphan);
}
}
else if (part.getModel() instanceof IAttributeMapper) {
IState state = (IState) getHost().getModel();
if (state instanceof SubflowState
&& ((SubflowState) state).getAttributeMapper() == null) {
AttributeMapperCloneCommand orphan = new AttributeMapperCloneCommand();
orphan.setChild((IAttributeMapper) ((EditPart) parts.get(i))
.getModel());
orphan.setNewState((IWebflowModelElement) getHost()
.getModel());
result.add(orphan);
}
}
}