Book a Demo

Author Topic: View and update created date  (Read 5257 times)

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
View and update created date
« on: January 10, 2011, 02:26:18 pm »
In, say, a functional requirement element, there is a field for created and last updated date.

Yet in an artefact element there is not.
How can I access the created date (to modify it).

{and why does an artefact not show these?}
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: View and update created date
« Reply #1 on: January 10, 2011, 08:22:42 pm »
I think the requirement is an exception to to the rule.
For most types of elements you cannot edit the created/modified date.

If you really need this you could of course write a little addin or script to modify those fields.

Geert

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: View and update created date
« Reply #2 on: January 11, 2011, 09:50:30 am »
Thanks.
This came about because an element copied from the model to the clipboard and then pasted back (as new) retains the original element's created date.
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

stefanw

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: View and update created date
« Reply #3 on: January 13, 2011, 02:14:23 am »
Quote
I think the requirement is an exception to to the rule.
For most types of elements you cannot edit the created/modified date.

If you really need this you could of course write a little addin or script to modify those fields.

Geert

I've written an addin and can change all Properties of
my Element(Requirement) but I can not change Created.
I tried to write a DateTime obj and the property seems to be changed, but if I look to the Model in EA, there is no change
in "Created" Date. In contrast the Name and other Properties changed.

My Code:
Element eaRequirement = subPackage.Elements.AddNew("myName", "Requirement") as Element;
eaRequirement .Created = myDateTimeObj;
eaRequirement .Update();

How can I modify the "Created" Property?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: View and update created date
« Reply #4 on: January 13, 2011, 06:52:20 pm »
The documentation claims the Created property is of type Date, not DateTime. Could that be a problem?

Can you check whether the Created property is really changed after you set it to myDateTimeObj? (before you call update())

It could still be a bug. I've seen other bugs where setting a property would do nothing at all. In that case you better report it to Sparx.

(What version are you on?)

If all else fails there is still the ultimate undocumented backdoor of Repository.Execute(SQLString), but I would only use that as a last resort.

Geert