skip to main content
RiverWare Packages
A model and associated files can be grouped together and saved as a RiverWare package. These always contain a model file and can also contain ancillary files including the following:
• Rulesets
• Global Functions Sets
• Optimization Goal Sets
• System Control Tables (SCTs)
• Workspace Images
A package is used to group the files together into one file and compress them. This functionality is often used to share a set of files with other users. For example, you can package all the files used with a model and send them to a co-worker. The co-worker opens the package to create all the files in the destination directory and then RiverWare automatically opens them.
Packages are accessed through the Workspace File menu. The Save As Package and Open Package menus on the workspace File menu allow you to work with packages.
Saving a Package
Use the Save As Package menu to save a set of files together as a package. This opens the Save As RiverWare Package dialog where you specify the package file name. Use the button to use a file chooser or type in a file path and name. Also, choose the components to include. By default, all available files will be checked.
The model is not checkable and is always included in the package. This includes the model file and any RPL sets that have been configured to be saved into the model file itself. See Save Location in RiverWare Policy Language (RPL) for details on embedding sets in a model.
RPL sets (Rulesets, Goalsets, and Global Functions Sets) that are open and that have been saved as files will be listed as individual options for inclusion in the package. If a set has been created, but not saved to a file, you will get a warning message that the set must be saved to be available in the list.
SCTs that are open and that have been saved as files will be listed for inclusion in the package under the SCT category. You can individually select whether to include each SCT from the list. If an SCT has been created, but not saved to a file, you will get a warning message that the SCT must be saved to be available in the list.
If simulation, accounting, or geospatial images are used in the model, they are available as options for inclusion in the model package.
In creating the package, all selected files will be saved to a temporary directory for packaging, as shown in Figure 2.9. When packaging is completed, these files and the temporary directory will be deleted, leaving just the specified package file.
Figure 2.9   
Note:  Although not mandatory, CADSWES recommends using the .rwp extension to represent RiverWare packages.
If you have made changes to any of these items since they were last saved to files, the copies made for the package will include these changes, but the original files will not. You must save them in normal RiverWare operation to save the changes to the individual files. But, creating a package saves everything as it currently appears in the session without affecting any of the individual files on disk.
Opening a Package
Use the Open Package option in the workspace File menu to unpacks all the files and then open those files into the RiverWare session. This menu opens the Open RiverWare Package dialog, in which you specify the package file to open and a destination directory to which the files will be unpacked.
The package file can be chosen via a file chooser or the name can be typed into the Package File line (environment variables are supported). Similarly, the directory where the files will be opened to can also be specified by selection or by typing.
Once the package file is chosen, a default Destination Directory is shown, which consists of a subdirectory using the name of the package. Change the directory as desired.
The Files in Package list displays the names of the files that are in the package. If files corresponding to these names already exist in the specified Destination Directory, this will be indicated with Yes in the Exists column of the list. If any of the files currently exist, the message at the bottom appears warning that the existing files will be overwritten when opening the package.
When the package is opened, files in the package will be extracted to the specified directory. The model file will be loaded, and RPL sets and SCT files will be opened. If a RPL set was loaded when the package was saved, it will be reloaded when the package is opened. The workspace images loaded with the model will now have the extracted image files as their source. Extracted files are persistent in their directory even after the RiverWare session is closed, so are just like any other set of RiverWare files. The files can be repackaged at any time into the same, or a different package file using the Save as Package functionality described above. See Figure 2.10.
Figure 2.10   
 
Revised: 07/17/2020