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 #588860] Thu, 06 May 2010 09: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
Previous Topic:Why isn't my model recognised?
Next Topic:Declaring objects of enum types within EOL scripts
Goto Forum:
  


Current Time: Wed Aug 20 20:31:08 EDT 2014

Powered by FUDForum. Page generated in 0.02204 seconds