Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Execute native OCL query in qvt-o code
Execute native OCL query in qvt-o code [message #1221472] Tue, 17 December 2013 19:45 Go to next message
Naif Mokhayesh is currently offline Naif MokhayeshFriend
Messages: 31
Registered: November 2011
Member
Hi,

My question about who to run/execute native OCL query in qvt-o code.

For instance, I have got one model element of the input model with string attribute that has OCL query to be used in navigating input model as well as return a list of candidate model elements to be refactored. So now I have OCL query in form of String and I need to execute it on qvt-o code.

What is the required library/tool/buit-in functionality to do that? or should I parse this string and build up and qvt helper/query based on the OCL String attribute

your advice please

Thanks
Re: Execute native OCL query in qvt-o code [message #1222093 is a reply to message #1221472] Thu, 19 December 2013 16:43 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I am not entirely clear why QVTo cannot parse your OCL in the first
place of why you don;t use a Complete OCL document of OCLinEcore...

But if none of those work, you need the String::parse/evaluate method
that I am still thinking about.

Regards

Ed Willink

On 17/12/2013 19:45, Naif Mokhayesh wrote:
> Hi,
>
> My question about who to run/execute native OCL query in qvt-o code.
>
> For instance, I have got one model element of the input model with
> string attribute that has OCL query to be used in navigating input
> model as well as return a list of candidate model elements to be
> refactored. So now I have OCL query in form of String and I need to
> execute it on qvt-o code.
> What is the required library/tool/buit-in functionality to do that? or
> should I parse this string and build up and qvt helper/query based on
> the OCL String attribute
>
> your advice please
>
> Thanks
>
Re: Execute native OCL query in qvt-o code [message #1222105 is a reply to message #1222093] Thu, 19 December 2013 17:15 Go to previous messageGo to next message
Naif Mokhayesh is currently offline Naif MokhayeshFriend
Messages: 31
Registered: November 2011
Member
Thank you Ed for your reply

let me elaborate my question:

in the input model their is a stereotype with string attribute holding OCL query (not imputative OCL) and I need to parse and execute it to get the result (element(s) from another model) in order to complete transformation.

So I got OCL in form of string, how to parse it in QVT-O at run time.

Is it possible to import OCL libraries in qvt-o code something like this :

http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.ocl.doc%2Fhelp%2FPivotEvaluatingConstraints.html&cp=38_6_5

http://stackoverflow.com/questions/19705929/parse-ocl-in-java

thanks
Re: Execute native OCL query in qvt-o code [message #1222125 is a reply to message #1222105] Thu, 19 December 2013 18:15 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

If the OCL is in a disciplined context such as a stereotype, the tooling
should be able to use it.

Regards

Ed Willink

On 19/12/2013 17:15, Naif Mokhayesh wrote:
> Thank you Ed for your reply
> let me elaborate my question:
>
> in the input model their is a stereotype with string attribute holding
> OCL query (not imputative OCL) and I need to parse and execute it to
> get the result (element(s) from another model) in order to complete
> transformation.
>
> So I got OCL in form of string, how to parse it in QVT-O at run time.
> Is it possible to import OCL libraries in qvt-o code something like
> this :
>
> http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.ocl.doc%2Fhelp%2FPivotEvaluatingConstraints.html&cp=38_6_5
>
>
> http://stackoverflow.com/questions/19705929/parse-ocl-in-java
>
> thanks
>
Re: Execute native OCL query in qvt-o code [message #1222598 is a reply to message #1222125] Fri, 20 December 2013 21:38 Go to previous messageGo to next message
Naif Mokhayesh is currently offline Naif MokhayeshFriend
Messages: 31
Registered: November 2011
Member
Hi,

is it possible to import OCL API i.e. OCLHelper in a qvt-o directly to parse OCL query expressions that is embedded in source models instead of using Java code and access it using black-box?


thanks
Re: Execute native OCL query in qvt-o code [message #1223166 is a reply to message #1222598] Sun, 22 December 2013 16:35 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

No. To use things from QVTo they must use a QVTo language API. OCLHelper
is part of an OCL tooling API. Use black box.

` Regards

Ed Willink

On 20/12/2013 21:38, Naif Mokhayesh wrote:
> Hi,
>
> is it possible to import OCL API i.e. OCLHelper in a qvt-o directly to
> parse OCL query expressions that is embedded in source models instead
> of using Java code and access it using black-box?
>
> thanks
Previous Topic:OCL Errors in StandAlone QVTo
Next Topic:goal for new objects in a transformation
Goto Forum:
  


Current Time: Fri Mar 29 09:28:53 GMT 2024

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

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

Back to the top