Declaring objects of enum types within EOL scripts [message #531925] |
Thu, 06 May 2010 13:48 |
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 |
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 #531928 is a reply to message #531927] |
Thu, 06 May 2010 14:14 |
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 |
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 #588900 is a reply to message #531927] |
Thu, 06 May 2010 14:14 |
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03778 seconds