Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EVL(Graphical Editor Validation Problem)
EVL [message #1023868] Mon, 25 March 2013 10:36 Go to next message
Joshua Nwokeji is currently offline Joshua NwokejiFriend
Messages: 94
Registered: January 2013
Member
Dear All,

I am having some problem with validating graphical editor I created with EuGeNia. I repeated the tutorial in [1], and it worked except that it didnt give me the option for a quick fix.

I tried same with a usecase_diagram graphical editor I created with EuGeNia, but it didnt work. The validation for the usecase_diagram is similar to the EVL in [1] and [2], i.e. check that each Actor has a name, each Usecase starts with a capital letter, and the Link must link the same e.g. Usecase to Usecase or Actor to Actor. I simply coppied the code in [1] and pasted into my usecase.evl, but changed the e-classs to suit my .emf file, e.g. instead of Folder I put Actor, in adding the extensions I made sure that I replaced filesystem with usecase. However this did not work.

Please I need some help, may be I am not getting it right. I have also seen the Screencast in [2].


[1] http://www.eclipse.org/epsilon/doc/articles/evl-gmf-integration/

[2] http://www.eclipse.org/epsilon/cinema/

Regards
Joshua
Re: EVL [message #1023880 is a reply to message #1023868] Mon, 25 March 2013 11:17 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Dear Joshua,

From your message, I understand that invalid model elements are properly detected, but that their quick fixes are unavailable. Is that right?

Can you post your .evl file over here, so we may have a look?

Regards,
Antonio
Re: EVL [message #1023910 is a reply to message #1023880] Mon, 25 March 2013 12:51 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Joshua,

Based on past experience, if constraints work but fixes don't it's almost certainly a case of a bad markerType (org.eclipse.epsilon.eugenia.examples.filesystem.diagram.diagnostic in the article, need to replace it with the markerType of your editor). Could you please double-check that the markerType you're using exists/is the correct one?

Cheers,
Dimitris
Re: EVL [message #1023924 is a reply to message #1023910] Mon, 25 March 2013 13:22 Go to previous messageGo to next message
Joshua Nwokeji is currently offline Joshua NwokejiFriend
Messages: 94
Registered: January 2013
Member
Dear Antonio and Dimitris!
Thanks for your reply.

First of all I validated the filesystem editor by repeating the example in [1, 2] in a new workspace, and it worked fine, but didnt give me the quick fix option.

Then I followed the same steps (provided in the filesystem tutorial in [1, 2] ) to validate my own Usecase_diagram graphics editor, but they (both the validation and the quick fixes)did not work.

Below is my .evl. I have also attached the Ecore diagram, perhaps it might help

context Actor {

constraint HasName {

check : self.name.isDefined()

message : 'Unnamed ' + self.eClass().name + ' not allowed'

}

}

context Usecase {

critique NameStartsWithCapital {

guard : self.satisfies('HasName')

check : self.name.firstToUpperCase() = self.name

message : 'Usecase ' + self.name +
' should start with an upper-case letter'

fix {

title : 'Rename to ' + self.name.firstToUpperCase()

do {
self.name := self.name.firstToUpperCase();
}
}

}

}

context Link {

constraint MustLinkSame {

check : self.source.eClass() = self.target.eClass()

message : 'Cannot synchronize a ' + self.source.eClass().name
+ ' with a ' + self.target.eClass().name

fix {

title : 'Synchronize with another ' +
self.source.eClass().name

do {

var target := UserInput.choose('Select target',
_Model.getAllOfType(self.source.eClass().name));

if (target.isDefined()) self.target := target;

}

}

}

}
  • Attachment: Usecase.png
    (Size: 30.49KB, Downloaded 177 times)
Re: EVL [message #1023927 is a reply to message #1023924] Mon, 25 March 2013 13:28 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Joshua,

Usecase doesn't seem to be a sub-class of Actor in your metamodel so the following line should be commented out (see the EVL chapter of the Epsilon book for the semantics of satisfies(...))

guard : self.satisfies('HasName')

If this doesn't work, could you please zip and post the relevant Eclipse projects here so that I can have a look?

Cheers,
Dimitris
Re: EVL [message #1023947 is a reply to message #1023927] Mon, 25 March 2013 14:16 Go to previous messageGo to next message
Joshua Nwokeji is currently offline Joshua NwokejiFriend
Messages: 94
Registered: January 2013
Member
Dear Dimitris,

Thanks for your help but I have commented out that line, and it didnt work, please find attached the zip file for my project.

Regards
Joshua
  • Attachment: Archive.zip
    (Size: 677.76KB, Downloaded 213 times)
Re: EVL [message #1023960 is a reply to message #1023947] Mon, 25 March 2013 14:46 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Joshua,

The namespaceURI in your constraintBinding does not match the namespaceURI of your metamodel (should be http://UsedCase/1.0 instead). Also, the markerType should be usecase.example.diagram.diagnostic instead of its current value.

Cheers,
Dimitris
Re: EVL [message #1024057 is a reply to message #1023960] Mon, 25 March 2013 18:26 Go to previous messageGo to next message
Joshua Nwokeji is currently offline Joshua NwokejiFriend
Messages: 94
Registered: January 2013
Member
Dear Dimitris,

Thanks, this is helpful, but another problem occured. I made the changes you suggested including changing the markerTypes for the two MarkerResolutionGenerator to "usecase.example.diagram.diagnostic" (or shpould I have changed only one?).

This worked for the uppercase constraint (though it didnt give me an option for a quick fix), but instead of valiating the MustLinksame Constraint it raised an exception please see attached.

regards
Joshua
Re: EVL [message #1027914 is a reply to message #1024057] Wed, 27 March 2013 15:37 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Hi Joshua,

The error message is saying that you're referring to the "source" feature in Link, which does not exist according to your metamodel. Links seem to have the "from" and "to" features, not the "source" and "target" features you're using in the EVL file.

Regards,
Antonio
Re: EVL [message #1036344 is a reply to message #1027914] Mon, 08 April 2013 08:56 Go to previous messageGo to next message
Joshua Nwokeji is currently offline Joshua NwokejiFriend
Messages: 94
Registered: January 2013
Member
Dear Antonio,

Sorry for the late reply, I have been on Easter Holiday. Thanks very much, the problem has now been resolved except the quick fix issues.

The error message gave me the quick fix option but when I clicked on it, it says "no quick fix available". While the warning message did not give me any quich fix option.

Please how do I resolve this?

Regards
Joshua
Re: EVL [message #1036666 is a reply to message #1036344] Mon, 08 April 2013 17:13 Go to previous message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

According to Dimitris, it may be due to setting up the markerType extension incorrectly. Did you check his instructions?

If you have, and it still doesn't work for you, please send us a project that we can try out to see if it's a bug in Epsilon or some other issue in your code or plugin.xml.
Previous Topic:Test EGL Templates using EUnit
Next Topic:Missing pieces with xtext and eugenia
Goto Forum:
  


Current Time: Thu Mar 28 12:04:50 GMT 2024

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

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

Back to the top