|
|
Re: Edit->Validate and EVL in EOL [message #759502 is a reply to message #759485] |
Mon, 28 November 2011 20:05 |
Paulo Alexandre Messages: 17 Registered: November 2011 |
Junior Member |
|
|
Hi Dimitrius
Thank you for the answer.
I didn't mean that (<<this step to be performed automatically after validation is performed>>) but it would be a interesting possibily. Is there a way to do that ?
Originally, there are two steps;
1->User click Edit->Validate (the eclipse will read and execute my evl constraints)
2->User chooses an action by a Wizard
The step 2 is an action in wizard (piece of ewl file) must be performed just if the step 1 is done. Until now, I couldn't think in a way to do it.
Anyway, thanks for the reply!
[Updated on: Mon, 28 November 2011 20:06] Report message to a moderator
|
|
|
Re: Edit->Validate and EVL in EOL [message #782948 is a reply to message #759502] |
Tue, 24 January 2012 19:43 |
|
Hi Paulo,
From what I understand is more like a condition (pseudo code):
if (the user has validated) then
Wizard.enable = true
else
Wizard.enable = false
end
So basically you need to save a flag to know if the user has executed the validation. You could add some code at the end of the operation that invokes the validation (in java) to enable the wizard entry in the menu. Another way would be to use a properties file. This is the "java" way of storing information in a file from which you can later retrieve it. Much like saving your preferences. A before add some code to save the "validated" flag to a file. Then, add some code to the operation that invokes the wizard and query the file for the flag value. If not set, you could show an error message instructing the user to validate the model first.
Hope it helps,
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
|
Re: Edit->Validate and EVL in EOL [message #820144 is a reply to message #782948] |
Tue, 13 March 2012 19:42 |
Paulo Alexandre Messages: 17 Registered: November 2011 |
Junior Member |
|
|
Hi, Horacio Hoyos
first, I thank you for your support! It is of great help.
That pseudocode depicts almost perfectly my idea. But I'm not calling any java code. I'm just using just epsilon and a single .evl file (and wizards through EWL too).
I've had this idea:
In each evl constraint , in the 'check' I've added a dumb function like
context AnyClass
{
constraint anyConstraint
{
check: dumb(self.name<>'')//self.name<>'' is the real constraint I want to check
message: 'Any message'
}
}
operation dumb(x:Boolean, a:AnyClass)
{
//storage the value of x in any variable
a.error:=x; //It raises an error!!!!
return x;
}
So, every time any constraint was checked the dumb function would be called allowing to store the value of the verification.
But, at the line ''a.error:=x;'' an error is raised.
In few words, this is the error:
an runtime erro was raised during the evaluation ... Internal Error: java.lang.IllegalStateException: Cannot modify resource set without a write transaction
Apparently, I need to declare a write transaction but I have absolutely no idea of where to start.
Anyway, I thank you again for your time and attention!
Best regards
|
|
|
Re: Edit->Validate and EVL in EOL [message #820247 is a reply to message #820144] |
Tue, 13 March 2012 22:37 |
|
If I understood correctly, I believe that your problem is that the EVL script is run with a read-only view of the models in some circumstances. Your script *may* work when run from the tree-based editor Ecore generated, but not from a GMF-based editor.
In fact, I reported a bug regarding that issue a while ago, but regarding the fact that read-only views should be used everywhere, and not just in some places:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=287542
However, we concluded that it was probably an upstream issue. In any case, I'd advise you against modifying your models in an EVL script. It doesn't work everywhere, and it feels a bit wrong. I don't think you should be modifying your models during a validation.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04034 seconds