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

  • Merge - allows for project merging. The Merge API comes together with the Project Merge plugin, which requires a license. You can access the Merge API javadoc at <installation_directory>\openapi\docs\merge_javadoc.zip once you acquire and install the Project Merge plugin.
  • Compare - allows for project differences comparison. The Compare API comes together with the internal Merge Core plugin, which is available pre-installed on the modeling tool. You can access the Compare API javadoc at <installation_directory>\openapi\docs\javadoc.zip once you have the modeling tool installed.

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