Skip to main content

Changes in Next Design V5.1 Service Update 1

Changes to Extension Functionality​

Next Design V5.1 Service Update 1 improves the behavior related to loading model files. The API names, argument types, and return value types have not changed, but the return values, the conditions under which exceptions occur, and the conditions and timing of events have changed for some APIs. Check the following information and the changes for each API to determine the impact on existing extensions and scripts.

Improvements to Model File Loading​

Previously, some model files could remain marked as loaded (IModelUnit.Loaded was true) without their contents being loaded, causing the models in those files to return default values (calling IWorkspace.LoadModelUnits did nothing because the files were already considered loaded). In V5.1 Service Update 1, these model files are also loaded through their contents and return the correct values.

  • Model files with manual loading settings that were loaded before reloading a project. This includes reloading with the IWorkspace.ReloadProject method, pulling from NDGit, updating from SVN, and reloading after a change is detected outside Next Design. After the reload, the contents are loaded in the background (the loading settings do not change). If an API references a model before loading is complete, the model is loaded immediately, in the same way as a model file with automatic loading settings. However, APIs that inspect tags (IModel.Tags, GetTag, HasTags, and FindChildrenByTag) do not load the file.
  • Model files whose loading settings were changed to manual loading with the IWorkspace.SetLoadMode method immediately after opening a project. The contents are loaded in the background while the project is open. The next time the project is opened, these files are not opened as manually loaded files.
  • Model files in a project being compared that are marked as loaded but whose contents have not been loaded. The IDiff.ComputeModels method now loads these model files before comparison, regardless of their loading settings (when the overload that specifies the model files to compare is used, the specified files are loaded). Previously, these models were compared as empty, which could produce differences for models that had not changed. The behavior for unloaded model files (IModelUnit.Loaded is false) is unchanged.
    • If a model file cannot be loaded before comparison, the method throws ExtensionInvalidOperationException (the same type thrown when an unloaded model file exists), stops the comparison, and the IDiff.GetComparison method returns null. Check for null before using the result.
    • Loading before comparison requires processing on the UI thread. If the call is made from a thread other than the UI thread, do not stop the UI thread and wait for the call to complete.

The handling of model files that failed to load has also changed.

  • A model file that could not be loaded now has IModelUnit.Loaded set to false and IModelUnit.HasLoadError set to true, regardless of how the loading was initiated. Previously, a model file that failed during background loading remained marked as loaded.
  • The reason for the failure is written to the output window for background loading and to the Next Design log for the IWorkspace.LoadModelUnits and IProject.RealizeAll methods. If the model was loaded because it was referenced from an API, the same message that is shown when loading fails from the screen's “Load” operation is displayed after the operation that triggered loading.
  • The automatic loading status returned by the IProject.AutoLoadStatus property now represents the status at the time it was retrieved.
    • FailedModelUnits returns only the model units that have not been loaded at the time of retrieval. It does not include model units that were loaded later or model units that were unregistered from the project. Previously, it returned model units that failed during background loading as they were at that time.
    • State is Loading while loading is in progress. After loading finishes, it becomes Completed if no model files failed to load, or ErrorInterrupted if any remain. After an error interruption, if all failed model files are loaded or unregistered, State becomes Completed when retrieved again.
    • After a reload, State becomes Completed only after the manually loaded model files that were loaded before the reload have also finished loading. Therefore, completion takes longer after a reload (the time required to open the project does not change).
    • An IAutoLoadStatus that has been retrieved does not reflect subsequent status changes. If the latest status is required, retrieve the IProject.AutoLoadStatus property again.

As before, processing that must wait for loading to complete should use the State of a newly retrieved IProject.AutoLoadStatus (Completed or ErrorInterrupted) and FailedModelUnits, or the background auto-load completion event (onAfterAutoLoad).

Behavior When Unreadable Model Files Exist​

Projects can now be opened even when they contain model files that cannot be loaded because their contents are corrupted, they are in use by another program, or for a similar reason. A model file that could not be loaded has IModelUnit.Loaded set to false and IModelUnit.HasLoadError set to true.

  • The IWorkspace.OpenProject method can now open projects that contain unreadable model files or projects in which relationships or editors with the same ID are duplicated in separate model files. When duplicates exist, one model file is selected and opened, and the other is warned about as inconsistent.
    • As before, a project cannot be opened when a file loaded while opening the project (the project file, profile, or a model file with automatic loading settings) was saved with a major version newer than the version of Next Design in use. A model file with manual loading settings can be opened in this situation, but loading that model file fails.
    • The result when the project cannot be opened is unchanged. When opening it as the current project (isSetCurrent is true), a load-failure dialog is displayed and null is returned. When opening it as a project other than the current project, no dialog is displayed and an exception is thrown.
  • The IWorkspace.ReloadProject method no longer closes the project when an unreadable model file exists. Only the model file that could not be loaded has IModelUnit.Loaded set to false and IModelUnit.HasLoadError set to true.
  • The IWorkspace.LoadModelUnits method now treats a model file saved with a major version newer than the version of Next Design in use as a load failure. Previously, it loaded the file and marked it as loaded, so saving it rewrote the file in an older format. A model file whose top-level model's metamodel is not in the profile also cannot be loaded. After calling the method, check the result using the Loaded and HasLoadError properties of IModelUnit.
  • The IProject.RealizeAll method now includes model files that could not be loaded, including files saved with a newer major version, in the returned FailedModelUnits. It does not reload model files whose contents have already been loaded. It does not load model files with load errors, such as files that could not be loaded when the project was opened. After removing the cause without changing the file (for example, another program closed the file or read permission was restored), load it with IWorkspace.LoadModelUnits. If the model file was fixed by changing it, a class was restored to the profile outside the project, or a missing model file was returned to its original location, reload the project. A changed model file is treated as having been modified outside Next Design, so until the project is reloaded, both IWorkspace.LoadModelUnits and this method throw an exception.
  • The IWorkspace.SaveProject and IWorkspace.SaveAll methods now omit model files whose contents have not been fully loaded, save the other model files, and complete successfully. Unlike saving from the screen, they do not display a confirmation. IWorkspace.SaveProject reports the omitted model files in the output window. Previously, the file could be written with unloaded portions lost, or the entire save could fail.
  • The IWorkspace.SaveProjectAs method now returns false without saving when an unreadable model file exists, including a file saved with a newer major version. For the current project, it displays the same error message as the screen operation (it does not display the message for a project other than the current project). Previously, it threw an exception for the current project, and model files saved with a newer major version were written in an older format.
  • Each method of IProjectUnitManager (splitting, merging, importing, registering references to, and exporting model files) and the IProductLineModel.ExportAppliedProject method now stop with an exception when a model file saved with a newer major version exists, just as they do for other unreadable model files. Previously, the newer model file was loaded without error and written in an older format when the operation was saved.
    • The exception type and message for each IProjectUnitManager method are unchanged. The inner exception now includes the reason for each model file that could not be loaded. Processing that determines behavior from the message does not need to be changed.
    • The IProductLineModel.ExportAppliedProject method now throws ExtensionInvalidOperationException instead of passing through the inner exception. Existing files in the export destination are not deleted, and the applied product is restored.
    • A model file that could not be loaded can be identified using the IModelUnit.HasLoadError property.
    • Screen operations now display a confirmation asking whether to load the model files before execution, but APIs do not display this confirmation.

Model files that could not be loaded when opening the project, and model files whose top-level model's metamodel is not in the profile, are not included in background loading. If no other model files failed to load, background loading becomes Completed even when these files exist, and they are not included in the FailedModelUnits of IProject.AutoLoadStatus (previously, background loading did not complete when a model file had a different format or its metamodel was not in the profile). If IProject.RealizeAll is called while these model files exist, they are included in the returned FailedModelUnits and the automatic loading status becomes ErrorInterrupted (they are also included in the FailedModelUnits of IProject.AutoLoadStatus).

Use the IModelUnit.HasLoadError property to check all model files that failed to load. For processing that requires all models in the project, continue to load them with IProject.RealizeAll or IWorkspace.LoadModelUnits and check the result (the returned FailedModelUnits and the Loaded and HasLoadError properties of IModelUnit).

Handling Model Files Modified Outside Next Design​

When a model file that has not been loaded after the project was opened is modified outside Next Design, processing now stops with an exception to prevent loading or saving a mixture of old and new contents. If an exception occurs, reload the project before continuing.

  • If a specified model file contains a model file that was modified outside Next Design and has not yet been loaded, IWorkspace.LoadModelUnits now checks for this before loading and throws ExtensionInvalidOperationException without loading it. Previously, it loaded the file without checking, which could mix the structure from when the project was opened with new values.
  • If a model file whose contents have not been loaded was modified outside Next Design, IProject.RealizeAll now throws ExtensionInvalidOperationException without loading anything. A change to a model file whose contents have already been loaded does not cause an exception; the in-memory contents continue to be used without reloading.
  • If there are unsaved changes and a model file that will be rewritten during saving has not had its contents loaded and was modified outside Next Design, IWorkspace.SaveProject now throws ExtensionInvalidOperationException regardless of the forceOverwrite setting. Previously, when forceOverwrite was true or the model file had never been loaded, it loaded the file immediately and wrote a mixture of old and new contents. As before, no exception occurs when there are no unsaved changes.
  • If a model file waiting for background loading is modified outside Next Design, IWorkspace.SaveAll and IWorkspace.CleanUpProject now leave the model file unloaded and throw ExtensionInvalidOperationException until the project is reloaded (the behavior is the same as in V5.0). Previously, no exception occurred after background loading had loaded the model file. As before, an external change to a loaded model file causes an exception. External changes to a manually loaded model file that has never been loaded are not checked, because the file is neither loaded nor written.
  • Each IProjectUnitManager method and the IProductLineModel.ExportAppliedProject method now also stop with an exception when a model file whose contents have not been loaded was modified outside Next Design. Previously, they stopped only for changes to loaded model files.
  • A reload confirmation is now displayed when a model file that has not been loaded with manual loading settings is modified outside Next Design (see Changes to Events).

Handling Unloaded Model Files with Manual Loading Settings​

Product-line-related APIs no longer load model files that are unloaded with manual loading settings. Previously, these APIs loaded and processed the files, and saving could rewrite them. To include a model file in processing, load it with IWorkspace.LoadModelUnits before calling the API. Use the IModel.IsRealized property to determine whether it has been loaded.

  • Feature assignment and release, and setting application conditions (feature-assignment methods such as IModel.AssignFeature, feature-release methods such as ReleaseAssignedFeature and ReleaseAllAssignedFeatures, and the SetProductApplyCondition method)
    • If the target model is in an unloaded model file, the file is not loaded or changed, and ExtensionInvalidOperationException is thrown with a message indicating that the model cannot be changed because its model file has not been loaded. This is the same behavior as other change APIs, such as IModel.SetField.
    • If a feature specified by a feature-assignment method or SetProductApplyCondition (a feature in the expression) is in an unloaded model file, the file is not loaded or changed, and ExtensionInvalidModelException is thrown with a message indicating that a model in an unloaded model file cannot be specified. Previously, assignment succeeded without loading, while setting an expression loaded the file. Feature-release methods and setting an empty expression continue to release the assignment without loading the file.
    • ExtensionInvalidOperationException is now thrown when the target model has been deleted, and ExtensionInvalidModelException is thrown when a specified feature has been deleted. Previously, processing continued even when an item had been deleted.
  • APIs that change product-line models (the IProductLineModel, IFeatureModel, IConfigurationModel, IProduct, and IFeature APIs for adding and deleting feature models, features, and products; duplicating products with IConfigurationModel.DuplicateProduct; selecting and deselecting features; adding and deleting constraints; and setting IFeature.VariationKind, UniqueName, and IsDefaultSelected) no longer load an unloaded product-line model file. They do not change it and throw ExtensionInvalidOperationException with a message indicating that it cannot be changed because its model file has not been loaded. They also throw ExtensionInvalidOperationException when the target has been deleted. Previously, the file was loaded and changed when the API was called or saved, and could be rewritten during saving. In addition, deleting a constraint (IFeatureModel.RemoveFeatureConstraint or IFeature.RemoveConstraint) previously resulted in InvalidOperationException during loading.
  • APIs that retrieve product-line information now return the following values without loading unloaded model files (IModel.GetAssignedFeatures and IFeature.GetAssignedModels did not load these files previously, but the returned values have changed). The results of GetProductApplyCondition, GetAssignedFeatures, and GetAssignedModels are the same as in V5.0. Processing that searches by feature names in expressions, determines whether an expression is empty, or counts assignments can return different results when unloaded model files exist.
    • IModel.GetProductApplyCondition: If the product-line model is in an unloaded model file, returns the expression with “(Unloaded)” as the feature name (operators and parentheses are unchanged). If the target model is in an unloaded model file, returns an empty string.
    • IModel.GetAssignedFeatures: Returns an empty list when the target model is in an unloaded model file.
    • IFeature.GetAssignedModels: Does not include models assigned to the feature that are in unloaded model files.
    • IFeature.VariationKind, UniqueName, and IsDefaultSelected: If the product-line model is in an unloaded model file, return the saved feature kind, null, and false, respectively.
    • IProduct.SelectedFeatures: Returns an empty list when the product-line model is in an unloaded model file.
    • IFeatureModel.GetFeatureConstraint: Returns null when the product-line model is in an unloaded model file (previously, it threw InvalidOperationException).
  • Product application and checking (the IProductLineModel.ApplyProduct and ApplyProductBy methods, and the IModel.IsAppliedItemTo and IsAppliedItemToByName methods)
    • If a model with an application condition is in an unloaded model file, the file is not loaded, the model is excluded from checking, and the model is treated as applied (IModel.IsAppliedItem is true). No exception is thrown. Previously, the file was loaded for the check. The IsAppliedItemTo and IsAppliedItemToByName methods also loaded a model file when called for a model in another loaded model file.
    • ApplyProduct and ApplyProductBy, when setting the current product, display the number of model files that could not be checked in the output window. When those model files are loaded later, they are automatically checked again against the selected product. ApplyProduct when not setting the current product, and IsAppliedItemTo and IsAppliedItemToByName, do not display a message. If called after the model file has been loaded, the APIs check the loaded contents.
    • If the product-line model is in an unloaded model file, ApplyProduct and ApplyProductBy throw ExtensionInvalidOperationException without loading it. The message indicates that the product-line model file has not been loaded and includes the model file path. IsAppliedItemTo, IsAppliedItemToByName, and product-filtered model access (IModelAccessPolicy.SetSpecifiedProductAccess created with IProject.CreateModelAccessPolicy, and the IContextOption.PlModelAccessMode property) do not load the file and treat all models as applied.
  • IProductLineModel.ExportAppliedProject now displays the number of model files that could not be checked in the output window when a model with an application condition or a product-line model is in an unloaded model file. The contents of the exported project are unchanged.

Handling Relationships When a Product Is Applied​

Because features can now be assigned to relationships (diagram lines and derivation relationships), APIs that retrieve relationship targets while a product is applied now check whether the relationship itself is enabled, in addition to checking whether the target model is enabled. References, derivation sources and targets, and trace elements returned while a product is applied now include only relationships that are enabled for that product.

  • When a product is applied, the IModel.GetRefRelatedModels, GetDerivedModels, GetDerivingModels, GetFieldValues, GetFieldValuesByFieldTag, and IsRelatedAtFieldTo methods no longer return the target of an invalid reference relationship, including a derivation relationship, even when the target model is enabled.
  • When accessed with a product applied through context options, the ITraceNode.SourceNodes and TargetNodes properties no longer return invalid trace elements.
  • A relationship does not become invalid only when a feature is assigned to it. A relationship connected to an invalid model also becomes invalid even if no feature is assigned to the relationship. Therefore, in a project where no features are assigned to relationships, retrieving from an invalid model as the starting point no longer returns an enabled target model.
  • Calling IModel.AssignFeature for an element to which features cannot be assigned (an ownership relationship) now throws InvalidOperationException (“Features cannot be assigned to this element.”). Review processing that makes such calls.

Changes to Events​

  • The additional post-load event (onAfterModelUnitLoad) now occurs in the following cases as well:
    • When an unloaded model file is loaded by an operation that loads the entire project, such as merging, splitting, or exporting model files (from either an API or the screen).
    • When an unloaded model file is loaded by IProject.RealizeAll.
    • In these cases, the event occurs once after the operation for all model files that were loaded. It does not occur when the operation or IProject.RealizeAll returns; it occurs after the called command or event handler has finished and the UI becomes idle. It does not occur if the project is closed or reloaded before then. This applies only to the current project.
    • It also occurs for model files that were successfully loaded when the operation stopped because another model file could not be loaded.
    • It does not occur for operations such as importing, registering, or unregistering model files when the operation ends with a reload; the project reload completion event (onAfterReload) provides notification instead. It does not occur for model files that are removed from registration when saving the project with a new name (handle them in the project save completion event, onAfterSave). For model files that remain registered as references, it occurs when they change from unloaded to loaded.
    • An extension that processes all models itself after IProject.RealizeAll and also processes them in this event handler should avoid processing the same model files twice, for example by recording the IModelUnit objects already processed.
  • A reload confirmation is now displayed when Next Design detects that a manually loaded model file that has not been loaded was modified outside Next Design (after the UI becomes idle). Previously, the confirmation appeared only when a loaded model file was modified. If the user selects [Yes], the project is reloaded and the project reload-before event (onBeforeReload), project reload-after event (onAfterReload), and background auto-load-after event (onAfterAutoLoad) occur. Reloads can now occur in situations where they did not previously. References to models held by an extension become invalid after a reload, so make sure that the extension retrieves them again in onAfterReload.
  • The background auto-load-after event (onAfterAutoLoad) now occurs after the manually loaded model files that were loaded before a reload have also finished loading. As a result, it occurs later after a reload.
  • Field value changed-after event (onFieldChanged)
    • The event no longer occurs when values are populated by background loading (the behavior is the same as in V5.0). Previously, it occurred even when the user had not edited the model, for example for a note's Name or a field with an initial value that was not recorded in the model file, such as the Stereotype of a satisfaction relationship.
    • The event now also occurs for edits committed while Next Design rebuilds the screen after loading caused by referencing a model, loading before an operation that loads the entire project, IProject.RealizeAll, or loading before a difference comparison or merge (the unsaved indicator and undo history are also recorded). As before, it does not occur during loading before saving or during model file loading (the screen's “Load Model File” operation and IWorkspace.LoadModelUnits); see Restrictions.
    • The event now also occurs when an extension or another component writes a value from another thread while undo or redo is running. Changes to values restored by undo or redo are reported by the undo/redo event (onUndoRedo), not by the field value changed-after event.
    • The event continues to occur when the user edits a value.
  • A property-change notification handler registered with IModelEventDispatcher.RegisterPropertyChangedEventHandler
    • The handler is no longer called when values are populated while loading a model file (background loading, the screen's “Load Model File” operation, IWorkspace.LoadModelUnits, IProject.RealizeAll, loading caused by referencing a model, or loading before Save and Save As). It is also not called when the screen's “Load Model File” operation, including IWorkspace.LoadModelUnits, fails and restores the state from before loading. Previously, it was called for properties that changed only because loading populated values, such as a note's Name, memo, tags, the Stereotype of a satisfaction relationship, and IsRealized.
    • It is no longer called as a change to the model file containing the model when Next Design first inspects that model file (immediately after opening the project, during saving, or during export). As before, when the model's model file changes during Save As or model file merging, it is called once for each model.
    • It continues to be called when the user edits a value.
    • Use the additional post-load event (onAfterModelUnitLoad) or the background auto-load-after event (onAfterAutoLoad) to detect that a model file has been loaded.

Configuration Management Lock Information​

In projects integrated with configuration management, actual lock information obtained from configuration management (which user has edit permission) is now set for model files that are unloaded with manual loading settings. Previously, even when another user had edit permission, the initial values (HasLock true and LockAccount null) remained, and the values were not updated after loading the model file.

  • This applies to the IModelUnit.ScmStatus property (the HasLock and LockAccount properties of IScmFileStatus), the IModel.IsEditable property, and the GetEditPermission and ReleaseEditPermission methods of IScmManager.
  • For an unloaded model file, HasLock may be false, LockAccount may be another user's name, and IsEditable may be false. Extensions that assume unloaded model files are editable should check these values.

Other Changes​

  • Model files with a UTF-8 BOM at the beginning (which can be added when a file is saved by another editor) can now be loaded. Previously, the models in such files could not be loaded.
  • After updating to V5.1 Service Update 1, the first time each project is opened takes as long as when no cache database exists because the cache database created in V5.1 is rebuilt instead of being used. Subsequent openings take the same amount of time as before. Processing that waits for a project to finish opening therefore waits longer only the first time.

Restrictions​

The following restrictions affect extensions and scripts in V5.1 Service Update 1.

New Restrictions in V5.1 Service Update 1​

  • If a project opened with V5.1 Service Update 1 is opened with V5.1 (5.1.0–5.1.3) by the same Windows user on the same PC, a message beginning “Loading was interrupted because this project contains a newer IndexDB schema that is not supported by this application.” is displayed and the project cannot be opened. Deleting the cache database file shown in the message details allows it to be opened. The file must be deleted each time the project is opened with V5.1 after it was opened with V5.1 Service Update 1. Only the per-user cache database is deleted; project files (.nproj, .nmdl, and so on) are not changed. This does not affect opening the same project on another PC. Conversely, when a project opened with V5.1 is opened with V5.1 Service Update 1, the cache database is rebuilt and the project opens without any action. This restriction is inherent to the mechanism and is not planned to be fixed.
  • If a manually loaded model file that has not been loaded is modified outside Next Design and the project has not been reloaded, deleting a model referenced from that model file with IModel.Delete causes the subsequent IWorkspace.SaveProject call to throw ExtensionInvalidOperationException even when forceOverwrite is true, with a message stating that the latest model file has not been loaded and the project must be loaded again to use the API. The extension cannot save the project.
    • Workaround: After a model file is modified outside Next Design, reload the project before deleting a model.
    • If this occurs: In the screen's overwrite-save dialog, select [Yes] when asked whether to save the other model files excluding these model files. The project can then be saved excluding the externally modified model file (the relationship to the deleted model remains in that file). Alternatively, reload the project (all unsaved changes, including the deletion, are lost).
  • In the same state, exporting (the IProjectUnitManager.ExportModelUnit and ExportModelUnits methods, or IProductLineModel.ExportAppliedProject) loads other manually loaded model files that were not modified externally, then fails with ExtensionInvalidOperationException stating that the export cannot be performed because it contains unloaded model files. Nothing is exported. This does not occur when exporting from the screen.
    • Workaround: When a model file has been modified outside Next Design, reload the project before exporting.

Restrictions Continuing from V5.1​

The following restrictions affecting extensions and scripts also apply in V5.1.

  • If a child of a “save with structure” field in a model file whose contents have not yet been loaded is moved to another parent with IModel.MoveTo or Take, it is saved as a child of both the original and destination parents. This applies to model files that background loading has not yet loaded immediately after opening a project, and to model files changed from manual to automatic loading with IWorkspace.SetLoadMode without first being loaded.
    • Workaround: Load the model file with IWorkspace.LoadModelUnits before moving the model. If the file is waiting for background loading, move the model after loading completes.
    • If this occurs: Before saving, reopen the project without saving (all unsaved changes are lost). After saving, use the Inspector to delete the row for the moved model from the field of the original or destination parent (the moved model is not deleted and remains only as a child of the destination parent).
  • If the class of a child of a “save with structure” field in a model file in the same state is changed with IModel.ChangeMetaclassTo to a class whose ownership field with the parent is different, the class change cannot be saved. In V5.1 Service Update 1, saving succeeds, but the model file becomes unreadable and is not written, so the class change is lost (in V5.1, saving fails with an exception).
    • Workaround: Load the model file with IWorkspace.LoadModelUnits before changing the class. If the file is waiting for background loading, change the class after loading completes.
    • If this occurs: Reopen the project without saving (all unsaved changes are lost).
  • When error checking is performed while manually loaded model files remain unloaded, the model validation event (onValidate) also occurs for models in those files. If the handler validates values, incorrect errors are attached to models whose values are in the model file.
    • Workaround: Load unloaded model files before error checking. In an extension, return without validation from the onValidate handler when IModel.IsRealized is false for the received model.
  • When the loading setting of a manually loaded model file that has not been loaded is changed to automatic loading with IWorkspace.SetLoadMode, the models in that file are immediately treated as models with automatic loading settings. Retrieving values or editing them (for example, IModel.GetTagValue or IFeature.IsDefaultSelected) loads the model file (the screen description says that it is loaded the next time the project is opened). APIs that inspect the presence of tags (IModel.Tags, HasTags, and GetTag) do not load it, so API results can differ for the same model. A model file left with manual loading settings is not loaded even when these APIs are called.
    • Workaround: After changing the loading setting to automatic loading, save and reopen the project before handling models in the file.
  • IModelUnit.Loaded is true for all model files with automatic loading settings immediately after the project is opened. It remains true before background loading finishes, while models in those files have IModel.IsRealized set to false (referencing a model through an API before loading finishes loads it immediately; however, APIs that inspect tags, IModel.Tags, GetTag, HasTags, and FindChildrenByTag, do not load it). This differs from the API specification's description that the unit's contents have been loaded into the project (in V5.0, Loaded became true after the contents finished loading). The data is unchanged.
    • Workaround: Check that the contents have finished loading when the State of IProject.AutoLoadStatus becomes Completed or ErrorInterrupted, or in the background auto-load-after event (onAfterAutoLoad). If loading was interrupted by an error, check FailedModelUnits for the model files that failed to load.
  • Calling rich-text retrieval APIs (IModel.GetRichTextField, GetRichTextFieldFormats, and GetRichTextFieldCustomData) for a model in a manually loaded model file that has not been loaded loads the model file and returns the actual value. Other value-retrieval APIs, such as IModel.GetField, return the default value without loading. The model data is unchanged (in V5.0, these APIs returned an empty value without loading).
    • Workaround: Do not call these APIs for a model whose IModel.IsRealized property is false. A loaded model file becomes unloaded again when the project is reopened.
  • When an unloaded model file with manual loading settings exists, splitting a model file (IProjectUnitManager.SplitModelUnit), importing model units (ImportModelUnits), or registering references (AddExternalUnits) also loads unrelated unloaded model files. If the model to split is in an unloaded model file, it is split without an error and the model file is rewritten. This is not a defect, but differs from V5.0 (in V5.0, unrelated model files were not loaded and splitting an unloaded model caused an error).
    • Workaround: Check whether the model to split is loaded (IModel.IsRealized) and split only loaded models. There is no workaround for unrelated model files also being loaded.
  • When an unloaded model file with manual loading settings exists, calling a path-constraint API (IConstraint.IsSatisfiedWith) or a model-association API (IModel.CanRelate, GetRelatableFieldsOf, or Relate) follows relationships saved in the unloaded model file to make the determination (the file itself is not loaded). If the path passes through such a relationship, the path is determined to satisfy the constraint and Relate creates the relationship. This is not a defect, but differs from V5.0 (in V5.0, the constraint was determined not to be satisfied and association failed).
    • Workaround: Before checking or creating the relationship, load the model files traversed by the path with IWorkspace.LoadModelUnits. Use IModel.IsRealized to determine whether they are loaded.
  • During loading before saving and model file loading (the screen's “Load Model File” operation and IWorkspace.LoadModelUnits), values committed when the screen is updated as part of loading are treated as part of loading. They do not receive an unsaved indicator or undo history, and the field value changed-after event (onFieldChanged) does not occur. This restriction is inherent to the mechanism and is not planned to be fixed.
  • Values written by an extension or another component from another thread receive an unsaved indicator, but may not receive undo history. Values written while undo or redo is running, including undo and redo through the API methods, do not receive it (in V5.1, they did not receive the unsaved indicator either). The indicator or history may also be omitted while Next Design internally pauses undo recording during loading or display of diagrams and forms, and immediately after screen undo or redo (the same as in V5.0). If only edits without undo history remain and no other edit can be undone, the Save command is not enabled and those edits are not saved (no save confirmation is displayed when the project is closed). Saving after making one other undoable edit saves them together.

API Changes​

This section lists the API changes in Next Design V5.1 Service Update 1. For details on each API, please refer to the API Specification.

Changed APIs​

This lists the APIs changed in Next Design V5.1 Service Update 1.

For details on how to migrate APIs, please refer to the annotations for the relevant APIs in the API Specification.


NextDesign.Core

APIChanges
IAutoLoadStatus.FailedModelUnits propertyNow returns only model units that have not been loaded at the time of retrieval.
IAutoLoadStatus.State propertyNow becomes Completed when all model files that failed to load have been loaded or unregistered. It also becomes Completed when only model files excluded from background loading, such as model files whose metamodel is not in the profile, remain failed. After a reload, it becomes Completed only after the manually loaded model files that were loaded before the reload have finished loading, so completion takes longer after a reload.
IDiff.ComputeModels methodNow loads model files that are marked as loaded but whose contents have not been loaded before comparison. If a file cannot be loaded, it throws ExtensionInvalidOperationException and stops the comparison.
IDiff.GetComparison methodNow returns null when the immediately preceding ComputeModels method stopped because it could not load a model file before comparison.
IFeature.GetAssignedModels methodNo longer includes models assigned to the feature that are in unloaded model files with manual loading settings.
IFeature.VariationKind, UniqueName, and IsDefaultSelected propertiesWhen the product-line model is in an unloaded model file with manual loading settings, retrieval does not load the file and returns the saved kind, null, and false, respectively; setting the properties throws an exception.
IFeatureModel.GetFeatureConstraint methodReturns null when the product-line model is in an unloaded model file with manual loading settings.
Feature-assignment methods such as IModel.AssignFeatureNow throw an exception when the target model or specified feature is in an unloaded model file with manual loading settings or has been deleted. AssignFeature also throws an exception when called for an element to which a feature cannot be assigned.
Feature-release methods such as IModel.ReleaseAssignedFeature and ReleaseAllAssignedFeaturesNow throw an exception when the target model is in an unloaded model file with manual loading settings or has been deleted, or when the specified feature has been deleted.
IModel.SetProductApplyCondition methodNow throws an exception when the target model or specified feature is in an unloaded model file with manual loading settings or has been deleted.
IModel.GetProductApplyCondition methodReturns the expression without loading a manually loaded model file that has not been loaded. If the product-line model is in an unloaded model file, the expression uses “(Unloaded)” as the feature name; if the target model is in an unloaded model file, it returns an empty string.
IModel.GetAssignedFeatures methodReturns an empty list when the target model is in an unloaded model file with manual loading settings.
IModel.IsAppliedItemTo and IsAppliedItemToByName methodsWhen a model with an application condition is in an unloaded model file with manual loading settings, the methods treat it as applied without loading it. When the product-line model is in an unloaded model file, they treat all models as applied.
IModel.GetRefRelatedModels, GetDerivedModels, GetDerivingModels, GetFieldValues, GetFieldValuesByFieldTag, and IsRelatedAtFieldTo methodsWhen a product is applied, now filter results according to whether the relationship is enabled.
IModel.IsEditable propertyNow determines editability from the actual configuration-management lock information even for models in unloaded model files with manual loading settings.
IModelUnit.Loaded and HasLoadError propertiesA model file that could not be loaded now has Loaded false and HasLoadError true regardless of how loading was initiated. Model files no longer remain marked as loaded without their contents being loaded.
IModelUnit.ScmStatus propertyActual configuration-management lock information is now set for model files that are unloaded with manual loading settings.
IProduct.SelectedFeatures propertyReturns an empty list when the product-line model is in an unloaded model file with manual loading settings.
IProductLineModel.ApplyProduct and ApplyProductBy methodsWhen a model with an application condition is in an unloaded model file with manual loading settings, treat it as applied without loading it. When the product-line model is in an unloaded model file, throw an exception.
IProductLineModel.ExportAppliedProject methodNow throws ExtensionInvalidOperationException instead of an internal exception when an unreadable model file exists. It also throws an exception when a model file saved with a newer major version exists or when a model file modified outside Next Design has not been loaded. When a model with an application condition or a product-line model is in an unloaded model file with manual loading settings, the number of model files that could not be checked is displayed in the output window; the exported project contents are unchanged.
APIs that change product-line models (IProductLineModel, IFeatureModel, IConfigurationModel, IProduct, and IFeature)Now throw an exception when the product-line model is in an unloaded model file with manual loading settings or the target has been deleted.
IProject.RealizeAll methodNow includes model files that could not be loaded in the returned FailedModelUnits. It throws an exception when a model file whose contents have not been loaded was modified outside Next Design.
IProjectUnitManager methodsNow also throw an exception when a model file saved with a newer major version exists or when a model file modified outside Next Design has not been loaded. The exception type and message are unchanged; the inner exception now includes the reason for each model file that could not be loaded.
IScmFileStatus.HasLock and LockAccount propertiesActual configuration-management lock information is now set for model files that are unloaded with manual loading settings.

NextDesign.Desktop

APIChanges
IWorkspace.OpenProject methodProjects can now be opened even when they contain unreadable model files or model files with duplicated relationships or editors having the same ID.
IWorkspace.ReloadProject methodModel files with manual loading settings that were loaded before a reload are now loaded through their contents after the reload as well. The project is no longer closed when an unreadable model file exists.
IWorkspace.LoadModelUnits methodModel files saved with a newer major version are now treated as load failures. Specifying a model file that was modified outside Next Design and has not been loaded now throws an exception.
IWorkspace.SetLoadMode methodEven when a loaded model file is changed to manual loading, its contents are loaded while the project is open.
IWorkspace.SaveProject methodWhen a model file that will be rewritten has not been loaded and was modified outside Next Design, now throws an exception regardless of forceOverwrite. Saves the project while omitting model files whose contents have not been fully loaded.
IWorkspace.SaveAll methodWhen a model file waiting for background loading is modified outside Next Design, now throws an exception until the project is reloaded. Saves the project while omitting model files whose contents have not been fully loaded.
IWorkspace.CleanUpProject methodWhen a model file waiting for background loading is modified outside Next Design, now throws an exception until the project is reloaded.
IWorkspace.SaveProjectAs methodWhen an unreadable model file exists, including one saved with a newer major version, now returns false instead of throwing an exception even for the current project. For the current project, it displays the same error message as the screen operation.
IScmManager.GetEditPermission and ReleaseEditPermission methodsNow operate using the actual configuration-management lock information even for model files that are unloaded with manual loading settings.
ITraceNode.SourceNodes and TargetNodes propertiesWhen accessed with a product applied through context options, no longer return invalid trace elements.
IModelEventDispatcher.RegisterPropertyChangedEventHandler methodThe registered handler is no longer called when values are populated while loading a model file. It is also no longer called as a change to the containing model file when Next Design first inspects a model file containing a model.
Additional post-load event (onAfterModelUnitLoad)Now also occurs when an unloaded model file is loaded by an operation that loads the entire project or by IProject.RealizeAll.
Project reload-before event (onBeforeReload) and project reload-after event (onAfterReload)Now also occur, after reload confirmation, when a manually loaded model file that has not been loaded is modified outside Next Design.
Background auto-load-after event (onAfterAutoLoad)After a reload, now occurs only after the manually loaded model files that were loaded before the reload have also finished loading. As a result, it occurs later after a reload.
Field value changed-after event (onFieldChanged)No longer occurs when values are populated by background loading. It now also occurs for edits committed while the screen is rebuilt after loading caused by referencing a model, loading before an operation that loads the entire project, IProject.RealizeAll, or loading before difference comparison or merging, and for value changes written from another thread during undo or redo.

There are no plans to add, remove, or merge any APIs in V5.1 Service Update 1.