The modeling tools provide APIs for project merging and differencing. There are two separate APIs:

Project merging consists of three steps:

  1. Discovering project changes (differences). The ancestor (in a 3-way merge only) and source projects are loaded (if they are not loaded yet) for comparing.
  2. Accepting / rejecting changes. All target changes that do not conflict source changes are applied (source changes conflicting with target changes are rejected). A 2-way merge produces source changes only.
  3. Applying accepted changes. Changes are applied on the ancestor project (target and ancestor projects are the same in a 2-way merge).

There are APIs for standard and advanced project merging. The standard API encapsulates all three steps into a single call, while the advanced merge API allows for accessing the project differences and controlling what changes are accepted or rejected.

The following figure shows the domain model of the merging procedure.


 You can find the code examples:

  • for Merge API (requires the Project Merge plugin to be installed first): <installation_directory>\openapi\examples\merge
  • for Compare API: <installation_directory>\openapi\examples\compare