Skip to main content

Import Rules

This page explains how YAML descriptions are reflected in models when importing YAML into Next Design.

Matching by id​

Each model in the YAML is matched against Next Design models by its id.
Matching is not done by name or model path (because models with the same name may appear together).
The exported YAML contains a short ID (approximately 6 alphanumeric characters like HHGAJJ) for all models.

id ValueHandling
Not writtenCreates a new model.
Values ​​starting with new- (e.g., new-1)Creates a new model.
This value can be referenced from within the same file (temporary ID).
Short ID/GUID of an existing modelUpdates that model.
Short ID/GUID that doesn't match any modelAborts with an error.
The model remains unchanged.
Values ​​other than those above (e.g., SOF-1)Aborts with an error.
The model remains unchanged.
  • A new model is created only when id is not specified or when a value starting with new- is specified. A mistyped id or id from a model in another project will not be created as a new model.

  • You cannot use custom values ​​such as management numbers as id. If you have a YAML file with a custom value, rewrite the id of the newly created model to a value starting with new- before importing (e.g., SOF-1 → new-SOF-1). Rewrite the id of the reference pointing to that model to the same value. Management numbers should be stored as a field in the model.

  • The id of a new model will become a shortened ID after import. Models added without an id will be recreated and duplicated if the same file is imported again. On the screen, the id is automatically written back for files in the Yaml folder. For other files, either re-export them after importing, or use --write-back in yamlexchange. See Handling Model IDs for details.

Note

Do not overwrite the id of an existing model.
If the overwritten value matches the id of another existing model, it will not result in an error, and that model will be updated. If the position in the YAML is different, the model may also be moved to the position where it was written (Moving Models).
When creating a new model by copying elements from YAML, delete the id row of the copied element. If you copy the entire sub-element, delete the id row of all copied elements, including their descendants.
Deleting the id row of an existing model will create a new model. If you select [No] (without --prune in yamlexchange), the original model will remain (resulting in a duplicate). If you select [Yes] (with --prune), the original model will be deleted, and the reference to that model will also be lost.
Before importing, check the details of changes displayed in the Output tab of the Info window to ensure that the updated model is as intended.

Handling of Unwritten Items​

Fields and child elements not written in the YAML will generally not be changed.
You can also import a file containing only the models and fields you want to update.

However, the handling of references and child elements not written in the YAML depends on the import method (Usage from Next Design > When asked "Do you want to remove these?").

Import MethodSpecified in yamlexchangeUnwritten Reference FieldsUnwritten Owning FieldsUnwritten Other Fields
[No]Do not include --completeNo changes.No changes.No changes.
[Yes]Include --complete --pruneRemove all references (referencing written in the field at the opposite end of the relationship remains).Delete child elements along with their sub-elements.
If --prune is not included in yamlexchange, no changes will be made.
No changes.
  • For files where only parts have been written by AI, select [No] when importing (do not add --complete in yamlexchange).
  • Models deleted during screen import can be restored with a single Undo operation along with the entire import.
  • Other fields (including rich text) will not be changed if they are not written, regardless of the import method.

To make a value empty, write '' for string fields and [] for reference fields.
null, ~, and keys with no value are not read as "empty"; the current value is retained and a warning is issued.

Child Element Order​

The order of child elements written in YAML is directly reflected in the order of the models.
If a new model is written in the middle of an array, it will be created at that position.

  • In files where only parts of the child elements are written, the order is not reflected (because the position of the unwritten models cannot be determined). In this case, the new model will be added to the end.
  • If you let AI edit the YAML, check before importing to ensure that no unintended reordering has occurred.

Moving Models​

If you write an existing model under a different parent (or a different owning field of the same parent) in the YAML, the model will move to that location.
Leave the id as is and delete the description of the original model (writing the same id in two places will result in an error).

- name: Brake ECU
class: In-vehicle system software development.Software requirements specification development.Software requirements specification.SoftwareRequirementSpecificationGroup
id: DM40DS
SubGroups:
- name: Meter ECU
class: In-vehicle system software development.Software requirements specification development.Software requirements specification.SoftwareRequirementSpecificationGroup
id: HHGAJJ # Model moved from another location. The id remains unchanged.
  • Movement is only possible within the scope of the import.
  • Movement to a subdirectory of itself, or a move where the destination field does not accept that class, will be skipped and a warning will be issued.

Handling References​

The value of a reference field is written by listing the id of the referenced object in the form {id: …}.
The comment at the end of the line (the name of the referenced object) is for the reader's reference and is not used in the import.
To remove a reference, delete the {id: …} from the reference field and import.

  SoftwareStructureElements:
- {id: PJVS93} # Target control value
Note

If you write the key of a reference field, that array will become the complete list of references. When adding a reference, be sure to list all existing references you want to keep (it's best to add them to the exported array). References you don't include will be removed. This also applies when importing with the [No] option (without --complete in yamlexchange).

  • References are added and removed based on the YAML content. Adding [] to a reference field removes all references to that field.
  • References appear in both related fields. When adding a reference, you only need to add it to one end. Leave the array at the other end untouched. If you don't modify it, the added reference won't be undone.
  • References that cannot be found will be ignored, and a warning will be issued. References in fields with this warning will not be removed either (only the addition will be reflected). Re-importing after correcting the cause of the warning will reflect the removal.

When creating new models in the same file and having them reference each other, write a temporary ID (a value starting with new-) in the id field of the new model, and write the same value in the referencing model.

schema_version: '1.0'
root:
- name: Software Requirements Specification
class: In-Vehicle System Software Development.Software Requirements Specification Development.Software Requirements Specification.SoftwareRequirementSpecificationModel
id: N23CR3 # Existing parent
Notes:
- name: Supplement to Notification Requirement
class: In-Vehicle System Software Development.Metamodel Element.Note
id: new-1 # Temporary ID
Body: Notification is performed via the meter ECU display
- name: Cruise Control Driving Availability Notification
class: In-Vehicle System Software Development.Software Requirements Specification Development.Software Requirements Specification.SoftwareFunctionalRequirement
id: J6GKZH # Existing model
Comments:
- {id: new-1} # Referenced with the same temporary ID

In the reference on the source side of the association, the association itself is written as rel (association name, class, id and value).
To change the value of the association, rewrite the contents of rel and import.
Removing rel does not change the association. Removing the reference itself removes the association.
New references can be created using only {id: …}. Writing rel assigns that value to the created association.