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 typically exported as above. 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. Each item is classified as having one of the following statuses:
• New: The imported group, block, or function does not exist in the destination set.
• Existing: The imported group, block, or function exists in the set in the destination set, i.e. the names match. There are two further classifications for blocks (rules, functions, etc):
– Exists - Different - A comparison is made and the name and type are the same but the body or one or more properties do not match. In this case, use the RPL Set Comparison Tool to identify the differences.
– Exists - Same - A comparison is made and the name, body and properties of the item match.
Note:  In the comparison of whether the item is the same or different, priority and index are not compared as these are not carried through the export step.
• 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 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 by selecting the box to the left of its name in the list.
Select Continue Import to perform the import.
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. Copying an existing block or function will replace the existing block or function with the imported block or function.
Revised: 12/06/2024