Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] Accessing a EFeatureMapEntry
[QVTO] Accessing a EFeatureMapEntry [message #546835] Wed, 14 July 2010 12:03 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi,


I am try to read the value of an EFeatureMapEntry.


In the query below, I first query the type 'DataType1' which has a
EFeatureMap and I request the first entry (using ->at(1)).




query XLS::DataType1::toData() : ECORE::EFeatureMapEntry {
log("QUERY: Data", self.mixed->at(1));
return self.mixed->at(1);
}

The log on this reports the following type: data:ecore.xml.type:text


then, I use the result to get the value as a String.
I try to convert to a Sequence and get the second index which is
supposed to be the value in the EFeatureMapEntry but this doesn't work.
It seems overcomplicated anyway.

query XLS::CellType::toCell() : String {
log("QUERY: Cell", self);
return self.data->toData()->asSequence()->at(2).oclAsType(String);
}


Any ideas to access the EFeatureMapEntry?

thanks, Christophe
Re: [QVTO] Accessing a EFeatureMapEntry [message #546973 is a reply to message #546835] Wed, 14 July 2010 19:15 Go to previous messageGo to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 51
Registered: August 2009
Member
This has been brought up before [1]. For now it looks like the only way is to implement your own QVTO black box function, something like:

@Operation(contextual = true)
public static Object getValue(FeatureMap.Entry self)
{
  return self.getValue();
}

[1] http://www.eclipse.org/forums/index.php?t=msg&goto=48620 8&#msg_486208

Alex
Re: [QVTO] Accessing a EFeatureMapEntry [message #547623 is a reply to message #546973] Mon, 19 July 2010 07:56 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Thanks Alex, I managed to solve this with a blackbox.
Cheers Christophe

Alex wrote:
> This has been brought up before [1]. For now it looks like the only way
> is to implement your own QVTO black box function, something like:
>
> @Operation(contextual = true)
> public static Object getValue(FeatureMap.Entry self)
> {
> return self.getValue();
> }
>
> [1] http://www.eclipse.org/forums/index.php?t=msg&goto=48620 8&#msg_486208
>
> Alex
Previous Topic:[ATL] Identify last Element
Next Topic:[ATL] Preferred way of using the ATL2006 compiler in Java program
Goto Forum:
  


Current Time: Thu Apr 22 10:24:02 GMT 2021

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

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

Back to the top