Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to implement scoping and validation for an element at same time
How to implement scoping and validation for an element at same time [message #1795618] Wed, 26 September 2018 09:00 Go to next message
shubhankar chowdhury is currently offline shubhankar chowdhuryFriend
Messages: 17
Registered: January 2018
Junior Member
Hi,
I have Implemented scoping for an element
contentRef<Dropdown list which match some condition >

element in drop down list has implementation with a value for USED as : USED True/False

drop down list will contain elements with USED as True

So in contentRef dropdown it is contain elements with USED as True

Now if in future , if user changes the USED from True to False it should throw error from validation but it is not throwing


Eg :
Correct Example:
abc {
contentRef measureVal
}

measureVal {
USED True

}
measureValue2{
USED False
}

Now user changes the value of USED in measureVal from True to False then contentRef should throw an error from validation but it is not throwing error from validation.Instead it is just throwing a general error as : "Couldn't resolve reference to EObject 'measureVal'."

Wrong example :

abc {
contentRef measureVal //it will throw error as "Couldn't resolve reference to EObject 'measureVal" but I want customized error message
}

measureVal {
USED False

}
measureValue2{
USED False
}



Re: How to implement scoping and validation for an element at same time [message #1795621 is a reply to message #1795618] Wed, 26 September 2018 09:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14062
Registered: July 2009
Senior Member
you cant, but you can adopt the error message. it s produced by ILinkingDiagnosticMessageProvider. you can return null there



Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to implement scoping and validation for an element at same time [message #1795623 is a reply to message #1795621] Wed, 26 September 2018 09:18 Go to previous messageGo to next message
shubhankar chowdhury is currently offline shubhankar chowdhuryFriend
Messages: 17
Registered: January 2018
Junior Member
Thanks for the reply Christian. Can you provide me an example on how to use ILinkingDiagnosticMessageProvider in this case
Re: How to implement scoping and validation for an element at same time [message #1795625 is a reply to message #1795623] Wed, 26 September 2018 09:23 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14062
Registered: July 2009
Senior Member
no i cant. read the existing code. use a debugger ...

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Given a ANTLRv3 grammar how to create xtext grammar
Next Topic:JAVA HEAP SPACE (OUT OF MEMEORY)
Goto Forum:
  


Current Time: Mon Sep 20 11:52:50 GMT 2021

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

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

Back to the top