Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » GMT (Generative Modeling Technologies) » [Epsilon] ! Operator
[Epsilon] ! Operator [message #383627] Tue, 10 June 2008 16:02 Go to next message
Anne is currently offline AnneFriend
Messages: 37
Registered: July 2009
Member
Hello,

In EOL I am trying to invoke an operation performing checks on the same
model element type for several models. The following code returns an error
when using the ! operator :

var tmp_model := ATMModel;

tmp_model.checkOp();

operation Any checkOp() {
self!Property.println();
-- returns: ' Undefined variable, type or model: 'self!Property' '

self.hasType('Property');
-- ok, has expected result

ATMModel!Property.println();
-- ok as well, but I don't want to hardcode ATMModel here
}

Is there a workaround for this?

Thank you in advance,
Anne
Re: [Epsilon] ! Operator [message #383888 is a reply to message #383627] Tue, 10 June 2008 17:26 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Anne,

When you have multiple models of the same metamodel in an Epsilon
program you can use the "alias" feature. For example, if you have
UMLModel1 and UMLModel2, by setting their aliases (through the launch
configuration dialog) to UMLModel, you can then call
UMLModel!Class.allInstances() and this will return all the instances of
the Class metaclass both in UMLModel1 and UMLModel2.

Does this solve your problem?

Cheers,
Dimitrios

Anne Keller wrote:
> Hello,
>
> In EOL I am trying to invoke an operation performing checks on the same
> model element type for several models. The following code returns an
> error when using the ! operator :
> var tmp_model := ATMModel;
>
> tmp_model.checkOp();
>
> operation Any checkOp() {
> self!Property.println(); -- returns: ' Undefined variable, type or
> model: 'self!Property' '
>
> self.hasType('Property'); -- ok, has expected result
>
> ATMModel!Property.println();
> -- ok as well, but I don't want to hardcode ATMModel here
> }
>
> Is there a workaround for this?
>
> Thank you in advance,
> Anne
>
>
>
Re: [Epsilon] ! Operator [message #383889 is a reply to message #383888] Tue, 10 June 2008 20:46 Go to previous message
Anne is currently offline AnneFriend
Messages: 37
Registered: July 2009
Member
Dear Dimitrios,

thank you very much for your quick reply.

This works as a solution for now.

Regards,
Anne
Re: [Epsilon] ! Operator [message #617737 is a reply to message #383627] Tue, 10 June 2008 17:26 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Anne,

When you have multiple models of the same metamodel in an Epsilon
program you can use the "alias" feature. For example, if you have
UMLModel1 and UMLModel2, by setting their aliases (through the launch
configuration dialog) to UMLModel, you can then call
UMLModel!Class.allInstances() and this will return all the instances of
the Class metaclass both in UMLModel1 and UMLModel2.

Does this solve your problem?

Cheers,
Dimitrios

Anne Keller wrote:
> Hello,
>
> In EOL I am trying to invoke an operation performing checks on the same
> model element type for several models. The following code returns an
> error when using the ! operator :
> var tmp_model := ATMModel;
>
> tmp_model.checkOp();
>
> operation Any checkOp() {
> self!Property.println(); -- returns: ' Undefined variable, type or
> model: 'self!Property' '
>
> self.hasType('Property'); -- ok, has expected result
>
> ATMModel!Property.println();
> -- ok as well, but I don't want to hardcode ATMModel here
> }
>
> Is there a workaround for this?
>
> Thank you in advance,
> Anne
>
>
>
Re: [Epsilon] ! Operator [message #617738 is a reply to message #383888] Tue, 10 June 2008 20:46 Go to previous message
Anne is currently offline AnneFriend
Messages: 37
Registered: July 2009
Member
Dear Dimitrios,

thank you very much for your quick reply.

This works as a solution for now.

Regards,
Anne
Previous Topic:[Epsilon] ! Operator
Next Topic:OAW - Type Casting with XTend
Goto Forum:
  


Current Time: Thu Apr 25 13:23:04 GMT 2024

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

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

Back to the top