How to merge 2 Object schemas from different packages?

How can I properly merge 2 replacing Object schemas that are in different packages so that we can just end up with a single replacing Object schema in the desired package?

 

Say for example we have a replacing schema for Contact in one package, and another replacing schema for Contact in another package. Each of these changes adds 1 column, let's say UsrColumn1 in Package A and UsrColumn2 in Package B. In order to clean up the package structure, we want to merge this all into Package A, so there will be only 1 replacing Object schema for Contact. How can we go about doing this in Creatio?

 

Recreating the column in the Package A replacing Object schema will not be ideal, as there are BPs and other areas that may use the Colum UId, which would be different if recreating the same column name in Package A, so this will lead to breakages that have to be fixed on a case by case basis. Not tenable if there are more changes than just this toy example.

 

Would it be possible to merge them manually using the metadata's "Modifications" editor? As this allows editing and saving, so perhaps this is the expected way? The Modifications metadata also appears to be what gets saved to the file system in FSD (fileDesignMode), so it seems the most likely answer. This isn't great for ensuring every change is merged, as there seems to be a lot of "noise" in terms of lines that don't actually appear to be specific changes made in that replacing schema, but might be ok for basic column moving.

 

Are there any other options I'm missing? It would be so useful to have this kind of merging built into the platform, but I'm guessing it's not available to us.

Like 4

Like

5 comments

+1

+1

+1

Quick update on what I found when attempting manually merging the Objects' metadata (using the "Modifications package" area):

  1. It seems to work for the most part with a very simple change (2 columns in my case)
  2. It is time-consuming checking through the cryptically-named values and trying to cross-reference against the "Metadata (Ready-Only)" area, and liable to mistakes
  3. Some parts I just ended up ignoring the differences on, e.g. on Contacts there was a lot of supposed changes to "SynchronizeAnniversary" items, that were under MetaData.Schema.EG1.BK15 in the modifications package (MetaData.Schema.EventsProcessSchema.Mappings array in "Metadata (Read-Only)" area) as I don't believe there were any changes made there. This seems like it could be a point where things fall down though.
  4. One thing that isn't stored in the "Modifications package" diff is Localizable strings, so field names can't be manually merged in this way. I fixed this ad-hoc by setting the field names for the moved columns, but it's obviously not ideal. An alternative approach worth considering is exporting the Object schemas (resulting in a .md file) and doing a manual merge there, before re-importing into the desired package, as the .md files do have the localizable strings in them
  5. Another pitfall of this method was that some of the data couldn't just be copied over from the to-be-removed Object to the surviving Object, it had to be modified. Namely the "A3" and "A4" properties (corresponding to CreatedInSchemaUId and ModifiedInSchemaUId) as not setting them to the target package's UId's would throw errors when publishing the surviving Object

I might update further on attempting a .md file merge of a slightly more complicated setup.

Overall, it definitely doesn't seem to be an ideal way to perform this for more substantial sets of changes. Really would benefit from information from Creatio about how they would advise this to be done.

best way for me. on development/sandbox system

  1. export schema metadata from both packages (save it for backup)
  2. open both schema metadata in editor (Visual Studio or any other)
  3. move desired columns from source schema to target. target package in my cases is lower in hierarchy (higher - if you look on Package Hierarchy in )
  4. change values of PackageUId (A5) in every column metadata
  5. change values of SchemaUId (A3,A4) in every column metadata
  6. add UId of moved columns to ~ MetaData.Schema.D2 array
  7. move all localizable values for moved columns from source schema to target
  8. import source schema metadata
  9. import target schema metadata
  10. generate source code for both (may be better for all same schemas)
  11. update database structure (target schema - first, cause it contains moved columns, then source schema)
  12. if everything good - compile all
  13. if not - import backed up schema metadata

    check data in moved columns

    if everything good: install app, containing both packages to the pre-prod system, check data in DB tables, check localizable values for column title, business-processes, may be pages. install to the prod system

    if you have source package and target package in different apps or there are standalone packages, - install target package first to avoid data loss

Show all comments