Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home »  » OCL » New in OCL
New in OCL [message #1477181] Mon, 17 November 2014 17:50 Go to next message
Rafael Durelli is currently offline Rafael DurelliFriend
Messages: 72
Registered: September 2012
Member
Hello guys I'm really new in OCL. When can I find a tutorial or something similar to start to study OCL.


thanks in advance.
Re: New in OCL [message #1477196 is a reply to message #1477181] Mon, 17 November 2014 18:03 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5534
Registered: July 2009
Senior Member
Hi

I don't suppose you thoughht to try the FAQs.

https://wiki.eclipse.org/OCL/FAQ#How_do_I_learn_OCL.3F

or even just Google for Amazon.com

Regards

Ed Willink


On 17/11/2014 17:50, Rafael Durelli wrote:
> Hello guys I'm really new in OCL. When can I find a tutorial or
> something similar to start to study OCL.
>
> thanks in advance.
Re: New in OCL [message #1477209 is a reply to message #1477196] Mon, 17 November 2014 18:20 Go to previous messageGo to next message
Rafael Durelli is currently offline Rafael DurelliFriend
Messages: 72
Registered: September 2012
Member
Thanks, but that was not exactly what I wanted. I wanted a step by step example of how to run the Eclipse OCL. Thanks anyway ....
Re: New in OCL [message #1477296 is a reply to message #1477209] Mon, 17 November 2014 19:57 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5534
Registered: July 2009
Senior Member
Hi

Well if that's what you wanted you should have asked for it.

Try reading the documentation!

Regards

Ed Willink


On 17/11/2014 18:20, Rafael Durelli wrote:
> Thanks, but that was not exactly what I wanted. I wanted a step by step
> example of how to run the Eclipse OCL. Thanks anyway ....
Re: New in OCL [message #1551663 is a reply to message #1477296] Wed, 07 January 2015 19:24 Go to previous messageGo to next message
Tony Chou is currently offline Tony ChouFriend
Messages: 8
Registered: January 2015
Junior Member
Hi Ed -

I am a newbie to OCL too. Could you shed some light on the following (it will be appended for sure) questions?

I first created a new .ocl file from my UML model and was playing around OCL queries to get my feet wet. This is a side effort in conjunction with the need of creating a BIRT report since there are a lot of Row Mapping queries I have to customize there. But just by coming to the OCL editor (Not an xtext one) there are several not-so-clear points I need some light on.

Question 1

Let me start with my very basic question. I first selected my UML model and set the Context Element to one of the higher-level packages. I have used several packages in my UML model since I like to use their "folder" nature to organize similiar concepts.

Then I did this simple expression: self

After clicking the "Evaluate OCL Document" button in the tool bar, I saw the following shown in the (OCL) Console.

Successfully run the query. Result:
org.eclipse.uml2.uml.internal.impl.PackageImpl@ 43924392 (name: Batch Load Strategy Concepts, visibility: <unset>)


So it looks this indeed is a Package and implemented by PackageImpl.

Then, I typed the following by Ctrl+Space - self.getAllAppliedProfiles() and got the following:

Successfully run the query. Result:
1.) org.eclipse.uml2.uml.internal.impl.ProfileImpl@ 37543754 (name: Default, visibility: <unset>)
2.) org.eclipse.uml2.uml.internal.impl.ProfileImpl@ 18561856 (name: Business Modeling, visibility: <unset>)
3.) org.eclipse.uml2.uml.internal.impl.ProfileImpl@ 3ad83ad8 (name: Standard, visibility: <unset>)
4.) org.eclipse.uml2.uml.internal.impl.ProfileImpl@ 2fea2fea (name: Deployment, visibility: <unset>)


It looked great. So, I spent some time to look for the "Package" interface provided by JavaDoc from org.eclipse.uml2.uml and found out there is a public getOwner() method. I put that "self.getOwner()" and evaluated it. Obviously it didn't work. It said:

Evaluation Error: Cannot find operation (getOwner()) for the type (Package)

What defines what operations I can put into the OCL editor for the OCL file I created? Is there a single source to show all of them? I have seen this site for OCL operations but is that all are allowed? (Sorry it wouldn't let me put in links since I am a new user.)

Question 2

One other thing that confuses me most is why can't I simply paste the contents of an OCL file into this editor?

Question 3

Last question is - since OCL is a language, and it support recursion, what can I do to traverse all of my packages from a given package so I can organize them in my BIRT report? Could you please help me with the OCL query?

Sincerely,
Tony Chou



Re: New in OCL [message #1553361 is a reply to message #1551663] Thu, 08 January 2015 17:03 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5534
Registered: July 2009
Senior Member
Hi

On 08/01/2015 13:05, Tony Chou wrote:
> But just by coming to the OCL
> editor (Not an xtext one)

The only OCL editors supported by the Eclipse OCL project are Xtext
editors so it seems you have a problem with an unidentified third party
product.

You may find the ->closure() iteration helpful for recursion.

Regards

Ed Willink
Previous Topic:Extending CompleteOCL
Next Topic:Working with MARTE
Goto Forum:
  


Current Time: Sun Dec 17 04:32:47 GMT 2017

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

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