Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » 0 record(s) found in EMF ODA data set "Preview Results"...(...depending on the OCL query)
0 record(s) found in EMF ODA data set "Preview Results"... [message #1706052] Fri, 21 August 2015 12:17 Go to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 44
Registered: June 2015
Member
Hi all,

I define OCL queries in EMF ODA data sets used to produce BIRT reports.
When I define the following settings :
>Context : Root
>Query Text : self.getAElements.getBElements........getYElements.getZElements
>Result type : Z
The "Preview Results" tab works fine and returns details for each Z element.

Whereas, with the following settings :
>Context : Y
>Query Text : self.getZElements
>Result Type : Z
Preview returns '0 record(s) found'.

Specifying 'OCL' or 'OCL/LPG' as query delegate makes no difference.
There is also no difference in the properties of 'getYElements' and 'getZElements' ereferences neither in .ecore nor in .genmodel...

Any idea why this happens ?

Kind regards,

Laurent
Re: 0 record(s) found in EMF ODA data set "Preview Results"... [message #1706056 is a reply to message #1706052] Fri, 21 August 2015 12:46 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 44
Registered: June 2015
Member
Hi again,

I should add that self.getZElements.Name='MyName' is considered as valid by the interactive OCL query parser even if the preview returns no record.

Whereas, self.getAElements.getBElements........getYElements.getZElements.Name='MyName' is rejected with the following message : Cannot find operation (=(String)) for the type (Sequence(String)).

So, using a 'lengthy' query is a non-viable workaround...

Laurent
Re: 0 record(s) found in EMF ODA data set "Preview Results"... [message #1706089 is a reply to message #1706052] Sat, 22 August 2015 05:37 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6481
Registered: July 2009
Senior Member
Hi

I am not familiar with this usage of OCL, but it all looks very odd.

I would expect to see either "AElement" using the model, or
"getAElements()" using the Java API. But since you provide no repro that
is just a guess.

I would expect to see "->" rather than "." for collection navigation.

I don't understand the "Context". You seem to descrivbe an interactive
input. I might expect the cursor se;lection to tell you what the context is.

Similarly I might expect the "Result" to be output rather than input.

If you want help you need to provide a very accurate repro:
https://wiki.eclipse.org/OCL/ForumNetiquette

I strongly recommend that you practice your queries in the OCL Console
after loading your model with the Sample Reflective Ecore Editor,

Regards

Ed Willink

On 21/08/2015 13:17, Laurent Le Moux wrote:
> Hi all,
>
> I define OCL queries in EMF ODA data sets used to produce BIRT reports.
> When I define the following settings :
>> Context : Root
>> Query Text :
>> self.getAElements.getBElements........getYElements.getZElements
>> Result type : Z
> The "Preview Results" tab works fine and returns details for each Z
> element.
>
> Whereas, with the following settings :
>> Context : Y
>> Query Text : self.getZElements
>> Result Type : Z
> Preview returns '0 record(s) found'.
>
> Specifying 'OCL' or 'OCL/LPG' as query delegate makes no difference.
> There is also no difference in the properties of 'getYElements' and
> 'getZElements' ereferences neither in .ecore nor in .genmodel...
>
> Any idea why this happens ?
>
> Kind regards,
>
> Laurent
Re: 0 record(s) found in EMF ODA data set "Preview Results"... [message #1706142 is a reply to message #1706089] Mon, 24 August 2015 07:24 Go to previous message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 44
Registered: June 2015
Member
Hi Ed,

I was indeed describing the EMF ODA Data Set wizard.
Meanwhile, I found what the problem was.

The EMF ODA driver uses a connection and issues OCL queries against a CDO repository.
The query object - at some point - looks for all intances of a certain EClass type in a resource set.
If the requested EClass is part of a resource not belonging to the resource set, nothing is found...

As I do not want to register all my (CDO) resources in the resource set and then traverse the whole repository to find the occurrences I am interested in, I finally choose to override this behavior in Query.getAllObjectsByType to issue an internal OCL query corresponding to this search; hoping the internal implementation will be more efficient.

Regards,

Laurent
Previous Topic:How to create a non-resolving list
Next Topic:description of a model in emf
Goto Forum:
  


Current Time: Tue Oct 22 14:20:33 GMT 2019

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

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

Back to the top