We have a situation where we have a metadatabean that extends another one like in this example:
<type=“concreteEntity” extends=“base”> At the time concreteEntity was created it was with a base with edition=1. Now we want to update the base with an edition=1 with some minor changes (mostly short names and long names changes) and we need all the descendents metadatabeans to pick up the changes. There are no new fields in “base”, just property changes so there should not be any data conversion issues for any dataObjects.
How can we upgrade the existing descendents from “base-1” to pick up the changes of “base-2”? I assume that the new descendents will have edition=2 too. Is there anything in the metadata service that will allow us to tell it to upgrade the metadatabeans with the latest versions of the parents?
Since there are no conversion issues to upgrade dataobjects, how can we change the edition in them too?
Thanks
If there are no conversion issues, and you’re fine with the shortName or longNames immediately affecting all DataObjects whose type extends “base”, I’d just update base edition 1, instead of making a new edition of base. (See Deciding when to make a new edition docs). The use case for edition is when you need to make breaking changes that will invalidate your existing DataObjects (adding a required field, lowering a maxLength, etc.) and not for non-breaking changes like shortName/longName adjustments.
That said, if you really need a new edition, I would suggest making a new edition of any sub-types (e.g. concreteEntity edition 2) and make sure the 2nd edition of concreteEntity extends the 2nd edition of base. Then to update all your DataObjects of type concreteEntity to edition 2, you could probably just issue a patch operation, saying patch DataObjects where type=concreteEntity specifically setting edition to 2. Patch (bulk update) docs here.
We also provide a tool to actually do more complicated edition migrations via a hook, or you can wire up the tool to manually migrate everything at once, or to page your way through the DataObjectService and manually do the migration. DataObjectEditionMigrator docs here.
Thanks, updating the base metadatabean without changing the edition worked for what I wanted to do.
1 Like