Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL Query and Liflines(Problem of OCL to find an existing method)
OCL Query and Liflines [message #496515] Tue, 10 November 2009 12:09 Go to next message
No real name is currently offline No real nameFriend
Messages: 1
Registered: November 2009
Junior Member
Hello

I try to create a query but it s refused by the parser and I dont know why

Here ist de code

oclexp = "(self.getRepresents())";
			EObjectCondition  condition = new OCLConstraintCondition(oclexp, UMLPackage.Literals.LIFELINE);

			Set queryresult = Collections.EMPTY_SET;
			try {
				queryresult = UMLModeler.getQueryHelper().executeQuery(model, condition, new NullProgressMonitor());
			} catch (InterruptedException e) {
				//do not care
			}



It states that the Method getRepresents does not exist altough if i look up lifeline in the api there is of course this function

Thanks for help!
Re: OCL Query and Liflines [message #496953 is a reply to message #496515] Wed, 11 November 2009 20:31 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Alexander

OCL supports use of the specifications of model elements rather than
their implementation.

Lifeline has a 'represents' property so you probably want to use
'self.represents'.

Regards

Ed Willink

alexander.kabanov@gmx.de wrote:
> Hello
>
> I try to create a query but it s refused by the parser and I dont know
> why
>
> Here ist de code
>
>
> oclexp = "(self.getRepresents())";
> EObjectCondition condition = new
> OCLConstraintCondition(oclexp, UMLPackage.Literals.LIFELINE);
>
> Set queryresult = Collections.EMPTY_SET;
> try {
> queryresult =
> UMLModeler.getQueryHelper().executeQuery(model, condition, new
> NullProgressMonitor());
> } catch (InterruptedException e) {
> //do not care
> }
>
>
>
> It states that the Method getRepresents does not exist altough if i
> look up lifeline in the api there is of course this function
>
> Thanks for help!
>
Previous Topic:OCL query for Coupling between Object
Next Topic:Identical model elements
Goto Forum:
  


Current Time: Fri Mar 29 14:22:33 GMT 2024

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

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

Back to the top