diff options
2 files changed, 6 insertions, 2 deletions
diff --git a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/StateSupport.java b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/StateSupport.java index 36502564f..2ca43aadf 100644 --- a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/StateSupport.java +++ b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/StateSupport.java @@ -156,7 +156,9 @@ public class StateSupport { ModelComponent ac = FSMSupportUtil.getInstance().getModelComponent(getDiagram()); StateGraph sg = (StateGraph) targetContainer.getLink().getBusinessObjects().get(0); - boolean inherited = FSMSupportUtil.getInstance().isInherited(getDiagram(), sg); + // hrr: was boolean inherited = FSMSupportUtil.getInstance().isInherited(getDiagram(), sg); + // but if we are inside our own refined state it is treated as inherited which is wrong + boolean inherited = !EcoreUtil.isAncestor(FSMSupportUtil.getInstance().getModelComponent(getDiagram()), sg); if (inherited) { sg = FSMSupportUtil.getInstance().insertRefinedState(sg, ac, targetContainer, getFeatureProvider()); } diff --git a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/TransitionSupport.java b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/TransitionSupport.java index 5c5103a7e..6a7f9112d 100644 --- a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/TransitionSupport.java +++ b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/TransitionSupport.java @@ -267,7 +267,9 @@ public class TransitionSupport { } ContainerShape targetContainer = FSMSupportUtil.getInstance().getStateGraphContainer((ContainerShape) context.getSourcePictogramElement().eContainer()); - boolean inherited = FSMSupportUtil.getInstance().isInherited(getDiagram(), sg); + // hrr: was boolean inherited = FSMSupportUtil.getInstance().isInherited(getDiagram(), sg); + // but if we are inside our own refined state it is treated as inherited which is wrong + boolean inherited = !EcoreUtil.isAncestor(FSMSupportUtil.getInstance().getModelComponent(getDiagram()), sg); if (inherited) { sg = FSMSupportUtil.getInstance().insertRefinedState(sg, mc, targetContainer, getFeatureProvider()); } |