Skip to main content



      Home
Home » Modeling » Epsilon » EVL: Constraint cross-referencing
EVL: Constraint cross-referencing [message #1717457] Mon, 14 December 2015 02:38 Go to next message
Eclipse UserFriend
Hi,

How can I refer to a specific constraint which is defined in the other context?
For example, in the following code, the c2 constraint must satisfy the c1 constraint of context1. Here, the code
self.satisfies("context1:c1")
is not functional!

context context1 {
	constraint c1 {
		.
		.
		.
	} 
}

...

context context2 {
	constraint c2 {
		guard: self.satisfies("context1:c1") and ...
		.
		.
		.
	}
}


Kind regards,
Alireza

[Updated on: Sat, 30 January 2016 09:35] by Moderator

Re: EVL: Constraint cross-referencing [message #1717480 is a reply to message #1717457] Mon, 14 December 2015 05:18 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alireza,

Constraint names in satisfies() cannot be qualified i.e. you should use self.satisfies("c1") instead and EVL will resolve the targeted constraint at runtime.

Cheers,
Dimitris
Re: EVL: Constraint cross-referencing [message #1717489 is a reply to message #1717480] Mon, 14 December 2015 06:09 Go to previous messageGo to next message
Eclipse UserFriend
Dear Dimitris,

I used the unqualified format of the constraint, but the error message is "constraint c1 not found"!

Kind regards,
Alireza

[Updated on: Mon, 14 December 2015 06:09] by Moderator

Re: EVL: Constraint cross-referencing [message #1717491 is a reply to message #1717489] Mon, 14 December 2015 06:11 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alireza,

This means that the model element on which you're calling satisfies("c1") is not of a type that defines a "c1" constraint.

Cheers,
Dimitris
Re: EVL: Constraint cross-referencing [message #1717492 is a reply to message #1717491] Mon, 14 December 2015 06:15 Go to previous messageGo to next message
Eclipse UserFriend
Dear Dimitris,

You're right. Again, the error message for the statement context1.satisfies("c1") remains the same!

Kind regards,
Alireza
Re: EVL: Constraint cross-referencing [message #1717494 is a reply to message #1717492] Mon, 14 December 2015 06:22 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alireza,

Could you please provide a minimal example [1] I can use to reproduce this?

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/

Re: EVL: Constraint cross-referencing [message #1717496 is a reply to message #1717494] Mon, 14 December 2015 06:31 Go to previous messageGo to next message
Eclipse UserFriend
Dear Dimitris,

Thank you very much.
As you said, the problem resolved by the correct specification of the constraint context.

Kind regards,
Alireza
Re: EVL: Constraint cross-referencing [message #1720904 is a reply to message #1717480] Thu, 21 January 2016 13:00 Go to previous messageGo to next message
Eclipse UserFriend
Dear Dimitris,

Hi,

I have another problem in this topic. Please, consider the following scenario:
context A {
	constraint A1 {
		.
		.
		.
	} 
		.
		.
		.
	constraint An {
		.
		.
		.
	}
}

context B {
	constraint B1 {
		.
		.
		.
	}
		.
		.
		.
	constraint Bm {
		.
		.
		.
	}
}

context C {
	constraint C1 {
		.
		.
		.
	}
		.
		.
		.
	constraint Ck {
		.
		.
		.
	}
}


How to make the context A involved constraints, i.e., A1 through An, a prerequisite for evaluating other contexts' constraints like B and C here?

In other words, I would like to have the execution semantics as (A and B and C), but the execution order must be first A, and then B and C.

I used the statements like,
guard: A.satisfiesAll("A1", ..., "An")


in the guard section of the context B, but the displayed error is:

Method 'satisfiesAll' not found for: A


Please, help me to resolve this problem. Thank you very much.

Best regards,
Alireza
icon5.gif  Re: EVL: How to cross-reference constraints amongst different contexts [message #1724171 is a reply to message #1720904] Mon, 22 February 2016 00:35 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Is there any suggestion or similar trick to solve this problem?

Best regards,
Alireza
Re: EVL: How to cross-reference constraints amongst different contexts [message #1724215 is a reply to message #1724171] Mon, 22 February 2016 05:32 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alireza,

Thanks for the reminder - this somehow fell through the cracks. Your guard should look as follows:

guard: self.satisfiesAll("A1", ..., "An")


Cheers,
Dimitris
Re: EVL: How to cross-reference constraints amongst different contexts [message #1724235 is a reply to message #1724215] Mon, 22 February 2016 07:35 Go to previous message
Eclipse UserFriend
Dear Dimitris,

Thanks a lot for your suggested solution.

Best regards,
Alireza
Previous Topic:query 2 xml files at the same time
Next Topic:EOL: How to parse Boolean
Goto Forum:
  


Current Time: Thu Jul 03 17:30:28 EDT 2025

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

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

Back to the top