Skip to main content

Overview of merging with NDMerge

Shows what to merge and what to merge with NDMerge.

Merging branches

  • NDMerge merges the Next Design data of the current branch (own) and the specified other branch (other).
    • Instead of merging textual differences like the standard Git merge behavior, Next Design builds data for each file in memory and merges differences for each model.
      • The following files of Next Design are supported, and data is constructed for each file.
        • JSON format file
          • nproj
          • nprof
          • nmdl
        • DB format file
          • iproj
          • iprof
          • imdl
    • For example, build and merge the data of model A.nmdl in the current branch (own) with model A.nmdl of the specified other branch (other). Data from other model files have no effect on merging model A.nmdl.

Element-by-element merge summary

NDMerge treats model-level changes as diffs, rather than the usual line-by-line change diffs. The merged result is reflected in the Next Design file. If there are conflicts, an error will occur and merging will not be possible.

Merging Models

  • If there are no conflicts on the model between the current branch (own) and the specified other branch (other), you can merge field values, model additions/deletions, etc.

  • Merge example

    • The model data for each branch is shown below.

      //base model example
      {
      "Metamodel": "Use case",
      "Fields": {
      "Name": "Adaptive run (ADAPTIVE)",
      "Description": "Driving while maintaining the following distance from the preceding vehicle.",
      "Scenarios$Embed": [ ]
      }
      }
      //An example model for the current branch (own)
      {
      "Metamodel": "Use case",
      "Fields": {
      "Name": "ADAPTIVE-DRIVE", //change the value of Name
      "Description": "Driving while maintaining the following distance from the preceding vehicle.",
      "Scenarios$Embed": [ //add one scenario
      {
      "Metamodel": "Scenario",
      "Fields": {
      "Name": "Basic flow", }
      }]
      }
      }
      //example of the model of the specified other branch (other)
      {
      "Metamodel": "Use case",
      "Fields": {
      "Name": "Adaptive run (ADAPTIVE)",
      "Description": "Driving while maintaining the following distance from the preceding vehicle. If there is no preceding vehicle, it will drive at a constant speed.", //Change the value of Description.
      "Scenarios$Embed": [ //add one scenario
      {
      "Metamodel": "Scenario",
      "Fields": {
      "Name": "Exception flow (E1)", }
      }]
      }
      }
    • The above own and other changes do not conflict, so the merge result is as follows. In particular, element additions to the Scenarios field are treated logically, merging both own and other changes.

        //Example model after merging
      {
      "Metamodel": "Use case",
      "Fields": {
      "Name": "ADAPTIVE-DRIVE", //merge own values
      "Description": "Driving while maintaining the following distance from the preceding vehicle. If there is no preceding vehicle, it will drive at a constant speed.", //Merge other values
      "Scenarios$Embed": [ //merge both own and other
      {
      "Metamodel": "Scenario",
      "Fields": {
      "Name": "Basic flow", }
      }
      {
      "Metamodel": "Scenario",
      "Fields": {
      "Name": "Exception flow (E1)", }
      }]
      }
      }

Merge display information

  • Position and size of diagram shapes, styles such as background colors and fonts are merged with priority given to the current branch (own).
    • Even if there is a change in display information between the current branch (own) and the specified other branch (other), it will not be displayed as a conflict and will adopt the current branch (own) changes.
    • Note that if you have specified a merge-preferred branch as an option, that branch's value will be used.

Merging Profiles

  • If there are profile changes in the current branch (own) and the specified other branch (other), they cannot be merged and will be detected as a conflict.
    • A change is considered if there is one or more changes in the metamodel, view definition.

Merging Projects

  • If there are no project information conflicts between the current branch (own) and the specified other branch (other), they can be merged.