Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to access class attribute from outside of class
https://www.eclipse.org/forums/index.php/mv/msg/1106859/1837724/#msg_1837724
I am trying to set a conditional style for my edge based upon a boolean attribute from its source node. Intuitively I assumed that the precondition would be aql: self.sourceNode.eGet(condition) but it gives the error that condition is not a variable. So then using the interpreter I selected my source node and did self.condition which gives me the same error. When I do self.name it works fine, and so does feature:condition when I set the conditional style for the node itself. How come feature:condition works but self.condition does not? And how do I access the boolean condition from my edge in order to set the conditional style for my edge?
I am essentially trying to get the arrow leaving my classes to match the color of the source node as shown in the pic.]]>Thomas Chiang2021-02-04T18:34:04-00:00Re: How to access class attribute from outside of class
https://www.eclipse.org/forums/index.php/mv/msg/1106859/1837749/#msg_1837749
You can try by "casting" the type with .oclAsType(package::Type). Make sure to reference your metamodel in the Metamodels property tab on your Diagram Description.
Regards,
Florian]]>Florian Barbin2021-02-05T08:34:49-00:00Re: How to access class attribute from outside of class
https://www.eclipse.org/forums/index.php/mv/msg/1106859/1837756/#msg_1837756
Because the method oclAtType() seems to return a null for me. In my ecore metamodel I haven't set these variables:
Because when I do the generated code gives me errors. As I am debugging is it because the generated code does not actually create the type and I need to define the type in Java?]]>Thomas Chiang2021-02-05T14:48:20-00:00