Interface SaveModelItemParam

  • All Superinterfaces:
    DatabaseApiValue, SaveItemParam
    All Known Subinterfaces:
    SaveModelItemParamGenerator

    public interface SaveModelItemParam
    extends SaveItemParam

    Input parameters used when saving a model item in a Model Manager database. This includes both creating a new model item and updating an existing model item. A new version of the model item will be saved on the targeted branch.

    • Method Detail

      • filename

        java.lang.String filename()

        Get the filename to use for the saved model version. Returns null if the current filename should not be explicitly modified (for the case when the target already exists in the database) or if the filename should be automatically taken from the source of the save.

        An example when the filename is automatically inferred is when saving a model item from a source model object. The model object may, for example, come from a model file on the file system or from a model currently loaded in COMSOL Multiphysics.

        Returns:
        The filename for the saved model version, or null.
      • description

        java.lang.String description()

        Get the description to use for the saved model version. Returns null if the current description should not be explicitly modified (for the case when the target already exists in the database) or if the description should be automatically taken from the source of the save.

        An example when the description is automatically inferred is when saving a model item from a source model object. The model object may, for example, come from a model file on the file system or from a model currently loaded in COMSOL Multiphysics.

        Returns:
        The description for the saved model version, or null.
      • sourceModel

        java.lang.String sourceModel()

        Get the model tag of a model that is currently loaded in COMSOL Multiphysics, as returned by ModelEntity.tag() (not to be confused with a tag item in the database). The model contents of that model will be used as source input for the saved model version. The source model itself need not have been loaded from a Model Manager database.

        Returns null if the source input for the model contents is specified by the return value of SaveItemParam.sourceItemVersionKey(), the return value of sourceLocation(), or if the model contents should be reused from the latest version of the target model for the save.

        Returns:
        The model tag of a model that is currently loaded in COMSOL Multiphysics, or null.
      • sourceLocation

        java.lang.String sourceLocation()

        Get the absolute path on the file system to a source model. The model contents of that model will be used as input for the saved model version.

        Returns null if the source input for the model contents is specified by the return value of SaveItemParam.sourceItemVersionKey(), the return value of sourceModel(), or if the model contents should be reused from the latest version of the target model for the save.

        Returns:
        The absolute path to a model, or null.
      • targetItemSaveType

        ItemSaveType targetItemSaveType()

        Get the item save type to use. The effect of the item save type returned by this method depends on if the model being saved from exists in the database and what its current save type is:

        • The return value is null or is the same as that of the model being saved from. The saved model version will have the same save type as the model being saved from.
        • The return value is ItemSaveType.DRAFT while the model being saved from has save type ItemSaveType.REGULAR. A first version of a new draft model will be created.
        • The return value is ItemSaveType.REGULAR while the model being saved from has save type ItemSaveType.DRAFT. If the draft model has an origin model, a version of the origin model will be saved. Otherwise, a first version of a new regular model will be created.

        The save type value is ignored if a different target model item for the save has been explicitly specified via SaveItemParam.targetItemKey().

        Returns:
        The item save type to use, or null if automatically inferred.