Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Scoping same type of objects
Scoping same type of objects [message #1810127] Wed, 31 July 2019 20:46 Go to next message
Daniel San Martín is currently offline Daniel San MartínFriend
Messages: 45
Registered: October 2012
Member
Hello,

I have the following rule:

('mcontroller' mcontroller1 = [DSLManagerController] access=DSLAccess 'mcontroller' mcontroller2 = [DSLManagerController] ';') 


I defined 2 mcontroller objects: controller_1 and controller_2.

So a valid rule can be :

mcontroller controller_1 can-access  mcontroller controller_2


I want to scope the right part of my rule, where accessing the same controller will be an invalid entry or the autocompletition can not reach the controller of the left part of the rule.

For instance:

mcontroller controller_1 can-access  mcontroller controller_1


Should be invalid,

Regards,

Daniel.
Re: Scoping same type of objects [message #1810132 is a reply to message #1810127] Thu, 01 August 2019 04:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Customize scoping.

Wrap delegateGetScope(ctx, ref) into a FilteringScope and Filter the description for the current object there


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Scoping same type of objects [message #1810133 is a reply to message #1810132] Thu, 01 August 2019 04:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Pleas also consider to do this with a validation instead of scoping

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Scoping same type of objects [message #1810149 is a reply to message #1810127] Thu, 01 August 2019 13:36 Go to previous messageGo to next message
Daniel San Martín is currently offline Daniel San MartínFriend
Messages: 45
Registered: October 2012
Member
Thank you for your reply.

Yes, by using a validation rule was pretty simple. Just for curiosity, How should I implement a solution with Scope? I tried some examples but couldn't get it. Do you have a code snippet for guiding me, with some explanations?

Regards,


Daniel.

Re: Scoping same type of objects [message #1810153 is a reply to message #1810149] Thu, 01 August 2019 15:17 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
please give what you have tried

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Creating custom appender for log4j
Next Topic:LSP -> Debugger implementation
Goto Forum:
  


Current Time: Fri Apr 19 19:58:44 GMT 2024

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

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

Back to the top