moosetechnology / MooseIDE

New Tools for Moose
MIT License
8 stars 17 forks source link

Moose Queries code executed outside of Query Browser have different result than inside of Query Browser #1049

Closed alkalinan closed 3 months ago

alkalinan commented 5 months ago

following this query, when executing in the query browser :

image

and in the playground using runOn:

image

we obtain a different moose group result (see the number of entity is completly different). Its from the same model jpetstore-model.mse.zip


playgroung code :

jpetstoremodel := MooseModel root at: 1.

(FQNavigationQuery incoming associations: { FamixJavaInvocation })
--> (FQStringQuery
     property: #name
     comparator: #includesSubstring:
     valueToCompare: 'getItemListOutput')
--> (FQNavigationQuery outgoing associations: {
         FamixJavaReference.
         FamixJavaInvocation }) runOn: jpetstoremodel .
NicolasAnquetil commented 5 months ago

from experiment, it seems the composition (-->) is not doing the right thing

jecisc commented 5 months ago

The piece of code provided does not do the same thing as the QB because the runOn: will run only the navigation query and not the whole set of query.

The code generated should probably be updated to generate the code to run the whole query also.

We should have a FQRootQuery as the origin having the moose model and the computation should be done via #computeResult

ClotildeToullec commented 3 months ago

Since recent improvements, you can now execute a sequence of queries using #executeOn:. By default, when propagating from the models browser, all stub entities are filtered out. You can achieve the same using #withoutStubs. Your code would be modified as follows:

jpetstoremodel := MooseModel root at: 1.

((FQNavigationQuery incoming associations: { FamixJavaInvocation })
--> (FQStringQuery
   property: #name
   comparator: #includesSubstring:
   valueToCompare: 'getItemListOutput')
--> (FQNavigationQuery outgoing associations: {
       FamixJavaReference.
       FamixJavaInvocation })) executeOn: jpetstoremodel withoutStubs.