the ProperParentComponent can be found for the ExecutableFunctionTableSpecification and ExecutableTransitionTableSpecification
Please change the following function
public static Component
getProperParentComponent(IModelElementSpecification spec) {
return spec.eContainer().eContainer() instanceof ComponentRef ?
(Component)spec
.eContainer().eContainer() : (Component)spec.eContainer();
}
Into
public static Component
getProperParentComponent(IModelElementSpecification spec) {
EObject parent = spec.eContainer();
while(parent != null && !(parent.eContainer() instanceof ComponentRef)
&&
!(parent instanceof Component)) {
parent = parent.eContainer();
}
if(parent == null) {
return null;
}
return (Component)(parent.eContainer() instanceof ComponentRef ?
parent.eContainer(): parent);
}
or else the following exceptions will happen:
java.lang.ClassCastException:
org.fortiss.af3.table.model.impl.TableSpecificationImpl cannot be cast
to org.fortiss.af3.component.model.Component
at
org.fortiss.af3.component.utils.ComponentArchitectureUtils.getProperParentComponent(ComponentArchitectureUtils.java:306)
at
org.fortiss.af3.component.simulator.ExecutableAtomicComponentBase.(ExecutableAtomicComponentBase.java:91)
at
org.fortiss.af3.component.simulator.ExecutableAtomicComponentBase.(ExecutableAtomicComponentBase.java:85)
at
org.fortiss.af3.table.simulator.ExecutableFunctionTableSpecification.(ExecutableFunctionTableSpecification.java:60)
at
org.fortiss.af3.table.simulator.transform.ExecutableFunctionTableTransformation.transform(ExecutableFunctionTableTransformation.java:37)
at
org.fortiss.tooling.kernel.extension.data.TransformationProviderChain.transform(TransformationProviderChain.java:61)
at
org.fortiss.tooling.kernel.utils.TransformationUtils.createTransformedObjectFor(TransformationUtils.java:68)
at
org.fortiss.af3.table.simulator.transform.ExecutableTableSpecificationTransformation.transform(ExecutableTableSpecificationTransformation.java:85)
at
org.fortiss.tooling.kernel.extension.data.TransformationProviderChain.transform(TransformationProviderChain.java:61)
at
org.fortiss.tooling.kernel.utils.TransformationUtils.createTransformedObjectFor(TransformationUtils.java:68)
at
org.fortiss.af3.component.simulator.transform.ExecutableComponentTransformationBase.createExecutableForSpecification(ExecutableComponentTransformationBase.java:56)
at
org.fortiss.af3.component.simulator.transform.ExecutableComponentTransformationBase.createExecutableForComponent(ExecutableComponentTransformationBase.java:76)
at
org.fortiss.af3.component.simulator.transform.ExecutableCompositeComponentTransformation.transform(ExecutableCompositeComponentTransformation.java:79)
at
org.fortiss.tooling.kernel.extension.data.TransformationProviderChain.transform(TransformationProviderChain.java:61)
at
org.fortiss.tooling.kernel.utils.TransformationUtils.createTransformedObjectFor(TransformationUtils.java:68)
at
org.fortiss.af3.component.simulator.transform.ExecutableComponentTransformationBase.createExecutableForComponent(ExecutableComponentTransformationBase.java:89)
at
org.fortiss.af3.component.simulator.transform.ExecutableCompositeComponentTransformation.transform(ExecutableCompositeComponentTransformation.java:79)
at
org.fortiss.tooling.kernel.extension.data.TransformationProviderChain.transform(TransformationProviderChain.java:61)
at
org.fortiss.tooling.kernel.utils.TransformationUtils.createTransformedObjectFor(TransformationUtils.java:68)
at
org.fortiss.af3.project.internal.ExecutionService.prepareExecutableInternal(ExecutionService.java:139)
at
org.fortiss.af3.project.internal.ExecutionService.prepareExecutable(ExecutionService.java:105)
at
org.fortiss.af3.project.ui.execution.EasyStartMenuBase$EasyStartAction.run(EasyStartMenuBase.java:108)
at
org.fortiss.af3.component.ui.simulator.SimulatorEasyStartMenu$SimulationEasyStartAction.run(SimulatorEasyStartMenu.java:129)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at
org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at
org.fortiss.af3.rcapplication.AF3Application.start(AF3Application.java:48)
at
org.eclipse.equinox.internal.apEclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
org.fortiss.tooling.kernel.utils.TransformationUtils$1: No
transformation chain found from
org.fortiss.af3.table.model.impl.FunctionTableImpl@4200356d (id: 114,
name: Vertical Conditions Function Table, comment: Vertical Conditions
Function Table) (pattern: Pattern 2: Vertical Conditions, returnoutput:
true, rowVertical: 16, rowHorizontal: 1, columnVertical: 4,
columnHorizontal: 8, verticalString: Vertical Conditions,
horizontalString: Return Values) to
org.fortiss.af3.component.simulator.ExecutableComponent
at
org.fortiss.tooling.kernel.utils.TransformationUtils.createTransformedObjectFor(TransformationUtils.java:83)
at
org.fortiss.af3.table.simulator.transform.ExecutableTableSpecificationTransformation.transform(ExecutableTableSpecificationTransformation.java:85)
at
org.fortiss.tooling.kernel.extension.data.TransformationProviderChain.transform(TransformationProviderChain.java:61)
at
org.fortiss.tooling.kernel.utils.TransformationUtils.createTransformedObjectFor(TransformationUtils.java:68)
at
org.fortiss.af3.component.simulator.transform.ExecutableComponentTransformationBase.createExecutableForSpecification(ExecutableComponentTransformationBase.java:56)
at
org.fortiss.af3.component.simulator.transform.ExecutableComponentTransformationBase.createExecutableForComponent(ExecutableComponentTransformationBase.java:76)
at
org.fortiss.af3.component.simulator.transform.ExecutableCompositeComponentTransformation.transform(ExecutableCompositeComponentTransformation.java:79)
at
org.fortiss.tooling.kernel.extension.data.TransformationProviderChain.transform(TransformationProviderChain.java:61)
at
org.fortiss.tooling.kernel.utils.TransformationUtils.createTransformedObjectFor(TransformationUtils.java:68)
at
org.fortiss.af3.component.simulator.transform.ExecutableComponentTransformationBase.createExecutableForComponent(ExecutableComponentTransformationBase.java:89)
at
org.fortiss.af3.component.simulator.transform.ExecutableCompositeComponentTransformation.transform(ExecutableCompositeComponentTransformation.java:79)
at
org.fortiss.tooling.kernel.extension.data.TransformationProviderChain.transform(TransformationProviderChain.java:61)
at
org.fortiss.tooling.kernel.utils.TransformationUtils.createTransformedObjectFor(TransformationUtils.java:68)
at
org.fortiss.af3.project.internal.ExecutionService.prepareExecutableInternal(ExecutionService.java:139)
at
org.fortiss.af3.project.internal.ExecutionService.prepareExecutable(ExecutionService.java:105)
at
org.fortiss.af3.project.ui.execution.EasyStartMenuBase$EasyStartAction.run(EasyStartMenuBase.java:108)
at
org.fortiss.af3.component.ui.simulator.SimulatorEasyStartMenu$SimulationEasyStartAction.run(SimulatorEasyStartMenu.java:129)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at
org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at
org.fortiss.af3.rcapplication.AF3Application.start(AF3Application.java:48)
at
org.eclipse.equinox.internal.apEclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
!ENTRY org.fortiss.af3.project.ui 4 0 2013-10-03 14:05:24.661
!MESSAGE Source element
org.fortiss.af3.component.model.impl.ComponentImpl@58dc62e3 (id: 25,
name: TL-Architecture, comment: ) (wcet: 0, memoryConsumption: 0) could
not be transformed into
org.fortiss.af3.component.simulator.ExecutableComponent
!STACK 0
org.fortiss.af3.project.extension.exception.ExecutablePreparationFailedException:
Source element
org.fortiss.af3.component.model.impl.ComponentImpl@58dc62e3 (id: 25,
name: TL-Architecture, comment: ) (wcet: 0, memoryConsumption: 0) could
not be transformed into
org.fortiss.af3.component.simulator.ExecutableComponent
at
org.fortiss.af3.project.internal.ExecutionService.prepareExecutableInternal(ExecutionService.java:142)
at
org.fortiss.af3.project.internal.ExecutionService.prepareExecutable(ExecutionService.java:105)
at
org.fortiss.af3.project.ui.execution.EasyStartMenuBase$EasyStartAction.run(EasyStartMenuBase.java:108)
at
org.fortiss.af3.component.ui.simulator.SimulatorEasyStartMenu$SimulationEasyStartAction.run(SimulatorEasyStartMenu.java:129)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at
org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at
org.fortiss.af3.rcapplication.AF3Application.start(AF3Application.java:48)
at
org.eclipse.equinox.internal.apEclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by:
org.fortiss.tooling.kernel.extension.exception.ChainTransformationFailedException:
org.fortiss.tooling.kernel.utils.TransformationUtils$1: No
transformation chain found from
org.fortiss.af3.component.model.impl.CausalityComponentSpecificationImpl@30197b08
(stronglyCausal: false) to
org.fortiss.af3.component.simulator.ExecutableComponent
at
org.fortiss.tooling.kernel.extension.data.TransformationProviderChain.transform(TransformationProviderChain.java:63)
at
org.fortiss.tooling.kernel.utils.TransformationUtils.createTransformedObjectFor(TransformationUtils.java:68)
at
org.fortiss.af3.project.internal.ExecutionService.prepareExecutableInternal(ExecutionService.java:139)
… 32 more
Caused by: org.fortiss.tooling.kernel.utils.TransformationUtils$1: No
transformation chain found from
org.fortiss.af3.component.model.impl.CausalityComponentSpecificationImpl@30197b08
(stronglyCausal: false) to
org.fortiss.af3.component.simulator.ExecutableComponent
at
org.fortiss.tooling.kernel.utils.TransformationUtils.createTransformedObjectFor(TransformationUtils.java:83)
at
org.fortiss.af3.component.simulator.transform.ExecutableComponentTransformationBase.createExecutableForSpecification(ExecutableComponentTransformationBase.java:56)
at
org.fortiss.af3.component.simulator.transform.ExecutableComponentTransformationBase.createExecutableForComponent(ExecutableComponentTransformationBase.java:76)
at
org.fortiss.af3.component.simulator.transform.ExecutableCompositeComponentTransformation.transform(ExecutableCompositeComponentTransformation.java:79)
at
org.fortiss.tooling.kernel.extension.data.TransformationProviderChain.transform(TransformationProviderChain.java:61)
… 34 more
(from redmine: issue id 1769, created on 2013-10-03, closed on 2013-10-14)