|
|
Re: UML OCL and Date [message #373316 is a reply to message #370966] |
Wed, 29 July 2009 13:50 |
Eclipse User |
|
|
|
Originally posted by: Alexander.Igdalov.borland.com
Hi RefuX,
> * Can I define a < operation of an EDate?
See
http://help.eclipse.org/galileo/topic/org.eclipse.ocl.doc/re ferences/overview/advanced/customization.html
HTH,
Alex.
RefuX wrote:
> Well color me a newbie, but I've run into an unexpected problem. I am
> creating an attribute with a Date type in UML (RSA 7.5.1) and there is
> no Date type :(
> So I try to be smart and Import the Ecore datatypes and make the type of
> my attribute EDate.
>
> Then I add a classic OCL example constraint self.effectiveDate <
> self.expirationDate
>
> Of course I'm not completely excited about using an EDate, since I
> really want to do a comparison on calendar days, not seconds.
>
> So anyhoo... I generate my EMF code, OCL included in it (w00t!), run
> validate:
> java.lang.UnsupportedOperationException: Cannot find operation
> (<(EDate)) for the type (EDate)
>
>
> So I guess this leads to a few questions:
> * Is there is standard UML type for Dates?
> * Is there is standard way to dealing with this Date issue?
> * Can I define a < operation of an EDate?
> * If I use a custom Data Type (CalendarDate mayhaps?), how to I make it
> 'run' in OCL? (thought occurs to me, I create a daysSince1920 attribute
> of type int and I write self.effectiveDate.daysSince1920 <
> self.expirationDate.daysSince1920)
>
> Answers to my late night rambling appreciated :)
|
|
|
Powered by
FUDForum. Page generated in 0.23150 seconds