Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Declaring objects of enum types within EOL scripts
Declaring objects of enum types within EOL scripts [message #531925] Thu, 06 May 2010 13:48 Go to next message
Eclipse User
Originally posted by: c.k.holmes.lboro.ac.uk

Hi,
I have a metamodel containing a class:
class Table extends BlockElement {
attr ColourType backgroundColourName = "WHITE";
val TableCaption caption;
val TableSection[?] head;
val TableSection[?] body;
val TableSection[?] foot;
}
Where:
enum ColourType {
WHITE = 0;
RED = 1;
BLUE = 2;
YELLOW = 3;
ORANGE = 4;
GREEN = 5;
LIMEGREEN = 6;
LIGHTBLUE = 7;
LIGHTSLATEGRAY = 8;
}

I call an operation in an EOL script from ETL (which is run from an Ant
workflow) and want to declare a colour value, e.g.
var ok : Report!ColourType := Report!ColourType#LIMEGREEN;

However, this returns an error 'Report!ColourType not found'. Although I
can do this within the body of an operation:
<snip>
if (match.isMatching()) {
for (row in table.body.row) {
row.paintContents(Report!ColourType#LIMEGREEN);
}
} else {
for (row in table.body.row) {
row.paintContents(Report!ColourType#RED);
}
}
</snip>

So, clearly, the type is being resolved. Is this a problem with my
syntax? How can I declare the variable 'ok' (above) correctly?

Regards
Chris
Re: Declaring objects of enum types within EOL scripts [message #531926 is a reply to message #531925] Thu, 06 May 2010 13:52 Go to previous messageGo to next message
Eclipse User
Originally posted by: c.k.holmes.lboro.ac.uk

Hi,
I intended to show the following code fragment (which runs successfully):
<snip>
if (match.isMatching()) {
for (row in table.body.row) {
row.backgroundColourName := Report!ColourType#LIMEGREEN;
}
} else {
for (row in table.body.row) {
row.backgroundColourName := Report!ColourType#RED;
}
}
</snip>

Regards
Chris

Chris Holmes wrote:
> Hi,
> I have a metamodel containing a class:
> class Table extends BlockElement {
> attr ColourType backgroundColourName = "WHITE";
> val TableCaption caption;
> val TableSection[?] head;
> val TableSection[?] body;
> val TableSection[?] foot;
> }
> Where:
> enum ColourType {
> WHITE = 0;
> RED = 1;
> BLUE = 2;
> YELLOW = 3;
> ORANGE = 4;
> GREEN = 5;
> LIMEGREEN = 6;
> LIGHTBLUE = 7;
> LIGHTSLATEGRAY = 8;
> }
>
> I call an operation in an EOL script from ETL (which is run from an Ant
> workflow) and want to declare a colour value, e.g.
> var ok : Report!ColourType := Report!ColourType#LIMEGREEN;
>
> However, this returns an error 'Report!ColourType not found'. Although I
> can do this within the body of an operation:
> <snip>
> if (match.isMatching()) {
> for (row in table.body.row) {
> row.paintContents(Report!ColourType#LIMEGREEN);
> }
> } else {
> for (row in table.body.row) {
> row.paintContents(Report!ColourType#RED);
> }
> }
> </snip>
>
> So, clearly, the type is being resolved. Is this a problem with my
> syntax? How can I declare the variable 'ok' (above) correctly?
>
> Regards
> Chris
Re: Declaring objects of enum types within EOL scripts [message #531927 is a reply to message #531926] Thu, 06 May 2010 14:07 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Chris,

You've hit https://bugs.eclipse.org/bugs/show_bug.cgi?id=286412 I'm
afraid. Enumerations are not valid EOL types so I'm afraid you'll have
to use the Any workaround (or omit the type altogether) until we get
this fixed.

Cheers,
Dimitris

Chris Holmes wrote:
> Hi,
> I intended to show the following code fragment (which runs successfully):
> <snip>
> if (match.isMatching()) {
> for (row in table.body.row) {
> row.backgroundColourName := Report!ColourType#LIMEGREEN;
> }
> } else {
> for (row in table.body.row) {
> row.backgroundColourName := Report!ColourType#RED;
> }
> }
> </snip>
>
> Regards
> Chris
>
> Chris Holmes wrote:
>> Hi,
>> I have a metamodel containing a class:
>> class Table extends BlockElement {
>> attr ColourType backgroundColourName = "WHITE";
>> val TableCaption caption;
>> val TableSection[?] head;
>> val TableSection[?] body;
>> val TableSection[?] foot;
>> }
>> Where:
>> enum ColourType {
>> WHITE = 0;
>> RED = 1;
>> BLUE = 2;
>> YELLOW = 3;
>> ORANGE = 4;
>> GREEN = 5;
>> LIMEGREEN = 6;
>> LIGHTBLUE = 7;
>> LIGHTSLATEGRAY = 8;
>> }
>>
>> I call an operation in an EOL script from ETL (which is run from an
>> Ant workflow) and want to declare a colour value, e.g.
>> var ok : Report!ColourType := Report!ColourType#LIMEGREEN;
>>
>> However, this returns an error 'Report!ColourType not found'. Although
>> I can do this within the body of an operation:
>> <snip>
>> if (match.isMatching()) {
>> for (row in table.body.row) {
>> row.paintContents(Report!ColourType#LIMEGREEN);
>> }
>> } else {
>> for (row in table.body.row) {
>> row.paintContents(Report!ColourType#RED);
>> }
>> }
>> </snip>
>>
>> So, clearly, the type is being resolved. Is this a problem with my
>> syntax? How can I declare the variable 'ok' (above) correctly?
>>
>> Regards
>> Chris


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: Declaring objects of enum types within EOL scripts [message #531928 is a reply to message #531927] Thu, 06 May 2010 14:14 Go to previous message
Eclipse User
Originally posted by: c.k.holmes.lboro.ac.uk

Hi Dimitris,
At least it wasn't me ... this time ;)

Thanks for your help.
Best Wishes
Chris

Dimitris Kolovos wrote:
> Hi Chris,
>
> You've hit https://bugs.eclipse.org/bugs/show_bug.cgi?id=286412 I'm
> afraid. Enumerations are not valid EOL types so I'm afraid you'll have
> to use the Any workaround (or omit the type altogether) until we get
> this fixed.
>
> Cheers,
> Dimitris
>
> Chris Holmes wrote:
>> Hi,
>> I intended to show the following code fragment (which runs successfully):
>> <snip>
>> if (match.isMatching()) {
>> for (row in table.body.row) {
>> row.backgroundColourName := Report!ColourType#LIMEGREEN;
>> }
>> } else {
>> for (row in table.body.row) {
>> row.backgroundColourName := Report!ColourType#RED;
>> }
>> }
>> </snip>
>>
>> Regards
>> Chris
>>
>> Chris Holmes wrote:
>>> Hi,
>>> I have a metamodel containing a class:
>>> class Table extends BlockElement {
>>> attr ColourType backgroundColourName = "WHITE";
>>> val TableCaption caption;
>>> val TableSection[?] head;
>>> val TableSection[?] body;
>>> val TableSection[?] foot;
>>> }
>>> Where:
>>> enum ColourType {
>>> WHITE = 0;
>>> RED = 1;
>>> BLUE = 2;
>>> YELLOW = 3;
>>> ORANGE = 4;
>>> GREEN = 5;
>>> LIMEGREEN = 6;
>>> LIGHTBLUE = 7;
>>> LIGHTSLATEGRAY = 8;
>>> }
>>>
>>> I call an operation in an EOL script from ETL (which is run from an
>>> Ant workflow) and want to declare a colour value, e.g.
>>> var ok : Report!ColourType := Report!ColourType#LIMEGREEN;
>>>
>>> However, this returns an error 'Report!ColourType not found'.
>>> Although I can do this within the body of an operation:
>>> <snip>
>>> if (match.isMatching()) {
>>> for (row in table.body.row) {
>>> row.paintContents(Report!ColourType#LIMEGREEN);
>>> }
>>> } else {
>>> for (row in table.body.row) {
>>> row.paintContents(Report!ColourType#RED);
>>> }
>>> }
>>> </snip>
>>>
>>> So, clearly, the type is being resolved. Is this a problem with my
>>> syntax? How can I declare the variable 'ok' (above) correctly?
>>>
>>> Regards
>>> Chris
>
>
Re: Declaring objects of enum types within EOL scripts [message #588888 is a reply to message #531925] Thu, 06 May 2010 13:52 Go to previous message
Eclipse User
Originally posted by: c.k.holmes.lboro.ac.uk

Hi,
I intended to show the following code fragment (which runs successfully):
<snip>
if (match.isMatching()) {
for (row in table.body.row) {
row.backgroundColourName := Report!ColourType#LIMEGREEN;
}
} else {
for (row in table.body.row) {
row.backgroundColourName := Report!ColourType#RED;
}
}
</snip>

Regards
Chris

Chris Holmes wrote:
> Hi,
> I have a metamodel containing a class:
> class Table extends BlockElement {
> attr ColourType backgroundColourName = "WHITE";
> val TableCaption caption;
> val TableSection[?] head;
> val TableSection[?] body;
> val TableSection[?] foot;
> }
> Where:
> enum ColourType {
> WHITE = 0;
> RED = 1;
> BLUE = 2;
> YELLOW = 3;
> ORANGE = 4;
> GREEN = 5;
> LIMEGREEN = 6;
> LIGHTBLUE = 7;
> LIGHTSLATEGRAY = 8;
> }
>
> I call an operation in an EOL script from ETL (which is run from an Ant
> workflow) and want to declare a colour value, e.g.
> var ok : Report!ColourType := Report!ColourType#LIMEGREEN;
>
> However, this returns an error 'Report!ColourType not found'. Although I
> can do this within the body of an operation:
> <snip>
> if (match.isMatching()) {
> for (row in table.body.row) {
> row.paintContents(Report!ColourType#LIMEGREEN);
> }
> } else {
> for (row in table.body.row) {
> row.paintContents(Report!ColourType#RED);
> }
> }
> </snip>
>
> So, clearly, the type is being resolved. Is this a problem with my
> syntax? How can I declare the variable 'ok' (above) correctly?
>
> Regards
> Chris
Re: Declaring objects of enum types within EOL scripts [message #588891 is a reply to message #531926] Thu, 06 May 2010 14:07 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Chris,

You've hit https://bugs.eclipse.org/bugs/show_bug.cgi?id=286412 I'm
afraid. Enumerations are not valid EOL types so I'm afraid you'll have
to use the Any workaround (or omit the type altogether) until we get
this fixed.

Cheers,
Dimitris

Chris Holmes wrote:
> Hi,
> I intended to show the following code fragment (which runs successfully):
> <snip>
> if (match.isMatching()) {
> for (row in table.body.row) {
> row.backgroundColourName := Report!ColourType#LIMEGREEN;
> }
> } else {
> for (row in table.body.row) {
> row.backgroundColourName := Report!ColourType#RED;
> }
> }
> </snip>
>
> Regards
> Chris
>
> Chris Holmes wrote:
>> Hi,
>> I have a metamodel containing a class:
>> class Table extends BlockElement {
>> attr ColourType backgroundColourName = "WHITE";
>> val TableCaption caption;
>> val TableSection[?] head;
>> val TableSection[?] body;
>> val TableSection[?] foot;
>> }
>> Where:
>> enum ColourType {
>> WHITE = 0;
>> RED = 1;
>> BLUE = 2;
>> YELLOW = 3;
>> ORANGE = 4;
>> GREEN = 5;
>> LIMEGREEN = 6;
>> LIGHTBLUE = 7;
>> LIGHTSLATEGRAY = 8;
>> }
>>
>> I call an operation in an EOL script from ETL (which is run from an
>> Ant workflow) and want to declare a colour value, e.g.
>> var ok : Report!ColourType := Report!ColourType#LIMEGREEN;
>>
>> However, this returns an error 'Report!ColourType not found'. Although
>> I can do this within the body of an operation:
>> <snip>
>> if (match.isMatching()) {
>> for (row in table.body.row) {
>> row.paintContents(Report!ColourType#LIMEGREEN);
>> }
>> } else {
>> for (row in table.body.row) {
>> row.paintContents(Report!ColourType#RED);
>> }
>> }
>> </snip>
>>
>> So, clearly, the type is being resolved. Is this a problem with my
>> syntax? How can I declare the variable 'ok' (above) correctly?
>>
>> Regards
>> Chris


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: Declaring objects of enum types within EOL scripts [message #588900 is a reply to message #531927] Thu, 06 May 2010 14:14 Go to previous message
Eclipse User
Originally posted by: c.k.holmes.lboro.ac.uk

Hi Dimitris,
At least it wasn't me ... this time ;)

Thanks for your help.
Best Wishes
Chris

Dimitris Kolovos wrote:
> Hi Chris,
>
> You've hit https://bugs.eclipse.org/bugs/show_bug.cgi?id=286412 I'm
> afraid. Enumerations are not valid EOL types so I'm afraid you'll have
> to use the Any workaround (or omit the type altogether) until we get
> this fixed.
>
> Cheers,
> Dimitris
>
> Chris Holmes wrote:
>> Hi,
>> I intended to show the following code fragment (which runs successfully):
>> <snip>
>> if (match.isMatching()) {
>> for (row in table.body.row) {
>> row.backgroundColourName := Report!ColourType#LIMEGREEN;
>> }
>> } else {
>> for (row in table.body.row) {
>> row.backgroundColourName := Report!ColourType#RED;
>> }
>> }
>> </snip>
>>
>> Regards
>> Chris
>>
>> Chris Holmes wrote:
>>> Hi,
>>> I have a metamodel containing a class:
>>> class Table extends BlockElement {
>>> attr ColourType backgroundColourName = "WHITE";
>>> val TableCaption caption;
>>> val TableSection[?] head;
>>> val TableSection[?] body;
>>> val TableSection[?] foot;
>>> }
>>> Where:
>>> enum ColourType {
>>> WHITE = 0;
>>> RED = 1;
>>> BLUE = 2;
>>> YELLOW = 3;
>>> ORANGE = 4;
>>> GREEN = 5;
>>> LIMEGREEN = 6;
>>> LIGHTBLUE = 7;
>>> LIGHTSLATEGRAY = 8;
>>> }
>>>
>>> I call an operation in an EOL script from ETL (which is run from an
>>> Ant workflow) and want to declare a colour value, e.g.
>>> var ok : Report!ColourType := Report!ColourType#LIMEGREEN;
>>>
>>> However, this returns an error 'Report!ColourType not found'.
>>> Although I can do this within the body of an operation:
>>> <snip>
>>> if (match.isMatching()) {
>>> for (row in table.body.row) {
>>> row.paintContents(Report!ColourType#LIMEGREEN);
>>> }
>>> } else {
>>> for (row in table.body.row) {
>>> row.paintContents(Report!ColourType#RED);
>>> }
>>> }
>>> </snip>
>>>
>>> So, clearly, the type is being resolved. Is this a problem with my
>>> syntax? How can I declare the variable 'ok' (above) correctly?
>>>
>>> Regards
>>> Chris
>
>
Previous Topic:Declaring objects of enum types within EOL scripts
Next Topic:Navigation of ref'd associations
Goto Forum:
  


Current Time: Thu Oct 23 12:40:16 GMT 2014

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

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