Home » Modeling » EMF » [OCL/QVTO] Accessing a EFeatureMapEntry
| |
Re: [OCL/QVTO] Accessing a EFeatureMapEntry [message #546882 is a reply to message #546873] |
Wed, 14 July 2010 13:27 |
Christophe Bouhier Messages: 937 Registered: July 2009 |
Senior Member |
|
|
Ed,
I posted this question first on the M2M group and then thought, it might
be more of an OCL question. Sorry, not sure where OCL questions go?
rgds Christophe
> Christophe,
>
> Comments below.
>
>
> Christophe Bouhier wrote:
>> 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
> What's that?
>> and get the second index which is
>> supposed to be the value in the EFeatureMapEntry but this doesn't work.
> Hmmm.
>> 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?
> Sounds like a question for the OCL or QVTo newsgroup. Maybe Ed Willink
> will see your question here.
>>
>> thanks, Christophe
|
|
|
Re: [OCL/QVTO] Accessing a EFeatureMapEntry [message #546902 is a reply to message #546882] |
Wed, 14 July 2010 14:48 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Christophe,
It's news://new.eclipse.org/eclipse.modeling.mdt.ocl I've added it to
the "to" list of the reply, so no need to repost.
Christophe Bouhier wrote:
> Ed,
>
> I posted this question first on the M2M group and then thought, it
> might be more of an OCL question. Sorry, not sure where OCL questions go?
>
> rgds Christophe
>
>
>> Christophe,
>>
>> Comments below.
>>
>>
>> Christophe Bouhier wrote:
>>> 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
>> What's that?
>>> and get the second index which is
>>> supposed to be the value in the EFeatureMapEntry but this doesn't work.
>> Hmmm.
>>> 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?
>> Sounds like a question for the OCL or QVTo newsgroup. Maybe Ed
>> Willink will see your question here.
>>>
>>> thanks, Christophe
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: [OCL/QVTO] Accessing a EFeatureMapEntry [message #546938 is a reply to message #546902] |
Wed, 14 July 2010 16:22 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Christophe
The simple answer is no chance.
The MDT/UML2 project has capabilities to convert advanced UML
associations such as {subsets} to Ecore with special EAnnotations that
genmodel recognises. Some of these are realised by EFeatureMap.
The MDT/OCL project provides abilities to use OCL expressions on UML or
Ecore meta-models, however I am not aware of any MDT/OCL functionality
that is able to recognise the UML idiom in Ecore and so allow the UML
syntax to be used in OCL. (It is just possible that this functionality
may appear in MDT/OCL for Indigo.)
In practice, EFeatureMap is just the type of an EAttribute so you may be
able to use it as an EDataType. Or you may code custom Java helpers to
perform useful actions on the EDataType.
Regards
Ed Willink
On 14/07/2010 15:48, Ed Merks wrote:
> Christophe,
>
> It's news://new.eclipse.org/eclipse.modeling.mdt.ocl I've added it to
> the "to" list of the reply, so no need to repost.
>
>
> Christophe Bouhier wrote:
>> Ed,
>>
>> I posted this question first on the M2M group and then thought, it
>> might be more of an OCL question. Sorry, not sure where OCL questions go?
>>
>> rgds Christophe
>>
>>
>>> Christophe,
>>>
>>> Comments below.
>>>
>>>
>>> Christophe Bouhier wrote:
>>>> 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
>>> What's that?
>>>> and get the second index which is
>>>> supposed to be the value in the EFeatureMapEntry but this doesn't work.
>>> Hmmm.
>>>> 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?
>>> Sounds like a question for the OCL or QVTo newsgroup. Maybe Ed
>>> Willink will see your question here.
>>>>
>>>> thanks, Christophe
|
|
|
Re: [OCL/QVTO] Accessing a EFeatureMapEntry [message #547444 is a reply to message #546938] |
Fri, 16 July 2010 20:14 |
Christophe Bouhier Messages: 937 Registered: July 2009 |
Senior Member |
|
|
Hi Ed,
Thank you. I managed to read out an EFeatureMap, using QVTO blackbox.
rgds Christophe
Ed Willink wrote:
> Hi Christophe
>
> The simple answer is no chance.
>
> The MDT/UML2 project has capabilities to convert advanced UML
> associations such as {subsets} to Ecore with special EAnnotations that
> genmodel recognises. Some of these are realised by EFeatureMap.
>
> The MDT/OCL project provides abilities to use OCL expressions on UML or
> Ecore meta-models, however I am not aware of any MDT/OCL functionality
> that is able to recognise the UML idiom in Ecore and so allow the UML
> syntax to be used in OCL. (It is just possible that this functionality
> may appear in MDT/OCL for Indigo.)
>
> In practice, EFeatureMap is just the type of an EAttribute so you may be
> able to use it as an EDataType. Or you may code custom Java helpers to
> perform useful actions on the EDataType.
>
> Regards
>
> Ed Willink
>
>
>
> On 14/07/2010 15:48, Ed Merks wrote:
>> Christophe,
>>
>> It's news://new.eclipse.org/eclipse.modeling.mdt.ocl I've added it to
>> the "to" list of the reply, so no need to repost.
>>
>>
>> Christophe Bouhier wrote:
>>> Ed,
>>>
>>> I posted this question first on the M2M group and then thought, it
>>> might be more of an OCL question. Sorry, not sure where OCL questions
>>> go?
>>>
>>> rgds Christophe
>>>
>>>
>>>> Christophe,
>>>>
>>>> Comments below.
>>>>
>>>>
>>>> Christophe Bouhier wrote:
>>>>> 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
>>>> What's that?
>>>>> and get the second index which is
>>>>> supposed to be the value in the EFeatureMapEntry but this doesn't
>>>>> work.
>>>> Hmmm.
>>>>> 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?
>>>> Sounds like a question for the OCL or QVTo newsgroup. Maybe Ed
>>>> Willink will see your question here.
>>>>>
>>>>> thanks, Christophe
>
|
|
|
Goto Forum:
Current Time: Fri Apr 19 22:08:13 GMT 2024
Powered by FUDForum. Page generated in 0.03272 seconds
|