|
Re: Update cells in a cross table [message #1738413 is a reply to message #1738387] |
Tue, 19 July 2016 14:44 |
|
Hi,
1) Under your Intersection mapping, you need to add a "Label Edit tool"
in order to process the information how your want. In your case, you
should probably use a "Set" operation to update the val field of
ColumnAssigment.
2) Still under your Intersection mapping, your need to add a "Create
Cell tool" in order to add a new ColumnAssigment. The operations needed
by this tool would be:
- a CreateInstance, to create a new ColumnAssigment and add it to the
columnAssignements reference of Decision;
- a Set, to reference the ColumnDeclaration using the column reference
- a Set, to give a default value to the new ColumnAssigment (optional).
For further information on these tools you can check:
https://www.eclipse.org/sirius/doc/specifier/tables/Tables.html#cross_table_tools
Regards,
Steve
Le 19/07/2016 à 13:54, Steve Hostettler a écrit :
> Hi
>
> thanks to the help of this forum I got the visualization of my
> cross-table working. Now I have 2 problems:
> 1) I cannot update the content of a previously filled cell. I can change
> it in the table but it is not persisted in the table nor is it in the
> underlying model.
> 2) How to create a new instance of the cell itself a "ColumnAssignment"
> in my case.
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:description="http://www.eclipse.org/sirius/description/1.1.0"
> xmlns:description_1="http://www.eclipse.org/sirius/table/description/1.1.0"
> name="blabla" version="11.0.0.201601261200">
> <ownedViewpoints name="BlaBlaInstance" modelFileExtension="myfile">
> <ownedRepresentations xsi:type="description_1:CrossTableDescription"
> name="DecisionTableDeclaration" domainClass="DecisionTableDeclaration">
> <metamodel href="http://www.blabla.com/dsl/BLABLA#/"/>
> <ownedLineMappings name="Decision" domainClass="Decision"/>
> <ownedColumnMappings name="Column"
> headerLabelExpression="[self.name + ' : ' + self.typeName/]"
> domainClass="ColumnDeclaration"/>
> <intersection name="Value"
> lineMapping="//@ownedViewpoints[name='BlaBlaInstance']/@ownedRepresentations[name='DecisionTableDeclaration']/@ownedLineMappings[name='Decision']"
> columnMapping="//@ownedViewpoints[name='BlaBlaInstance']/@ownedRepresentations[name='DecisionTableDeclaration']/@ownedColumnMappings.0"
> labelExpression="[self.val/]" useDomainClass="true"
> columnFinderExpression="[self.column/]"
> lineFinderExpression="[self.eContainer()/]"
> domainClass="ColumnAssignment"/>
> </ownedRepresentations>
> </ownedViewpoints>
> </description:Group>
>
>
> thanks for your help
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Update cells in a cross table [message #1738486 is a reply to message #1738461] |
Wed, 20 July 2016 10:00 |
|
Hello,
In fact the Create Instance should be done in the context of the
parent(Decision) of the element to create (ColumnAssigment). Therefore,
if it is not already done, you first need to add a "Change context"
operation and the browse expression should be "var:lineSemantic" then.
Now that the context is set on the parent, the sub-operation "Create
Instance" should have for Reference Name "columnAssignements" as
declared in your metamodel for the Decision metaclass.
Regards,
Steve
Le 20/07/2016 à 08:33, Steve Hostettler a écrit :
> Thanks for your help.
>
> I am almost there. Editing an existing cell does work but not creating a
> new one.
>
> I think that I am missing how to add the newly created instance to the
> columnAssignements reference of Decision;
>
> I did the following:
>
> Under the intersection mapping:
> A) Create Cell Tool (nothing changed in the properties apart from the Id)
> a) Create Instance (has the following variables: lineSemantic,
> columnSemantic, root)
> - Reference Name = newCell // I guess this is a variable
> declaration
> - Type Name = ColumnAssignment
> - Variable name = instance
> 1) Set Feature name = column
> Value Expression = [columnSemantic/]
> 2) Set Feature name = val
> Value Expression = [arg0/]
>
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Update cells in a cross table [message #1738513 is a reply to message #1738501] |
Wed, 20 July 2016 13:26 |
|
Hello,
You have a FeatureNotFoundException so one of your operations is done on
a feature (attribute/reference) that does not exist. It is probably a
typo (like in columnAssignements). You should check your "Create
Instance" (field "Reference Name") or "Set" (field "Feature Name") so
validate if they are properly set.
Regards,
Steve
Le 20/07/2016 à 13:19, Steve Hostettler a écrit :
> Thanks for help and patience.
>
> It still does not work since I get the following exception
>
> !ENTRY org.eclipse.sirius 4 0 2016-07-20 13:15:37.711
> !MESSAGE Error while modifying model
> !STACK 0
> org.eclipse.sirius.ecore.extender.business.api.accessor.exception.FeatureNotFoundException:
> null on com.blabla.dsl.bla.impl.DecisionImpl@61afc6ca
> at
> org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor.eIsMany(ModelAccessor.java:319)
>
> at
> org.eclipse.sirius.business.internal.helper.task.operations.CreateInstanceTask.execute(CreateInstanceTask.java:88)
>
> at
> org.eclipse.sirius.business.internal.helper.task.ExecuteToolOperationTask.executeTask(ExecuteToolOperationTask.java:127)
>
> at
> org.eclipse.sirius.business.internal.helper.task.ExecuteToolOperationTask.execute(ExecuteToolOperationTask.java:111)
>
> at
> org.eclipse.sirius.business.api.helper.task.TaskExecutor.execute(TaskExecutor.java:64)
>
> at
> org.eclipse.sirius.tools.api.command.SiriusCommand.doExecute(SiriusCommand.java:80)
>
> at
> org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
>
> at
> org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
>
> at
> org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
>
> at
> org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:488)
>
> at
> org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
>
> at
> org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
>
> at
> org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
>
> at
> org.eclipse.sirius.table.ui.tools.internal.editor.provider.DTargetColumnEditingSupport.setValue(DTargetColumnEditingSupport.java:148)
>
> at
> org.eclipse.jface.viewers.EditingSupport.saveCellEditorValue(EditingSupport.java:113)
>
> at
> org.eclipse.jface.viewers.ColumnViewerEditor.saveEditorValue(ColumnViewerEditor.java:453)
>
> at
> org.eclipse.jface.viewers.ColumnViewerEditor.applyEditorValue(ColumnViewerEditor.java:309)
>
> at
> org.eclipse.jface.viewers.ColumnViewerEditor$1.applyEditorValue(ColumnViewerEditor.java:152)
>
> at org.eclipse.jface.viewers.CellEditor$1.run(CellEditor.java:336)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
> at
> org.eclipse.jface.viewers.CellEditor.fireApplyEditorValue(CellEditor.java:333)
>
> at org.eclipse.jface.viewers.CellEditor.focusLost(CellEditor.java:722)
> at
> org.eclipse.jface.viewers.TextCellEditor$4.focusLost(TextCellEditor.java:184)
>
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:144)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4410)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1103)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1084)
> at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:2926)
> at org.eclipse.swt.widgets.Widget.wmKillFocus(Widget.java:1961)
> at org.eclipse.swt.widgets.Control.WM_KILLFOCUS(Control.java:5172)
> at org.eclipse.swt.widgets.Control.windowProc(Control.java:4825)
> at org.eclipse.swt.widgets.Text.windowProc(Text.java:2704)
> at org.eclipse.swt.widgets.Display.windowProc(Display.java:5115)
> at org.eclipse.swt.internal.win32.OS.SetFocus(Native Method)
> at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Tree.java:6561)
> at org.eclipse.swt.widgets.Control.windowProc(Control.java:4827)
> at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:6074)
> at org.eclipse.swt.widgets.Display.windowProc(Display.java:5102)
> at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
> at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2552)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3814)
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
>
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
>
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
>
> at
> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
>
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
>
> 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:673)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
>
> !ENTRY org.eclipse.core.resources 4 2 2016-07-20 13:15:51.866
> !MESSAGE Problems occurred when invoking code from plug-in:
> "org.eclipse.core.resources".
> !STACK 0
> java.lang.NullPointerException
> at
> org.eclipse.emf.ecore.util.ECrossReferenceAdapter$InverseCrossReferencer.remove(ECrossReferenceAdapter.java:278)
>
> at
> org.eclipse.emf.ecore.util.ECrossReferenceAdapter.unsetTarget(ECrossReferenceAdapter.java:843)
>
> at
> org.eclipse.emf.ecore.util.ECrossReferenceAdapter.unsetTarget(ECrossReferenceAdapter.java:822)
>
> at
> org.eclipse.sirius.common.tools.api.util.LazyCrossReferencer.unsetTarget(LazyCrossReferencer.java:135)
>
> at
> org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didRemove(MinimalEObjectImpl.java:527)
>
> at
> org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didRemove(MinimalEObjectImpl.java:1)
>
> at
> org.eclipse.emf.common.util.ArrayDelegatingEList.remove(ArrayDelegatingEList.java:658)
>
> at
> org.eclipse.emf.common.util.AbstractEList.remove(AbstractEList.java:462)
> at
> org.eclipse.emf.ecore.util.ECrossReferenceAdapter.removeAdapter(ECrossReferenceAdapter.java:913)
>
> at
> org.eclipse.emf.ecore.util.ECrossReferenceAdapter.unsetTarget(ECrossReferenceAdapter.java:859)
>
> at
> org.eclipse.emf.ecore.util.ECrossReferenceAdapter.unsetTarget(ECrossReferenceAdapter.java:822)
>
> at
> org.eclipse.sirius.common.tools.api.util.LazyCrossReferencer.unsetTarget(LazyCrossReferencer.java:135)
>
> at
> org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didRemove(MinimalEObjectImpl.java:527)
>
> at
> org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didRemove(MinimalEObjectImpl.java:1)
>
> at
> org.eclipse.emf.common.util.ArrayDelegatingEList.remove(ArrayDelegatingEList.java:658)
>
> at
> org.eclipse.emf.common.util.AbstractEList.remove(AbstractEList.java:462)
> at
> org.eclipse.emf.ecore.util.ECrossReferenceAdapter.removeAdapter(ECrossReferenceAdapter.java:913)
>
> at
> org.eclipse.emf.ecore.util.ECrossReferenceAdapter.unsetTarget(ECrossReferenceAdapter.java:859)
>
> at
> org.eclipse.emf.ecore.util.ECrossReferenceAdapter.unsetTarget(ECrossReferenceAdapter.java:822)
>
> at
> org.eclipse.sirius.common.tools.api.util.LazyCrossReferencer.unsetTarget(LazyCrossReferencer.java:135)
>
> at
> org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didRemove(MinimalEObjectImpl.java:527)
>
> at
> org.eclipse.emf.ecore.impl.MinimalEObjectImpl$1ArrayDelegatingAdapterList.didRemove(MinimalEObjectImpl.java:1)
>
> at
> org.eclipse.emf.common.util.AbstractEList.didClear(AbstractEList.java:168)
> at
> org.eclipse.emf.common.util.ArrayDelegatingEList.clear(ArrayDelegatingEList.java:707)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.unloaded(ResourceImpl.java:1589)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.doUnload(ResourceImpl.java:1661)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doUnload(XMLResourceImpl.java:713)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.unload(ResourceImpl.java:1676)
>
> at
> org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.unloadInExistingSessions(ViewpointRegistryImpl.java:860)
>
> at
> org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.reloadFile(ViewpointRegistryImpl.java:839)
>
> at
> org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.invalidateCacheAndReloadFile(ViewpointRegistryImpl.java:768)
>
> at
> org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.refreshWorkspaceComponents(ViewpointRegistryImpl.java:710)
>
> at
> org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.refreshWorkspaceComponents(ViewpointRegistryImpl.java:724)
>
> at
> org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.refreshWorkspaceComponents(ViewpointRegistryImpl.java:724)
>
> at
> org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.refreshWorkspaceComponents(ViewpointRegistryImpl.java:724)
>
> at
> org.eclipse.sirius.business.api.componentization.ViewpointRegistryImpl.resourceChanged(ViewpointRegistryImpl.java:672)
>
> at
> org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:299)
>
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at
> org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:289)
>
> at
> org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:152)
>
> at
> org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:374)
>
> at
> org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1469)
>
> at
> org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2253)
> at
> org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
> at
> org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:128)
>
> at
> org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
>
>
>
> Here is my description:
> <?xml version="1.0" encoding="UTF-8"?>
> <description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:description="http://www.eclipse.org/sirius/description/1.1.0"
> xmlns:description_1="http://www.eclipse.org/sirius/table/description/1.1.0"
> xmlns:tool="http://www.eclipse.org/sirius/description/tool/1.1.0"
> name="bla" version="11.0.0.201601261200">
> <ownedViewpoints name="blaInstance" modelFileExtension="bla ecore">
> <ownedRepresentations xsi:type="description_1:CrossTableDescription"
> name="DecisionTableDeclaration" domainClass="DecisionTableDeclaration">
> <metamodel href="http://www.blabla.com/dsl/bla#/"/>
> <ownedLineMappings name="Decision" domainClass="Decision"/>
> <ownedColumnMappings name="Column"
> headerLabelExpression="[self.name + ' : ' + self.typeName/]"
> domainClass="ColumnDeclaration"/>
> <intersection name="Value"
> lineMapping="//@ownedViewpoints[name='blaInstance']/@ownedRepresentations[name='DecisionTableDeclaration']/@ownedLineMappings[name='Decision']"
> columnMapping="//@ownedViewpoints[name='blaInstance']/@ownedRepresentations[name='DecisionTableDeclaration']/@ownedColumnMappings.0"
> labelExpression="[self.val/]" useDomainClass="true"
> columnFinderExpression="[self.column/]"
> lineFinderExpression="[self.eContainer()/]" domainClass="ColumnAssignment">
> <directEdit>
> <variables name="element" documentation="The semantic currently
> edited element."/>
> <variables name="lineSemantic" documentation="The semantic
> element corresponding to the line."/>
> <variables name="columnSemantic" documentation="The semantic
> element corresponding to the column (only available for Intersection
> Mapping)."/>
> <variables name="root" documentation="The semantic root element
> of the table."/>
> <firstModelOperation xsi:type="tool:SetValue" featureName="val"
> valueExpression="[arg0/]"/>
> <mask mask="{0}"/>
> </directEdit>
> <create name="CreateCellTool">
> <variables name="lineSemantic" documentation="The semantic
> element corresponding to the line."/>
> <variables name="columnSemantic" documentation="The semantic
> element corresponding to the column."/>
> <variables name="root" documentation="The semantic root element
> of the table."/>
> <firstModelOperation xsi:type="tool:CreateInstance"
> typeName="bla.ColumnAssignment" referenceName="columnAssignements">
> <subModelOperations xsi:type="tool:ChangeContext"
> browseExpression="[lineSemantic/]"/>
> <subModelOperations xsi:type="tool:SetValue"
> featureName="column" valueExpression="[columnSemantic/]"/>
> <subModelOperations xsi:type="tool:SetValue"
> featureName="val" valueExpression="[arg0/]"/>
> </firstModelOperation>
> <mask mask="{0}"/>
> </create>
> </intersection>
> </ownedRepresentations>
> </ownedViewpoints>
> </description:Group>
>
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
Re: Update cells in a cross table [message #1738524 is a reply to message #1738518] |
Wed, 20 July 2016 14:10 |
|
Ahah no problem, this is unfortunatly a common issue that we hope to be
fixed in Human 2.0 :)
By the way, note that there is autocompletion in any interpreted
expression field (Fields with a yellow background) as soon as the kind
of expression is know (for instance, starting by "feature:" for a
feature direct access or encapsulated by "[/]" for an Acceleo expression).
Le 20/07/2016 à 15:40, Steve Hostettler a écrit :
> Thanks a lot, the problem was indeed between the chair and the keyboard
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.04517 seconds