Model Merge Conflicts
On project load, DaVinci Configurator loads all referenced ARXML files into its internal model. When multiple files define the same AUTOSAR element, this can lead to different types of merge conflicts, especially if some ARXML files are not AUTOSAR-conformant.
DaVinci Configurator reports these conflicts in the Model Merge Report and categorizes them as either solvable or non-solvable. All conflicts require either manual resolution or automatic resolution. Solvable conflicts can be resolved automatically if the user activates the optional feature.
|
Non-solvable conflicts are always handled as errors and abort the project load. Both non-solvable and automatically resolved conflicts are reported in the Model Merge Report. |
Conflict Types
| Type | Description | Requires Manual Resolution |
|---|---|---|
Arises if an AUTOSAR element (splitable or non-splitable) is defined in multiple files, but the split is invalid. |
||
Arises if an AUTOSAR splitable element is defined multiple times in ARXML files and one instance is missing a (Post build) variation point definition. |
Yes |
|
Arises if an AUTOSAR splitable element is defined multiple times in ARXML files and the variation points differ in their short label definition. |
Yes |
Conflict Message Structure
The general structure of a conflict message in the Model Merge Report is as follows:
[AUTOMATIC MERGE APPLIED] <<winning value>> from <<winning file>> (1)
Invalid model split detected for <<AUTOSAR path>> <<DefRef>>(2)
Cause: The parameter is contained with different values {{values}}(3)
Contained in [
<<file path>>: <<startLine>>[<<column>>]-<<endLine>>[<<column>>](4)
...
]
| 1 | AUTOMATIC MERGE APPLIED: Information about automatic merge resolution (if applied) |
| 2 | Description of the conflict type and the conflicting element, here an Invalid model split |
| 3 | The cause of the conflict, providing more details depending on the type |
| 4 | The files and their line and column numbers, denoting a section where the conflicting element or the parent elements are contained |
|
The line and column information is based on a best-effort computation and has some Limitations. |
Resolve Conflicts
If a project load aborts, the reported Model Merge Conflicts must be resolved. The recommended approach is to resolve conflicts manually in the ARXML files.
Manual Resolution
Invalid Model Split
The conflict Invalid Model Split is the most common conflict type that can arise during project load.
It arises if an AUTOSAR element (splitable or non-splitable) is defined in multiple files, but the split is invalid.
The Invalid Model Split conflict is solvable by the Automatic Conflict Resolution of the DaVinci Configurator.
Steps
-
Identify the AUTOSAR element for which an invalid model split is reported.
-
Read the cause reported for the conflict for details.
-
Open each ARXML file mentioned in the conflict message.
-
Compare all instances of the conflicting element in the files.
-
If the element is non-splitable, move the correct data into a single ARXML file and remove the other occurrences.
-
If the element is splitable, check that
-
each fragment contains only the allowed subset of child elements, and
-
no fragment repeats attributes or sub-elements that must be unique.
-
-
If necessary, adapt the values to be equal in both files and keep all elements.
-
If the element is generated, try to find the source of the conflicting instances and correct that source if possible.
-
-
Save the ARXML files and reload the project to verify that the conflict is resolved.
| If the conflicting element has a unique name or value, you can also use the search functionality of your text editor to find all instances in a file. |
Missing Variation Point
The conflict Missing Variation Point arises if an AUTOSAR splitable element is defined in multiple ARXML files and one instance is missing a (Post build) variation point.
Variation points are used to define different variants of an AUTOSAR element.
If one instance of a splitable element is missing a variation point definition, the tool cannot decide which instances should be merged.
| This conflict is non-solvable and needs manual fixing. |
Steps
-
Identify the splitable AUTOSAR element for which a missing variation point is reported.
-
Read the cause reported for the conflict for details.
-
Open each ARXML file mentioned in the conflict message.
-
Compare the element and variation point definitions across files and locate the instance that is missing the variation point.
-
Add the required variation point to the instance
-
Alternatively, remove the inconsistent fragment if it is not needed.
-
-
Save the ARXML files and reload the project to verify that the conflict is resolved.
| Variation points are hereditary. Check the parent elements for variation points as well. |
Missing or Conflicting Short Labels in Variation Point
The conflict Missing or Conflicting Short Labels in Variation Point arises if an AUTOSAR splitable element is defined in multiple ARXML files and the variation points differ in their short label definition.
Variation points are used to define different variants of an AUTOSAR element.
If one instance of a splitable element’s variation point is missing a short label, the tool cannot decide which instances should be merged.
| This conflict is non-solvable and needs manual fixing. |
Steps
-
Identify the splitable AUTOSAR element for which short label conflicts are reported.
-
Read the cause reported for the conflict for details.
-
Open each ARXML file mentioned in the conflict message.
-
Compare the element and variation point definitions across files and locate the instance that is missing or has differing short labels.
-
Ensure that all same variations use the same short label, and
-
Remove or rename any conflicting labels.
-
-
Save the ARXML files and reload the project to verify that the conflict is resolved.
| Variation points are hereditary. Check the parent elements for variation points as well. |
Automatic Conflict Resolution
Automatic Conflict Resolution is a best-effort feature that can be activated or deactivated per project.
| Please note that automatic conflict resolution can overwrite data, which can lead to data loss. Check automatic resolutions carefully before saving the project. |
Activation
Enable this optional feature in the DaVinci Project Settings file General.json with the following entry:
{
"allowMergeConflicts": true
}
Recommended Steps
-
Activate the setting in the DaVinci Project Settings, see Activation.
-
Reload the DaVinci Project. A new Model Merge report is created.
-
Review automatically resolved conflicts in the Model Merge Report for correctness.
-
If the project load still finishes with conflicts, resolve any non-solvable conflicts manually, see Manual Resolution.
-
Save the DaVinci Project.
Procedure
DaVinci Configurator resolves solvable conflicts using a priority-based strategy. If a solvable conflict is found, the tool automatically merges the conflicting element according to the configured priority rules.
|
If project load still aborts with Automatic Conflict Resolution active, the project contains non-solvable conflicts. Resolve all reported non-solvable conflicts manually. If Automatic Conflict Resolution is active, solvable conflicts are automatically resolved and the Model Merge Report contains those resolved conflicts as warnings and non-solvable conflicts as errors. |
Read-Only Files
The next DaVinci Project save action writes automatically resolved values into the corresponding ARXML files if, and only if, the files are not read-only. DaVinci Configurator treats all files from the BSW Package and other tools such as DaVinci Developer Classic as read-only.
| The DaVinci Project save can only update internal files, as read-only files cannot be changed. |
If conflicts re-occur, please fix external files manually or in the corresponding source tool (for example, DaVinci Developer Classic).
Some CLI tasks of DaVinci Configurator might also trigger an automatic project save. Therefore, enabling automatic conflict resolution by default for projects is not recommended.