Skip to main content



      Home
Home » Modeling » QVT-OML » helper with side effect in QVT - OML(helper with side effect in QVT - OML)
helper with side effect in QVT - OML [message #1267828] Sun, 09 March 2014 12:59 Go to next message
Eclipse UserFriend
According to QVT - operational specification, a helper with side effect can be declared as:

helper computeCandidates(inout studentList:Sequence(String)) : Sequence(String) {
var newStudent:String := "a new Student";
studentList += newStudent;
return studentList;
}

But in eclipse QVTO transformation project, This crates an error stating:

"Can't assign a value to 'inout' parameter 'studentList'"

Any ideas on how to fix this?



Re: helper with side effect in QVT - OML [message #1267878 is a reply to message #1267828] Sun, 09 March 2014 14:39 Go to previous messageGo to next message
Eclipse UserFriend
Hi

Use a mutable Collection; ie. List.

Regards

Ed Willink

On 09/03/2014 16:59, Ben Haldo wrote:
> According to QVT - operational specification, a helper with side
> effect can be declared as:
>
> helper computeCandidates(inout studentList:Sequence(String)) :
> Sequence(String) {
> var newStudent:String := "a new Student";
> studentList += newStudent;
> return studentList;
> }
>
> But in eclipse QVTO transformation project, This crates an error stating:
>
> "Can't assign a value to 'inout' parameter 'studentList'"
>
> Any ideas on how to fix this?
>
>
>
>
Re: helper with side effect in QVT - OML [message #1269788 is a reply to message #1267828] Wed, 12 March 2014 03:38 Go to previous message
Eclipse UserFriend
Hi Ben,

Ben Haldo wrote on Sun, 09 March 2014 12:59
According to QVT - operational specification, a helper with side effect can be declared as:

helper computeCandidates(inout studentList:Sequence(String)) : Sequence(String) {
var newStudent:String := "a new Student";
studentList += newStudent;
return studentList;
}

But in eclipse QVTO transformation project, This crates an error stating:

"Can't assign a value to 'inout' parameter 'studentList'"

Any ideas on how to fix this?





This is certainly valid script.
You must switch to the recent QVTo version (most reasonable is to use 3.4.0 M6 http://www.eclipse.org/mmt/downloads/index.php?project=qvto&showAll=0&showMax=5).
Then helper will be compiled and executed without errors.

main() {
  var list = Sequence{};
  var list2 = computeCandidates(list);
  assert (list2 = Sequence{"a new Student"});
  ...



Regards,
Sergey.
Previous Topic:Running qvto Transformations with in/out Metamodels registered by Metamodel-Plugins
Next Topic:Adding qvto editor in RCP application
Goto Forum:
  


Current Time: Sat Aug 30 19:06:28 EDT 2025

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

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

Back to the top