code: public static void saveInstances( Application app ) {
  
  		File targetFile = new File( app.getDirectory(), Constants.PROJECT_DIR_INSTANCES + "/" + INSTANCES_FILE );
  		try {
  			Utils.createDirectory( targetFile.getParentFile());
  			RuntimeModelIo.writeInstances( targetFile, app.getRootInstances());
  
  		} catch( IOException e ) {
  			Logger logger = Logger.getLogger( ConfigurationUtils.class.getName());
  			logger.severe( "Failed to save instances. " + e.getMessage());
  			Utils.logException( logger, e );
  		}
  	}
docs: Saves the instances into a file.
  @param app the application (not null)
  @param configurationDirectory the configuration directory