Author Topic: Enforcing data type validation on tagged values  (Read 3479 times)

Dave_Bullet

  • EA User
  • **
  • Posts: 295
  • Karma: +0/-0
    • View Profile
Enforcing data type validation on tagged values
« on: June 13, 2008, 11:46:44 am »
Maybe I'm missing something really basic in the help...

I can add a "Date retired" attribute to my stereotype in my UML profile of type "date".  How do I enforce users to only enter a date (ie. dd/mm/yyyy) in the tagged value window when creating a new element based on my stereotype (from my UML profile?)

Thanks,
DAvid.
"I know I'm close to a good design, but it's like the balloon animals, squeeze in one spot and the problem moves down the line"

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: Enforcing data type validation on tagged value
« Reply #1 on: June 13, 2008, 11:59:11 am »
Have a look at predefined tagged value types and then:

Quote
Create an MDG Technology that bundles your UML Profile and your tagged value type definitions into a single file. Then when you import the technology your target model is guaranteed to have the tagged value types.

You can get more than a text filter, you can get a date field complete with a date selector.
« Last Edit: June 13, 2008, 11:59:28 am by simonm »

Dave_Bullet

  • EA User
  • **
  • Posts: 295
  • Karma: +0/-0
    • View Profile
Re: Enforcing data type validation on tagged value
« Reply #2 on: June 13, 2008, 02:11:32 pm »
Hi Simon,

I looked at that, but couldn't figure out how to set / link the data type of the attribute in the stereotype.  

Here's what I've got.

A <profile> called MyProfile
MyProfile contains a package <metaclass>
MyProfile contains a MyPackage <stereotype> that extends the package metaclass above
MyPackage stereotype contains a DateDeployed attribute.

I've tried setting the DateDeployed attribute type = DateTime - but that default is not observed when I add a new element of type MyPackage to the diagram.  The DateDeployed tagged values gets created, but does not behave like a datetime with calendar picker.

Any ideas?
Thanks,
DAvid.
"I know I'm close to a good design, but it's like the balloon animals, squeeze in one spot and the problem moves down the line"

Dave_Bullet

  • EA User
  • **
  • Posts: 295
  • Karma: +0/-0
    • View Profile
Re: Enforcing data type validation on tagged value
« Reply #3 on: June 13, 2008, 02:25:22 pm »
I've answered it myself.  I was being dumb. I thought the tagged value type - became the data type of the attribute in the stereotype.  That is wrong.  The tagged value type IS = the NAME of the attribute itself (the type of the attribute doesn't matter).

All working now - thanks for the cross post.  HEre if others want it:
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1212434803/3#3

Cheers,
DAvid.
"I know I'm close to a good design, but it's like the balloon animals, squeeze in one spot and the problem moves down the line"