Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [Solved]Problem in a constrain
[Solved]Problem in a constrain [message #854815] Tue, 24 April 2012 04:59 Go to next message
Eclipse UserFriend
Hi,

I defined a constrain in my validator package. Although it doesn't give any error, it doesn't work.

@Check
public void checkAtLeastOneFrame(Frame frame)
{
Main m = EcoreUtil2.getContainerOfType(frame, m.class);
List<Frame> frames = EcoreUtil2.getAllContentsOfType(m, Main.class);
if((frames.size<1)){
error("There must be at least one frame", MyDslPackage.Literals.FRAME__NAME);
}
}

When I change frames.size >2 it works but <1 does not work. I wonder what's the problem?

Thanks!!

[Updated on: Tue, 24 April 2012 08:09] by Moderator

Re: [Solved]Problem in a constrain [message #854980 is a reply to message #854815] Tue, 24 April 2012 08:11 Go to previous message
Eclipse UserFriend
The problem is solved by putting MAIN__NAME instead of FRAME__NAME
Previous Topic:Why the cross-reference does not work?
Next Topic:MWE2 workflow component for creating XSD from genmodel?
Goto Forum:
  


Current Time: Tue Nov 04 18:59:05 EST 2025

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

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

Back to the top