Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EVL: Defining more than one context with the same name in a module
EVL: Defining more than one context with the same name in a module [message #1732394] Mon, 16 May 2016 19:32 Go to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 126
Registered: December 2015
Senior Member
Hi all,

I have an EVL module which has defined contexts like "A" more than one. Of course, all of the constraints of the defined "A" contexts are different, i.e., there is no common constraints between contexts with the same names:

context A {

	...
}

context A {
	constraint X {
		...
	}
}

context B {
	constraint Y {
		check: self.satisfies('X', ...) // Erroneous: constraint X not found
		... 
	}
}


1) Does the above scenario is valid for a module definition in the EVL language?
2) An strange error, here in the constraint 'Y' in the context B, Constraint 'X' not found! , is displayed during the launch of the above module while the 'X' constraint is defined in one of those contexts which have the same names. Of course, this is a problem for constraints which are defined in other contexts (here context A) than the satisfaction statement used context (here context B)!
Is there any trick to resolve this issue and yet keep the above situation? In other words, is there a statement similar to Context.allInstances().exists(c | c.satisfies('X', ...)) for replacing the statement self.satisfies('X', ...) in the constraint 'Y'.

Best regards,
Alireza

[Updated on: Tue, 17 May 2016 12:13]

Report message to a moderator

Re: EVL: Defining more than one context with the same name in a module [message #1732443 is a reply to message #1732394] Tue, 17 May 2016 11:44 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 475
Registered: January 2010
Senior Member
A and B are different types: are you sure that the "self" of type B in constraint Y is an instance of type A as well?

This should only work if B is a subtype of A, I think.

[Updated on: Tue, 17 May 2016 11:38]

Report message to a moderator

Re: EVL: Defining more than one context with the same name in a module [message #1732445 is a reply to message #1732443] Tue, 17 May 2016 11:39 Go to previous messageGo to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 126
Registered: December 2015
Senior Member
Yes, type B is independent of the type A, i.e., they have different types. Also, the type of self in context B and constraint Y is B not A! Actually, I want to make the context A as a prerequisite to the evaluation of context B.

[Updated on: Tue, 17 May 2016 11:50]

Report message to a moderator

Re: EVL: Defining more than one context with the same name in a module [message #1732446 is a reply to message #1732443] Tue, 17 May 2016 11:53 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 475
Registered: January 2010
Senior Member
We don't have any explicit way in EVL of disabling entire contexts based on others. As far as I know, we only have guards for disabling constraints on a per-element basis.

One thing you could do to emulate this is to use "A.all.forAll(a|a.satisfies('X'))" as the guard for a "ContextEnabled" constraint in B, and then have the other constraints in B check if "ContextEnabled" is satisfied.
Re: EVL: Defining more than one context with the same name in a module [message #1732455 is a reply to message #1732446] Tue, 17 May 2016 12:23 Go to previous message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 126
Registered: December 2015
Senior Member
Dear Antonio,

Great!
Thank you very much. This solved my problem.

Best regards,
Alireza
Previous Topic:EOL: How to create a stereotype in an existing UML profile
Next Topic:EVL: An stack overflow exception error!
Goto Forum:
  


Current Time: Tue Jun 19 13:03:02 GMT 2018

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

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

Back to the top