Home Forums Business Model Enumerations Why do we need to persist Enum and when does it get persisted?

Viewing 1 reply thread
  • Author
    Posts
    • #494
      Wyuwyu
      Participant

      I am trying to add more keys to an existing enum. Basically I want to make it more specific for the OUTSTANDING enum key to split into something like WAITING-FOR-SOMEONE-ELSE, DEFERRED etc. After adding the new keys, I reload the database in hope a dropdown select box which uses these keys to have the up-to-date values I added but no luck. I am wondering what’s going wrong with my approach. By the way, I kind of don’t understand why do we need to persist Enums’ as they are not like other classes for which you can create instances. Also, how does enum peristence get triggered in the first place?

      Any feed back will be much a preciated.

      Wen

      0
    • #496
      Vassiliy Iordanovvi
      Participant

      >Also, how does enum peristence get triggered in the first place?
      For now, modified enums are not detected automatically.
      Add a Load upgrade step (see Main.upgrade for an example) and increase the model version.
      Then shut down the server and upgrade the DB.

      For prototyping purposes, it is possible to set the loaded flag to false in the version table and restart the server, but in order to publish your model change correctly to the rest of the team, so that is upgrades other databases, you will have to use the upgrade metadata.

      I kind of don’t understand why do we need to persist Enums’ as they are not like other classes for which you can create instances.

      They are actually domain classes, except that there is dedicated metadata for them, that simplifies their maintenance. One can even derive some of them from a different base class, subject to certain constraints.

      They are persisted because that way one can use a database engine to filter and sort queries involving enumerations, by their captions etc. Also, it is possible to edit enums at run time, depending on their classification attribute. In other words, this allows supporting the common use cases with one overall approach.

      Have a look at the Enums class diagram.

      0
Viewing 1 reply thread
  • You must be logged in to reply to this topic.