Skip to main content



      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 15:32 Go to next message
Eclipse UserFriend
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 08:13] by 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 07:44 Go to previous messageGo to next message
Eclipse UserFriend
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 07:38] by 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 07:39 Go to previous messageGo to next message
Eclipse UserFriend
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 07:50] by 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 07:53 Go to previous messageGo to next message
Eclipse UserFriend
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 08:23 Go to previous message
Eclipse UserFriend
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: Sun Jul 27 13:14:21 EDT 2025

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

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

Back to the top