Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » VIATRA » Alternative for RunOnce engine in v1.0.0
Alternative for RunOnce engine in v1.0.0 [message #1744348] Mon, 26 September 2016 08:45 Go to next message
Tu Ton is currently offline Tu TonFriend
Messages: 14
Registered: January 2015
Junior Member
Hello,

I found out that the RunOnce engine does not work anymore on EMF-Incquery version 1.0.0. As described in the bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=488439, I experience the same problem with the same exceptions.
My question is: Is there any workaround for this (instead of incorporating the patch delivered in version 1.2.0) or an alternative to RunOnce engine (e.g. another engine in case we do not want incremental evaluation)?
Thank you in advance.

Best regards,
Tu

[Updated on: Mon, 26 September 2016 08:51]

Report message to a moderator

Re: Alternative for RunOnce engine in v1.0.0 [message #1744355 is a reply to message #1744348] Mon, 26 September 2016 09:42 Go to previous messageGo to next message
Abel Hegedus is currently offline Abel HegedusFriend
Messages: 187
Registered: September 2015
Senior Member
I assume that you have some reason to keep using EMF-IncQuery 1.0.0 instead of migrating to a version that already has a fix for this issue.

As for a workaround using EMF-IncQuery 1.0.0, I have one suggestion:
The problem occurs because a type is not yet registered into the base index when the traversal realises that it has a feature which is not well-behaving but is needed for the queries you are trying to run.
The cause is that the implementation in 1.0.0 registers these types immediately _and_ gives information to the traversing visitor that are not entirely accurate.
Two possible workarounds:
1. initialize the base index of the engine in wildcard mode (this will ensure that all types are registered, so the problem does not occur)
2. (not tested, but should work based on the source code) manually register the types with such features _before_ the query engine starts evaluating queries

API for 1.: https://www.eclipse.org/viatra/javadoc/releases/incquery-1.0.0/org/eclipse/incquery/runtime/base/api/BaseIndexOptions.html#withWildcardMode-boolean-
API for 2: https://www.eclipse.org/viatra/javadoc/releases/incquery-1.0.0/org/eclipse/incquery/runtime/base/api/NavigationHelper.html#registerEClasses-java.util.Set-
Re: Alternative for RunOnce engine in v1.0.0 [message #1744375 is a reply to message #1744355] Mon, 26 September 2016 12:07 Go to previous messageGo to next message
Tu Ton is currently offline Tu TonFriend
Messages: 14
Registered: January 2015
Junior Member
Correct me if I'm wrong but it seems that the baseIndexOptions field is private and we cannot initialize it in wildcard mode in client code. Is there any workaround for this 1st workaround Sad ?
Re: Alternative for RunOnce engine in v1.0.0 [message #1744376 is a reply to message #1744355] Mon, 26 September 2016 12:10 Go to previous messageGo to next message
Tu Ton is currently offline Tu TonFriend
Messages: 14
Registered: January 2015
Junior Member
Correct me if I'm wrong but it seems that the baseIndexOptions field is private and we cannot initialize it in wildcard mode in client code. Is there any workaround for this 1st workaround Sad ?
Re: Alternative for RunOnce engine in v1.0.0 [message #1744377 is a reply to message #1744376] Mon, 26 September 2016 12:16 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 335
Registered: July 2015
Senior Member
Hi,

you cannot change the BaseIndexOptions after the engine/base index is created. For creating a query engine in wildcard mode, initialize an EMFScope [1] with the corresponding base index options.

Best regards,
Zoltán

[1] https://www.eclipse.org/viatra/javadoc/releases/incquery-1.0.0/org/eclipse/incquery/runtime/emf/EMFScope.html#EMFScope-org.eclipse.emf.common.notify.Notifier-org.eclipse.incquery.runtime.base.api.BaseIndexOptions-
Re: Alternative for RunOnce engine in v1.0.0 [message #1744380 is a reply to message #1744377] Mon, 26 September 2016 12:34 Go to previous messageGo to next message
Tu Ton is currently offline Tu TonFriend
Messages: 14
Registered: January 2015
Junior Member
Hi Zoltan,

Still the RunOnce engine is initialized with a Notifier, not an IncQueryScope. I could not find a way to pass the EMFScope variable.

Best regards,
Tu
Re: Alternative for RunOnce engine in v1.0.0 [message #1744387 is a reply to message #1744380] Mon, 26 September 2016 12:48 Go to previous message
Tu Ton is currently offline Tu TonFriend
Messages: 14
Registered: January 2015
Junior Member
The good news is that Abel's solution does work. However, I have no other solution but to extend the RunOnceQuery and initialize it with an EMF scope which is created from base index options in wildcard mode. For me this temporary fix can do the job while waiting for our next migration to version 1.2.0.

Best regards,
Tu

[Updated on: Mon, 26 September 2016 13:44]

Report message to a moderator

Previous Topic:How to get Xtext resource
Next Topic:Tutorial Issue: createRule.precondition errors
Goto Forum:
  


Current Time: Thu Sep 21 06:58:51 GMT 2017

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

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