EVL: Defining more than one context with the same name in a module [message #1732394] |
Mon, 16 May 2016 19:32 |
Alireza Rouhi Messages: 148 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 #1732446 is a reply to message #1732443] |
Tue, 17 May 2016 11:53 |
|
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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.01673 seconds