Can't get crosstable working [message #1738280] |
Mon, 18 July 2016 11:42  |
Eclipse User |
|
|
|
Hi,
I read the table documentation as well as the cross table specific documentation but I can't get it working.
I do have an Xtext Textual language and for a small subset of it I would like to use Cross-Tables
The metamodel is the following
DecisionTableDeclaration
columnsDeclaration : ColumnDeclaration
decisions : Decision
ColumnDeclaration
name : EString
typeName : EString
Decision
columnAssignements : ColumnAssignment
ColumnAssignment:
column : ColumnDeclaration
val : EString
Here is the model instance
decision table {
column col1 : string,
column col2 : string,
column col3 : string
decision : col1 = "val11", col2 = "val12";
decision : col1 = "val21", col2 = "val22";
decision : col1 = "val31", col2 = "val32";
decision : col1 = "val41", col2 = "val42"
}
The viewpoint decription currently looks like:
<?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="blabla">
<ownedRepresentations xsi:type="description_1:CrossTableDescription" name="DecisionTableDeclaration" domainClass="DecisionTableDeclaration">
<metamodel href="http://www.blabla.com/dsl/Bla#/"/>
<ownedLineMappings name="Decision" domainClass="Decision" headerLabelExpression="D"/>
<ownedCreateLine mapping="//@ownedViewpoints[name='BlaBlaInstance']/@ownedRepresentations[name='DecisionTableDeclaration']/@ownedLineMappings[name='Decision']">
<variables name="root" documentation="The semantic root element of the table."/>
<variables name="element" documentation="The semantic currently edited element."/>
<variables name="container" documentation="The semantic element corresponding to the view container."/>
</ownedCreateLine>
<ownedColumnMappings name="Column" headerLabelExpression="[name + ' : ' + 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="[val/]" useDomainClass="true" columnFinderExpression="[column/]" domainClass="ColumnAssignment"/>
</ownedRepresentations>
</ownedViewpoints>
</description:Group>
I do get the correct number of lines and the column are labelled as expected but the cells are empty and I did not find how to fill the following properties properly:
- line finder
- column finder
- Label expression.
Does someone have a clue or an example to follow
Thanks for your time
Steve
[Updated on: Tue, 19 July 2016 07:55] by Moderator
|
|
|
Re: Can't get crosstable working [message #1738282 is a reply to message #1738280] |
Mon, 18 July 2016 12:03   |
Eclipse User |
|
|
|
Hello,
Here is the documentation about Intersection Mappings definition [1].
It seems that the only missing field is the line finder expression. I
guess that in your metamodel, the reference columnAssignements (there is
a typo here) in Decision is a "containment" reference so the line finder
expression should only be "[eContainer()/]".
In "use Domain class" mode, as the cell in your tab represent a semantic
element, you need to set the line finder expression.
Regards,
Steve
[1]
https://www.eclipse.org/sirius/doc/specifier/tables/Tables.html#intersection_mapping
Le 18/07/2016 à 17:42, Steve Hostettler a écrit :
> Hi,
>
> I read the table documentation as well as the cross table specific
> documentation but I can't get it working.
>
> I do have an Xtext Textual language and for a small subset of it I would
> like to use Cross-Tables
>
> The metamodel is the following
>
> DecisionTableDeclaration
> columnsDeclaration : ColumnDeclaration
> decisions : Decision
> ColumnDeclaration
> name : EString
> typeName : EString
> Decision
> columnAssignements : ColumnAssignment
> ColumnAssignment:
> column : ColumnDeclaration
> val : EString
>
>
> Here is the model instance
>
> decision table {
> column col1 : string,
> column col2 : string,
> column col3 : string
>
> decision : col1 = "val11", col2 = "val12";
> decision : col1 = "val21", col2 = "val22";
> decision : col1 = "val31", col2 = "val32";
> decision : col1 = "val41", col2 = "val42"
> }
>
>
> The viewpoint decription currently looks like:
>
> <?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="wkfs" version="11.0.0.201601261200">
> <ownedViewpoints name="WkfsInstance" modelFileExtension="wkfs ecore">
> <ownedRepresentations xsi:type="description_1:CrossTableDescription"
> name="DecisionTableDeclaration" domainClass="DecisionTableDeclaration">
> <metamodel href="http://www.wkfsfrc.com/dsl/Wkfs#/"/>
> <ownedLineMappings name="Decision" domainClass="Decision"
> headerLabelExpression="D"/>
> <ownedCreateLine
> mapping="//@ownedViewpoints[name='WkfsInstance']/@ownedRepresentations[name='DecisionTableDeclaration']/@ownedLineMappings[name='Decision']">
>
> <variables name="root" documentation="The semantic root element
> of the table."/>
> <variables name="element" documentation="The semantic currently
> edited element."/>
> <variables name="container" documentation="The semantic element
> corresponding to the view container."/>
> </ownedCreateLine>
> <ownedColumnMappings name="Column" headerLabelExpression="[name +
> ' : ' + typeName/]" domainClass="ColumnDeclaration"/>
> <intersection name="Value"
> lineMapping="//@ownedViewpoints[name='WkfsInstance']/@ownedRepresentations[name='DecisionTableDeclaration']/@ownedLineMappings[name='Decision']"
> columnMapping="//@ownedViewpoints[name='WkfsInstance']/@ownedRepresentations[name='DecisionTableDeclaration']/@ownedColumnMappings.0"
> labelExpression="[val/]" useDomainClass="true"
> columnFinderExpression="[column/]" domainClass="ColumnAssignment"/>
> </ownedRepresentations>
> </ownedViewpoints>
> </description:Group>
>
>
> I do get the correct number of lines and the column are labelled as
> expected but the cells are empty and I did not find how to fill the
> following properties properly:
> - line finder
> - column finder
> - Label expression.
>
> Does someone have a clue or an example to follow
>
> Thanks for your time
> Steve
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.03838 seconds