Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » programmatically parsing OCL constraints
programmatically parsing OCL constraints [message #54527] Fri, 29 September 2006 14:21 Go to next message
Eclipse UserFriend
Originally posted by: luis.pedro.freedevices.org

Hi there,
I'm new to this EMFT group so I have a question that might be kind of
stupid but... Is it possible to use the OCL library programmatically in
out-of-the-box applications (stand alone applications from outside
Eclipse)? I'm also using uml2 EMF project in order to "browse" and
create UML diagrams. Some of these diagrams might have some OCL
constraints and I need to parse them. Any idea if this is possible and
if there are any examples for it?

Thanks very, very much in advance for your time...

All the best

Luis Pedro
Re: programmatically parsing OCL constraints [message #54866 is a reply to message #54527] Fri, 29 September 2006 20:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hello, Luis,

The EMFT OCL parser can be used stand-alone, but you will have to fiddle the
JARs a bit (we have a bug asking to support a stand-alone build in the next
release, as EMF does). You need to extract the lpgjavaruntime.jar file
from the org.eclipse.emf.ocl_1.0.1.v2006etc.jar file and include it on your
classpath.

Out-of-the-box, EMFT OCL will parse and evaluate constraints and queries on
Ecore models. That is to say, its metamodel is Ecore (more like
EssentialOCL), not UML (which would be more like CompleteOCL). If you want
to parse OCL constraints in UML models, then you will have some work to do
to create a UML Environment (see previous discussion on this topic in this
newsgroup). The MDT project's UML component has an open bug for OCL
support in UML.

To get started with EMFT OCL on Ecore models, install the OCL Interpreter
example into your workspace (File -> New -> Example... menu) and follow the
tutorial in the on-line help.

HTH,

Christian


Luis Pedro wrote:

> Hi there,
> I'm new to this EMFT group so I have a question that might be kind of
> stupid but... Is it possible to use the OCL library programmatically in
> out-of-the-box applications (stand alone applications from outside
> Eclipse)? I'm also using uml2 EMF project in order to "browse" and
> create UML diagrams. Some of these diagrams might have some OCL
> constraints and I need to parse them. Any idea if this is possible and
> if there are any examples for it?
>
> Thanks very, very much in advance for your time...
>
> All the best
>
> Luis Pedro
Re: programmatically parsing OCL constraints [message #56106 is a reply to message #54866] Tue, 03 October 2006 09:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: luis.pedro.freedevices.org

Hi Christian,
Thanks very much for your answer. For the moment I really just need to
parse OCL constraints. For now I don't need to perform queries since I'm
just performing a transformation of OCL into another language. So it
would help if there are any examples (even if they are very small) that
show how to use the EMFT COL parser in order to get the structure of an
OCL constraint. Is there any OCL Ecore based meta-model that can also be
used?

Thanks again,

LP

Christian W. Damus wrote:
> Hello, Luis,
>
> The EMFT OCL parser can be used stand-alone, but you will have to fiddle the
> JARs a bit (we have a bug asking to support a stand-alone build in the next
> release, as EMF does). You need to extract the lpgjavaruntime.jar file
> from the org.eclipse.emf.ocl_1.0.1.v2006etc.jar file and include it on your
> classpath.
>
> Out-of-the-box, EMFT OCL will parse and evaluate constraints and queries on
> Ecore models. That is to say, its metamodel is Ecore (more like
> EssentialOCL), not UML (which would be more like CompleteOCL). If you want
> to parse OCL constraints in UML models, then you will have some work to do
> to create a UML Environment (see previous discussion on this topic in this
> newsgroup). The MDT project's UML component has an open bug for OCL
> support in UML.
>
> To get started with EMFT OCL on Ecore models, install the OCL Interpreter
> example into your workspace (File -> New -> Example... menu) and follow the
> tutorial in the on-line help.
>
> HTH,
>
> Christian
>
>
> Luis Pedro wrote:
>
>> Hi there,
>> I'm new to this EMFT group so I have a question that might be kind of
>> stupid but... Is it possible to use the OCL library programmatically in
>> out-of-the-box applications (stand alone applications from outside
>> Eclipse)? I'm also using uml2 EMF project in order to "browse" and
>> create UML diagrams. Some of these diagrams might have some OCL
>> constraints and I need to parse them. Any idea if this is possible and
>> if there are any examples for it?
>>
>> Thanks very, very much in advance for your time...
>>
>> All the best
>>
>> Luis Pedro
>
Re: programmatically parsing OCL constraints [message #56200 is a reply to message #56106] Tue, 03 October 2006 21:37 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Luis,

The org.eclipse.emf.ocl plug-in defines an Ecore model of the OCL language:
OCL.ecore. The API is defined by the following packages:

- org.eclipse.emf.ocl.expressions
- org.eclipse.emf.ocl.types
- org.eclipse.emf.ocl.uml
- org.eclipse.emf.ocl.utilities
- org.eclipse.emf.ocl.query

For an example of how to parse an OCL expression (constructing an instance
of the OCLExpression type from the OCL metamodel), install the OCL
Interpreter example that I referred to, below. Then see the
org.eclipse.emf.ocl.examples.interpreter.console.OCLResource class's save()
method to see how to use an IOCLHelper to parse an expression (never mind
the fancy anonymous subclass of EcoreEnvironmentFactory).

The IOCLHelper interface provides all of the API you need to generate an
OCLExpression from OCL text.

HTH,

Christian


Luis Pedro wrote:

> Hi Christian,
> Thanks very much for your answer. For the moment I really just need to
> parse OCL constraints. For now I don't need to perform queries since I'm
> just performing a transformation of OCL into another language. So it
> would help if there are any examples (even if they are very small) that
> show how to use the EMFT COL parser in order to get the structure of an
> OCL constraint. Is there any OCL Ecore based meta-model that can also be
> used?
>
> Thanks again,
>
> LP
>
> Christian W. Damus wrote:
>> Hello, Luis,
>>
>> The EMFT OCL parser can be used stand-alone, but you will have to fiddle
>> the JARs a bit (we have a bug asking to support a stand-alone build in
>> the next
>> release, as EMF does). You need to extract the lpgjavaruntime.jar file
>> from the org.eclipse.emf.ocl_1.0.1.v2006etc.jar file and include it on
>> your classpath.
>>
>> Out-of-the-box, EMFT OCL will parse and evaluate constraints and queries
>> on
>> Ecore models. That is to say, its metamodel is Ecore (more like
>> EssentialOCL), not UML (which would be more like CompleteOCL). If you
>> want to parse OCL constraints in UML models, then you will have some work
>> to do to create a UML Environment (see previous discussion on this topic
>> in this
>> newsgroup). The MDT project's UML component has an open bug for OCL
>> support in UML.
>>
>> To get started with EMFT OCL on Ecore models, install the OCL Interpreter
>> example into your workspace (File -> New -> Example... menu) and follow
>> the tutorial in the on-line help.

<snip>
Re: programmatically parsing OCL constraints [message #592876 is a reply to message #54527] Fri, 29 September 2006 20:13 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hello, Luis,

The EMFT OCL parser can be used stand-alone, but you will have to fiddle the
JARs a bit (we have a bug asking to support a stand-alone build in the next
release, as EMF does). You need to extract the lpgjavaruntime.jar file
from the org.eclipse.emf.ocl_1.0.1.v2006etc.jar file and include it on your
classpath.

Out-of-the-box, EMFT OCL will parse and evaluate constraints and queries on
Ecore models. That is to say, its metamodel is Ecore (more like
EssentialOCL), not UML (which would be more like CompleteOCL). If you want
to parse OCL constraints in UML models, then you will have some work to do
to create a UML Environment (see previous discussion on this topic in this
newsgroup). The MDT project's UML component has an open bug for OCL
support in UML.

To get started with EMFT OCL on Ecore models, install the OCL Interpreter
example into your workspace (File -> New -> Example... menu) and follow the
tutorial in the on-line help.

HTH,

Christian


Luis Pedro wrote:

> Hi there,
> I'm new to this EMFT group so I have a question that might be kind of
> stupid but... Is it possible to use the OCL library programmatically in
> out-of-the-box applications (stand alone applications from outside
> Eclipse)? I'm also using uml2 EMF project in order to "browse" and
> create UML diagrams. Some of these diagrams might have some OCL
> constraints and I need to parse them. Any idea if this is possible and
> if there are any examples for it?
>
> Thanks very, very much in advance for your time...
>
> All the best
>
> Luis Pedro
Re: programmatically parsing OCL constraints [message #593426 is a reply to message #54866] Tue, 03 October 2006 09:57 Go to previous message
Luis Pedro is currently offline Luis PedroFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Christian,
Thanks very much for your answer. For the moment I really just need to
parse OCL constraints. For now I don't need to perform queries since I'm
just performing a transformation of OCL into another language. So it
would help if there are any examples (even if they are very small) that
show how to use the EMFT COL parser in order to get the structure of an
OCL constraint. Is there any OCL Ecore based meta-model that can also be
used?

Thanks again,

LP

Christian W. Damus wrote:
> Hello, Luis,
>
> The EMFT OCL parser can be used stand-alone, but you will have to fiddle the
> JARs a bit (we have a bug asking to support a stand-alone build in the next
> release, as EMF does). You need to extract the lpgjavaruntime.jar file
> from the org.eclipse.emf.ocl_1.0.1.v2006etc.jar file and include it on your
> classpath.
>
> Out-of-the-box, EMFT OCL will parse and evaluate constraints and queries on
> Ecore models. That is to say, its metamodel is Ecore (more like
> EssentialOCL), not UML (which would be more like CompleteOCL). If you want
> to parse OCL constraints in UML models, then you will have some work to do
> to create a UML Environment (see previous discussion on this topic in this
> newsgroup). The MDT project's UML component has an open bug for OCL
> support in UML.
>
> To get started with EMFT OCL on Ecore models, install the OCL Interpreter
> example into your workspace (File -> New -> Example... menu) and follow the
> tutorial in the on-line help.
>
> HTH,
>
> Christian
>
>
> Luis Pedro wrote:
>
>> Hi there,
>> I'm new to this EMFT group so I have a question that might be kind of
>> stupid but... Is it possible to use the OCL library programmatically in
>> out-of-the-box applications (stand alone applications from outside
>> Eclipse)? I'm also using uml2 EMF project in order to "browse" and
>> create UML diagrams. Some of these diagrams might have some OCL
>> constraints and I need to parse them. Any idea if this is possible and
>> if there are any examples for it?
>>
>> Thanks very, very much in advance for your time...
>>
>> All the best
>>
>> Luis Pedro
>
Re: programmatically parsing OCL constraints [message #593482 is a reply to message #56106] Tue, 03 October 2006 21:37 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Luis,

The org.eclipse.emf.ocl plug-in defines an Ecore model of the OCL language:
OCL.ecore. The API is defined by the following packages:

- org.eclipse.emf.ocl.expressions
- org.eclipse.emf.ocl.types
- org.eclipse.emf.ocl.uml
- org.eclipse.emf.ocl.utilities
- org.eclipse.emf.ocl.query

For an example of how to parse an OCL expression (constructing an instance
of the OCLExpression type from the OCL metamodel), install the OCL
Interpreter example that I referred to, below. Then see the
org.eclipse.emf.ocl.examples.interpreter.console.OCLResource class's save()
method to see how to use an IOCLHelper to parse an expression (never mind
the fancy anonymous subclass of EcoreEnvironmentFactory).

The IOCLHelper interface provides all of the API you need to generate an
OCLExpression from OCL text.

HTH,

Christian


Luis Pedro wrote:

> Hi Christian,
> Thanks very much for your answer. For the moment I really just need to
> parse OCL constraints. For now I don't need to perform queries since I'm
> just performing a transformation of OCL into another language. So it
> would help if there are any examples (even if they are very small) that
> show how to use the EMFT COL parser in order to get the structure of an
> OCL constraint. Is there any OCL Ecore based meta-model that can also be
> used?
>
> Thanks again,
>
> LP
>
> Christian W. Damus wrote:
>> Hello, Luis,
>>
>> The EMFT OCL parser can be used stand-alone, but you will have to fiddle
>> the JARs a bit (we have a bug asking to support a stand-alone build in
>> the next
>> release, as EMF does). You need to extract the lpgjavaruntime.jar file
>> from the org.eclipse.emf.ocl_1.0.1.v2006etc.jar file and include it on
>> your classpath.
>>
>> Out-of-the-box, EMFT OCL will parse and evaluate constraints and queries
>> on
>> Ecore models. That is to say, its metamodel is Ecore (more like
>> EssentialOCL), not UML (which would be more like CompleteOCL). If you
>> want to parse OCL constraints in UML models, then you will have some work
>> to do to create a UML Environment (see previous discussion on this topic
>> in this
>> newsgroup). The MDT project's UML component has an open bug for OCL
>> support in UML.
>>
>> To get started with EMFT OCL on Ecore models, install the OCL Interpreter
>> example into your workspace (File -> New -> Example... menu) and follow
>> the tutorial in the on-line help.

<snip>
Previous Topic:org.eclipse.emf.teneo.annotations.util.EcoreDataTypes
Next Topic:Unittests for java batch constraints
Goto Forum:
  


Current Time: Tue Nov 12 19:48:06 GMT 2024

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

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

Back to the top