Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsUML OCL and Date
https://www.eclipse.org/forums/index.php/mv/msg/121515/370966/#msg_370966
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 :)]]>RefuX Zanzeebarr2009-07-29T03:48:30-00:00Re: UML OCL and Date
https://www.eclipse.org/forums/index.php/mv/msg/121515/371434/#msg_371434
This seems like a query for the UML newsgroup; certainly OCL has no Date
type.
However any Java datatype can be used in your models by declaring it as
the instance type of an EDataType for your Ecore model.
Regards
Ed Willink
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 :)]]>Ed Willink2009-07-29T05:49:18-00:00Re: UML OCL and Date
https://www.eclipse.org/forums/index.php/mv/msg/121515/373316/#msg_373316
Originally posted by: Alexander.Igdalov.borland.com
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 :)]]>2009-07-29T13:50:55-00:00