Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Problem while serializing the OCL AST
Problem while serializing the OCL AST [message #68587] Wed, 11 March 2009 11:43 Go to next message
Timothy Marc is currently offline Timothy Marc
Messages: 547
Registered: July 2009
Senior Member
Hey all,

may be the last questions was not recognized, because it might be
appeared as an answer. That why i'm posting again:

I tried to serialize the parsed ast, but i got a ClassNotFoundException,
when i open the xmi with the sample reflective edtitor.

The Class "ExpressionInOcl" could not be found. I think, the connection
to the ocl.uml metamodel is lost??? Is it so?

And by the way, how can the OCL AST View be used? I don't know how to
pass an ast to it, since it seems that there is no functionality
implemented.

Thx in advance
Timothy
Re: Problem while serializing the OCL AST [message #68619 is a reply to message #68587] Wed, 11 March 2009 13:29 Go to previous messageGo to next message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

Hi, Timothy,

See my reply on the other thread. I guess I'm not as active in the
newsgroups these days ... sometimes that happens.

cW

Timothy Marc wrote:
> Hey all,
>
> may be the last questions was not recognized, because it might be
> appeared as an answer. That why i'm posting again:
>
> I tried to serialize the parsed ast, but i got a ClassNotFoundException,
> when i open the xmi with the sample reflective edtitor.
>
> The Class "ExpressionInOcl" could not be found. I think, the connection
> to the ocl.uml metamodel is lost??? Is it so?
>
> And by the way, how can the OCL AST View be used? I don't know how to
> pass an ast to it, since it seems that there is no functionality
> implemented.
>
> Thx in advance
> Timothy
Re: Problem while serializing the OCL AST [message #68627 is a reply to message #68619] Thu, 12 March 2009 10:58 Go to previous messageGo to next message
Timothy Marc is currently offline Timothy Marc
Messages: 547
Registered: July 2009
Senior Member
Hi Christian,

no problem, i even just thought, that it wasn't recognized as an
question, but as an answer.

I ran this junit test as an junit plugin test, so within the eclipse
context. I even checked, whether i have referenced the required plugins.
See the list:

org.eclipse.emf;bundle-version="2.4.0",
org.eclipse.emf.ecore;bundle-version="2.4.2",
org.eclipse.emf.ecore.xmi;bundle-version="2.4.1",
org.eclipse.ocl;bundle-version="1.2.3",
org.eclipse.ocl.doc;bundle-version="1.2.1",
org.eclipse.ocl.ecore;bundle-version="1.2.1",
org.eclipse.ocl.source;bundle-version="1.2.3",
org.eclipse.ocl.uml;bundle-version="1.2.3",
org.eclipse.ocl.uml.source;bundle-version="1.2.3",
org.eclipse.pde.runtime;bundle-version="3.4.0",
org.eclipse.uml2;bundle-version="2.1.0",
org.eclipse.uml2.common;bundle-version="1.4.0",
org.eclipse.uml2.uml;bundle-version="2.2.2",
org.eclipse.uml2.uml.resources;bundle-version="2.2.0",

But the following snippet still doesn't work:

final Resource oclResource =
ocl.getEnvironment().getTypeResolver().getResource();
oclResource.setURI(outURI);
try {
oclResource.save(null);
} catch (IOException e) {
e.printStackTrace();
}

Thx Timothy

Christian W. Damus schrieb:
> Hi, Timothy,
>
> See my reply on the other thread. I guess I'm not as active in the
> newsgroups these days ... sometimes that happens.
>
> cW
>
> Timothy Marc wrote:
>> Hey all,
>>
>> may be the last questions was not recognized, because it might be
>> appeared as an answer. That why i'm posting again:
>>
>> I tried to serialize the parsed ast, but i got a
>> ClassNotFoundException, when i open the xmi with the sample reflective
>> edtitor.
>>
>> The Class "ExpressionInOcl" could not be found. I think, the
>> connection to the ocl.uml metamodel is lost??? Is it so?
>>
>> And by the way, how can the OCL AST View be used? I don't know how to
>> pass an ast to it, since it seems that there is no functionality
>> implemented.
>>
>> Thx in advance
>> Timothy
Re: Problem while serializing the OCL AST [message #68810 is a reply to message #68627] Sat, 14 March 2009 18:26 Go to previous messageGo to next message
Eclipse User
Originally posted by: give.a.damus.gmail.com

Hi, Timothy,

You might try comparing your code against what the
org.eclipse.ocl.uml.SerializationTest does, to see what you might be
missing. It isn't readily apparent to me.

It is interesting that the problem is with the ExpressionInOcl type.
This is one of very few cases where MDT OCL uses a Java-conventional
name for the EClass ("ExpressionInOCL" -- note the capital "CL") and
uses extended metadata to apply the OMG-defined name "ExpressionInOcl"
in the XMI serialization. Perhaps there is something amiss in the
ExtendedMetaData in your scenario? I would debug the look-up of the
EClass name in the deserialization to find out ...

HTH,

Christian


Timothy Marc wrote:
> Hi Christian,
>
> no problem, i even just thought, that it wasn't recognized as an
> question, but as an answer.
>
> I ran this junit test as an junit plugin test, so within the eclipse
> context. I even checked, whether i have referenced the required plugins.
> See the list:
>
> org.eclipse.emf;bundle-version="2.4.0",
> org.eclipse.emf.ecore;bundle-version="2.4.2",
> org.eclipse.emf.ecore.xmi;bundle-version="2.4.1",
> org.eclipse.ocl;bundle-version="1.2.3",
> org.eclipse.ocl.doc;bundle-version="1.2.1",
> org.eclipse.ocl.ecore;bundle-version="1.2.1",
> org.eclipse.ocl.source;bundle-version="1.2.3",
> org.eclipse.ocl.uml;bundle-version="1.2.3",
> org.eclipse.ocl.uml.source;bundle-version="1.2.3",
> org.eclipse.pde.runtime;bundle-version="3.4.0",
> org.eclipse.uml2;bundle-version="2.1.0",
> org.eclipse.uml2.common;bundle-version="1.4.0",
> org.eclipse.uml2.uml;bundle-version="2.2.2",
> org.eclipse.uml2.uml.resources;bundle-version="2.2.0",
>
> But the following snippet still doesn't work:
>
> final Resource oclResource =
> ocl.getEnvironment().getTypeResolver().getResource();
> oclResource.setURI(outURI);
> try {
> oclResource.save(null);
> } catch (IOException e) {
> e.printStackTrace();
> }
>
> Thx Timothy
>
> Christian W. Damus schrieb:
>> Hi, Timothy,
>>
>> See my reply on the other thread. I guess I'm not as active in the
>> newsgroups these days ... sometimes that happens.
>>
>> cW
>>
>> Timothy Marc wrote:
>>> Hey all,
>>>
>>> may be the last questions was not recognized, because it might be
>>> appeared as an answer. That why i'm posting again:
>>>
>>> I tried to serialize the parsed ast, but i got a
>>> ClassNotFoundException, when i open the xmi with the sample
>>> reflective edtitor.
>>>
>>> The Class "ExpressionInOcl" could not be found. I think, the
>>> connection to the ocl.uml metamodel is lost??? Is it so?
>>>
>>> And by the way, how can the OCL AST View be used? I don't know how to
>>> pass an ast to it, since it seems that there is no functionality
>>> implemented.
>>>
>>> Thx in advance
>>> Timothy
Re: Problem while serializing the OCL AST [message #68859 is a reply to message #68810] Sat, 14 March 2009 18:35 Go to previous messageGo to next message
Eclipse User
Originally posted by: give.a.damus.gmail.com

Sorry, that should be "org.eclipse.ocl.uml.tests.SerializationTest"

cW
Re: Problem while serializing the OCL AST [message #68880 is a reply to message #68859] Sat, 14 March 2009 19:38 Go to previous messageGo to next message
Timothy Marc is currently offline Timothy Marc
Messages: 547
Registered: July 2009
Senior Member
Hey Christian,

may be you can help me, because how can i look into an test. There are
only class-files in it and no addition code. May be, i have a lack of
knowledge concerning this topic :-)

Cheers
Timothy

Christian W. Damus schrieb:
> Sorry, that should be "org.eclipse.ocl.uml.tests.SerializationTest"
>
> cW
Re: Problem while serializing the OCL AST [message #69160 is a reply to message #68880] Fri, 20 March 2009 01:07 Go to previous message
Eclipse User
Originally posted by: give.a.damus.gmail.com

Hi, Timothy,

Just check out the test project from the CVS repository:


/cvsroot/modeling/org.eclipse.mdt/org.eclipse.ocl/plugins/or g.eclipse.ocl.uml.tests

Cheers,

Christian


Timothy Marc wrote:
> Hey Christian,
>
> may be you can help me, because how can i look into an test. There are
> only class-files in it and no addition code. May be, i have a lack of
> knowledge concerning this topic :-)
>
> Cheers
> Timothy
>
> Christian W. Damus schrieb:
>> Sorry, that should be "org.eclipse.ocl.uml.tests.SerializationTest"
>>
>> cW
Previous Topic:Multiple output values in postcondition
Next Topic:OCLHelper questions
Goto Forum:
  


Current Time: Wed Sep 03 07:04:57 GMT 2014

Powered by FUDForum. Page generated in 0.03921 seconds