Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How model exception throws in Java(How model exception throws in Java)
icon3.gif  How model exception throws in Java [message #1230576] Sun, 12 January 2014 12:28 Go to next message
Claudio Retico is currently offline Claudio ReticoFriend
Messages: 2
Registered: January 2014
Junior Member
I am using Papyrus to model a complex java 2EE application. I also generate code stub using Acceleo UML2 to Java trasfrmation. All works fine except for an aspect. Seems that in Papyru class method definition there is no way to declare exceptions throwed. I also try to apply Java profile to project but nothing changed.
This seems pretty disappointing because (for example) Rational Software Architect is able to declare exceptions throwed bya a method and generate corresponding java code.
Can anyone help me ?

PS: i use last Papyrus (Version 0.10.1.v201309181302) release with Eclipse Kepler.

Claudio Retico
Re: How model exception throws in Java [message #1230840 is a reply to message #1230576] Mon, 13 January 2014 07:51 Go to previous messageGo to next message
Marc-Florian Wendland is currently offline Marc-Florian WendlandFriend
Messages: 81
Registered: January 2013
Member
Hi Claudio,

select an operation, switch to the 'Advanced' tab in the Properties view and
have a look for 'RasiedException'. In UML, an exception is a mere Type.

HTH,
Marc-Florian

"Claudio Retico" wrote in message news:lauv58$5kv$1@xxxxxxxxe.org...

I am using Papyrus to model a complex java 2EE application. I also generate
code stub using Acceleo UML2 to Java trasfrmation. All works fine except for
an aspect. Seems that in Papyru class method definition there is no way to
declare exceptions throwed. I also try to apply Java profile to project but
nothing changed.
This seems pretty disappointing because (for example) Rational Software
Architect is able to declare exceptions throwed bya a method and generate
corresponding java code.
Can anyone help me ?

PS: i use last Papyrus (Version 0.10.1.v201309181302) release with Eclipse
Kepler.

Claudio Retico
Re: How model exception throws in Java [message #1230914 is a reply to message #1230840] Mon, 13 January 2014 11:12 Go to previous messageGo to next message
Claudio Retico is currently offline Claudio ReticoFriend
Messages: 2
Registered: January 2014
Junior Member
And you suppose this will work with Acceleo UML2 Java transformation i.e. i will find the throws in generated code ?
I later will try.

Thanks
Re: How model exception throws in Java [message #1230980 is a reply to message #1230914] Mon, 13 January 2014 14:11 Go to previous messageGo to next message
Marc-Florian Wendland is currently offline Marc-Florian WendlandFriend
Messages: 81
Registered: January 2013
Member
Don't know. But this is the way how exceptions are modeled in UML.

Regards,
Marc-Florian

"Claudio Retico" wrote in message news:lb0hnr$b76$1@xxxxxxxxe.org...

And you suppose this will work with Acceleo UML2 Java transformation i.e. i
will find the throws in generated code ?
I later will try.

Thanks
Re: How model exception throws in Java [message #1230989 is a reply to message #1230914] Mon, 13 January 2014 14:35 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6934
Registered: July 2009
Senior Member
Hi

You seem to be confusing domains.

You were discussing modeling exceptions in UML.

Now you ask about an exception in Acceleo which impleemnts MOFM2T but
defines no exception capability.

MOFM2T extends OCL which also does not throw exceptions; rather using
in-band passing of invalid values.

If you contrive to get Acceleo to execute code that throw an exception,
you shoukld find that Acceleo treats it as OCL's invalid.

Alternatively if you define UML function bodies you would normally use
OCL and so get no exceptions. ALF too gives no exceptions.

I think you will only get java exceptions if you code Java exception
throwing manually, perhaps using some OCL/ALF black box queries that throw.

Regards

Ed Willink

On 13/01/2014 11:12, Claudio Retico wrote:
> And you suppose this will work with Acceleo UML2 Java transformation
> i.e. i will find the throws in generated code ?
> I later will try.
>
> Thanks
Previous Topic:First Time User Guide User - Help on Following Directions
Next Topic:Generate c++ code dont work
Goto Forum:
  


Current Time: Sun Nov 29 22:37:39 GMT 2020

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

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

Back to the top