Book a Demo

Author Topic: Get new Element instance in memory without persisting to the database?  (Read 4037 times)

Rich Anderson

  • EA User
  • **
  • Posts: 142
  • Karma: +8/-0
    • View Profile
    • LinkedIn
Is there any way to get a new instance of an Element in memory without having to use an AddNew method on a Package or Element which immediately persists the new Element to the database?   What I would like to do is create an Element in memory, set properties and then later optionally add it to a Package Elements collection if it passes all the tests I have defined for it.  When I try...

Code: [Select]
Dim myElement as New Element()
myElement.Name = "Joe"

The first statement fails and I understand why it does.  I suppose the alternative is to create an element in temporary package and then delete it, but maybe there is a better way?   
Rich Anderson
Urgnt Limited

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
No, there is no other way. The only way to create a new thing in EA is to add it to the collection of its parent.

Geert