Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCLHelper.getSyntaxHelp for properties on association ends(syntax help for member ends.)
OCLHelper.getSyntaxHelp for properties on association ends [message #1260715] Sat, 01 March 2014 20:41 Go to next message
Pieter Martin is currently offline Pieter MartinFriend
Messages: 14
Registered: July 2013
Junior Member
Hi,

I am trying to retrieve all properties that can be navigated to from a Classifier.

I am successfully involking OCLHelper.getSyntaxHelp but it only returns the attributes owned by the context Classifier.

It does not return the member ends of associations where the association is the owner.

I had a look at the code and it returns TypeUtil.getAttributes(environment, eClass) which will only return attributes belong to the owning classifier.
Yet it is common to navigate to member ends that belong to the association.

Is there some way to get member ends as choices also?

Thanks
Pieter
Re: OCLHelper.getSyntaxHelp for properties on association ends [message #1261626 is a reply to message #1260715] Sun, 02 March 2014 21:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4150
Registered: July 2009
Senior Member
HI

If you use the Pivot OCL rather than the Classic OCL, you will find that
the additional metamodel loading phase enables all properties are
treated equally thereby solving your problem.

This is an example of the difficulties that motivate the migration to
the pivot for which syntax help is autogenerated by Xtext rather than by
manual code whose heuristics may not be perfect.

If you want to fix the Classic code submit a patch and JUnit tests that
demonstrate the fix.

Regards

Ed Willink



On 02/03/2014 20:32, Pieter Martin wrote:
> Hi,
>
> I am trying to retrieve all properties that can be navigated to from a
> Classifier.
>
> I am successfully involking OCLHelper.getSyntaxHelp but it only
> returns the attributes owned by the context Classifier.
>
> It does not return the member ends of associations where the
> association is the owner.
>
> I had a look at the code and it returns
> TypeUtil.getAttributes(environment, eClass) which will only return
> attributes belong to the owning classifier.
> Yet it is common to navigate to member ends that belong to the
> association.
>
> Is there some way to get member ends as choices also?
>
> Thanks
> Pieter
Re: OCLHelper.getSyntaxHelp for properties on association ends [message #1261986 is a reply to message #1260715] Mon, 03 March 2014 06:26 Go to previous messageGo to next message
Pieter Martin is currently offline Pieter MartinFriend
Messages: 14
Registered: July 2013
Junior Member
Thanks, I'll investigate the Pivot OCL.
Regards
Pieter
Re: OCLHelper.getSyntaxHelp for properties on association ends [message #1265938 is a reply to message #1261986] Thu, 06 March 2014 19:23 Go to previous messageGo to next message
Pieter Martin is currently offline Pieter MartinFriend
Messages: 14
Registered: July 2013
Junior Member
Hi,

I have managed to get the pivot parser going in a standalone environment. However I can not see how to get syntax help as per the previous OCLHelper.getSyntaxHelp. The javadoc says "A utility object that provides OCL syntax completion suggestions for OCL" but I do not see how to do it.

Is this available in a standalone environment?

Further I noticed the xtext pivot code still looks a tad fresh. Lots of commented out sections etc and the odd "example" namespace.
Is it adviced to use the pivot model rather than the old way. It is a lot of work to migrate so just checking if it is the prefered code for others to use at the moment?


Thanks
Pieter
Re: OCLHelper.getSyntaxHelp for properties on association ends [message #1265985 is a reply to message #1265938] Thu, 06 March 2014 20:53 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4150
Registered: July 2009
Senior Member
Hi

If you are after 'production qulaity' do not use the Pivot; the
'examples' means experimental. You should only use it if you are
prepared to endure hopefully only a little pain.

However the pivot opens the door to much more and is where the
auto-generation for OCL 2.5 is evolving.

Unfortunately my timescales keep slipping. Originally it was going to be
non-examples in Juno, then Kepler, then Luna .. now Mars. Sorry I get
too many distractions.

Nearly everything is available standalone. The main JUnit launch has
about 505 standalone tests that gets augmented with a further 20 for plugin.

Regards

Ed Willink


On 06/03/2014 19:23, Pieter Martin wrote:
> Hi,
>
> I have managed to get the pivot parser going in a standalone
> environment. However I can not see how to get syntax help as per the
> previous OCLHelper.getSyntaxHelp. The javadoc says "A utility object
> that provides OCL syntax completion suggestions for OCL" but I do not
> see how to do it.
>
> Is this available in a standalone environment?
>
> Further I noticed the xtext pivot code still looks a tad fresh. Lots
> of commented out sections etc and the odd "example" namespace.
> Is it adviced to use the pivot model rather than the old way. It is a
> lot of work to migrate so just checking if it is the prefered code for
> others to use at the moment?
>
>
> Thanks
> Pieter
Re: OCLHelper.getSyntaxHelp for properties on association ends [message #1266444 is a reply to message #1265985] Fri, 07 March 2014 13:20 Go to previous messageGo to next message
Pieter Martin is currently offline Pieter MartinFriend
Messages: 14
Registered: July 2013
Junior Member
Hi,

Ok reckon no time like now for change.

However I still can not find how to get syntax help with the Pivot model.
So far I can load the UML model and parse ocl and end up with a org.eclipse.ocl.examples.pivot.ExpressionInOCL. I see it implements org.eclipse.ocl.examples.pivot.util.Visitable so the visitor pattern from before will work.

Its just the syntax suggestion part that I can not find.
Can you please point me in the right direction?

Thanks
Pieter
Re: OCLHelper.getSyntaxHelp for properties on association ends [message #1266478 is a reply to message #1266444] Fri, 07 March 2014 14:06 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4150
Registered: July 2009
Senior Member
Hi

org.eclipse.ocl.examples.test.xtext.CompletionProposalTests

might provide some clues.

The old SyntaxHelper may be one of the many APIs that I have yet to
rework to exploit Xtext.

Regards

Ed


On 07/03/2014 13:20, Pieter Martin wrote:
> Hi,
>
> Ok reckon no time like now for change.
>
> However I still can not find how to get syntax help with the Pivot model.
> So far I can load the UML model and parse ocl and end up with a
> org.eclipse.ocl.examples.pivot.ExpressionInOCL. I see it implements
> org.eclipse.ocl.examples.pivot.util.Visitable so the visitor pattern
> from before will work.
>
> Its just the syntax suggestion part that I can not find.
> Can you please point me in the right direction?
>
> Thanks
> Pieter
Re: OCLHelper.getSyntaxHelp for properties on association ends [message #1266510 is a reply to message #1266478] Fri, 07 March 2014 14:56 Go to previous message
Pieter Martin is currently offline Pieter MartinFriend
Messages: 14
Registered: July 2013
Junior Member
Thanks
Pieter
Previous Topic:Constraints with OCLInEcore across multiple model files
Next Topic:Complete OCL file used for GMF validation
Goto Forum:
  


Current Time: Sun Nov 23 19:00:00 GMT 2014

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

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