skip to main content
RiverWare Policy Language (RPL) : RPL User Interface : Exporting and Importing RPL Sets
Exporting and Importing RPL Sets
In this section we describe how to export all or a portion of a RPL set to a separate RPL set file, as well as how to import an existing RPL set file. The export and import mechanisms provide a way to incorporate all or some of one policy into another policy, and it is available for all application of RPL within RiverWare, including the following:
• Rule sets. Collections of rules and functions organized into policy and utility groups.
• Optimization goal sets. Collections of optimization goals and functions organized into policy and utility groups.
• The object-level accounting method set. A collection of methods and functions organized into predefined category groups and utility groups.
• The Expression Slot set. A collection of functions organized into utility groups. These functions may be called from an expression defining an expression slot.
• Initialization Rules. Collections of rules and functions organized into policy and utility groups.
• Iterative MRM RPL sets. Collections of rules and functions organized into policy and utility groups.
• Global Function Sets. Collections of functions organized into Global Utility Groups.
There are many situations in which export and import functionality is useful. For example, assume that you are writing a policy which could make use of some functions written as part of an existing policy. To avoid having to rewrite all these functions, you could open both sets and use the Copy/Paste mechanism to copy the functions in question from the existing policy to the new one. However, if you then modify the original functions, you might want to do the copy again to keep the functions identical, but you would have to first remove the copies of the functions before doing this. Furthermore, in the context of the object-level accounting method set it is not possible to have two such sets open simultaneously, so this mechanism would not work. The RPL set export and import functionality provides a simpler and more flexible method to implement sharing of policy elements. Alternatively, you could use Global Utility Groups; see Global RPL Functions for details.
Export
The RPL set export mechanism allows you to save a portion of a RPL set as a separate RPL set file. The first step is to show the Export column of the RPL set editor. If this column is not currently shown (between the columns labeled Priority and On), then it can be shown by selecting View, then Show Export Column. Initially no item is selected for export, this is indicated by a red X in the Export column for each item.
Select the Export column of the items that you would like to export. This will convert the red X in that cell to a green check mark.
Note:  Selecting a block or function for export automatically selects the containing group, and unselecting a group will clear all of its members.
Tip:  To select multiple items, right-click and choose Select Export For All in Group or Select Export For All in Set.
Once the items to be exported have been identified in this way, the export operation is initiated by selecting File, then Export Selected Items. You will then be presented with a confirmation dialog summarizing the items to be exported If you choose to continue the export operation, a file chooser dialog appears, allowing you to specify the file to which the items will be exported. Once a file name has been selected, the file is created and a RPL set containing only the selected export items is written to that file.
Import
RPL set import allows you to incorporate all or some aspects of an existing RPL set policy into a set that you are editing. To initiate an import, select File, then Import Set. You will be presented with a file chooser dialog for specifying the name of a RPL set file. Once you have selected a file and selected the Open button, you are presented with the RPL Import Confirmation Dialog.
This dialog presents a listing of the import set. This layout is similar to the RPL set editor’s presentation of the set, but each item being imported is classified as having one of the following statuses:
• New. The group, block, or function being imported does not appear to exist in the set into which it is being imported (the destination set).
• Existing. The group, block, or function being imported appears to exist in the set into which it is being imported (the destination set). In the case of a group, there is a group of the same type with the same name in the destination set. In the case of a block (or object-level accounting method), there is a block with the same name in a group which is of the same type and has the same name as the block parent group. Similarly, in the case of a function, there is a function with the same name in a group which is of the same type and has the same name as the function’s parent group.
• Can’t Import. The group, block, or function begin imported can not be imported. There are several reason why this might be the case and a warning is posted to the Diagnostic Output Dialog for each item that can not be imported, explaining the problem. Possibilities include an attempt to import a TCL function (not supported) or an attempt to import a function into a policy group when there is already an item of the same name in the global name space, e.g., a function of the same name exists in a utility group.
Before continuing with the import operation you should review the items being imported and indicate which items should in fact be imported. To select an item for import select the box to the left of its name in the list. Importing a new group will append it to the list of groups; importing a new function or block into an existing group will append it to the groups of functions which already exist. Importing an already existing group will copy its description to the existing group and copying an existing block or function will replace the existing block or function with the imported block or function. Initially new items are selected for import and existing items are not, but these selections can be modified. To complete the import select the Continue Import button. Selecting the Cancel button at any point will cancel the import operation and leave the RPL set unchanged.
Revised: 12/01/2020