Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Can't get crosstable working
Can't get crosstable working [message #1738280] Mon, 18 July 2016 15:42 Go to next message
Steve Hostettler is currently offline Steve HostettlerFriend
Messages: 81
Registered: June 2016
Member
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 11:55]

Report message to a moderator

Re: Can't get crosstable working [message #1738282 is a reply to message #1738280] Mon, 18 July 2016 16:03 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
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


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Can't get crosstable working [message #1738286 is a reply to message #1738282] Mon, 18 July 2016 16:18 Go to previous message
Steve Hostettler is currently offline Steve HostettlerFriend
Messages: 81
Registered: June 2016
Member
Hello and thank you for your help.

Here is a screenshot of the model that might help https://s32.postimg.org/cebfpbgmp/Capture.png

I did add the line finder but now when I validate I get the following errors:
- unrecognized variable val
- unrecognized variable column

So I guess that the column finder and the label are not correct.
To be honest reading the intersection mapping section does not help me much. I am probably missing an important thing.

Thanks in advance for your help
Previous Topic:Saving a second (and third) model loaded into one diagram
Next Topic:Load an existing model instance in Java Service Class
Goto Forum:
  


Current Time: Thu Apr 25 12:44:41 GMT 2024

Powered by FUDForum. Page generated in 0.02775 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top