skip to main content
RiverWare Policy Language
Expression Editing
The interface for editing RPL expressions was improved to be more robust and easier to use, especially when editing existing expressions. Following are descriptions of the changes:
Logical Operator Replacement
The editing mechanism was enhanced to retain the expressions when you switch a logical comparison operator (>, >=, <, <=, ==, !=). Thus, if you select an existing expression that contains one of these operators, and then choose a different one, the left and right sub expressions are retained for the new operator. This makes it easy to switch an operator from one to the other as shown in the following example:
Function Argument Reuse
Similarly, when you select a different function, the interface now retains the arguments whenever possible. This makes it easy to swap in similar functions; for example, changing from Min to Max:
Checkboxes were added to the user defined and predefined function tabs of the RPL Palette that allow you to indicate if you want to retain function arguments, where possible, when one function is replaced with another. The arguments must have the same type, in left to right order, to re-use them. In addition, if the number of arguments is different, then they will be reused whenever possible. See User-Defined Functions Tab in RiverWare Policy Language (RPL) for a description of the checkbox.
User-Defined Function Renaming
The interface was improved to make it easier to update references when you change the name of a User-Defined Function. Functionality has been added so that when a function is renamed, you are asked if you want to also rename calls to the function in RPL sets where it is used. See Writing a User-defined Function in RiverWare Policy Language (RPL) for more information.
Initialization Rules Set Management
The ability to save and load initialization sets to/from files and to remove RPL sets from a model was added. A menu item, Save Initialization Rules Set As allows you to save the Initialization rules set to a file. Replace Initialization Rules Set from File menu allows you to replace the existing set with a set that is saved as a file. Any existing initialization rules are cleared and new ones then loaded from the file. For more information, see Actions Specific to Accounting Method Set, Expression Slot Set, Initialization Rules, and Iterative MRM Sets in RiverWare Policy Language (RPL). In addition, script actions were added to Replace Initialization Rules Set from File and Remove RPL Set as described New Actions.
New Predefined Function - GetSelectedUserMethod
A new function, GetSelectedUserMethod, was added. This function returns the name of the selected method for a given category name on a given object. For more information, see GetSelectedUserMethod in RiverWare Policy Language (RPL).
RPL Search and Replace
RPL Search and Replace allows you to find a text string and then replace the text. More information on this utility can be found RPL Search and Replace Dialog in RiverWare Policy Language (RPL). The following enhancements or changes were made to this utility:
Search in All Sets at Once
The RPL Search and Replace dialog was enhanced to provide an option to search All RPL Sets at once. In addition, a new menu item was added to the Policy menu of the RiverWare workspace to access the RPL Search and Replace dialog. Accessing it in this way configures the dialog to search all RPL sets, providing a streamlined way for the user to make global replacements in all sets.
Change Object/Slot names
The Open Object and Open Slot dialogs were modified so that when the Object or Slot name is changed, you are asked if they want to search all RPL sets for the old name. If yes, a search is performed in all RPL sets for the old name and the RPL Search and Replace dialog is opened to display the results. The old name is shown in the dialog as the search string and the new name as the replace string. You can easily select occurrences of the old name and replace them with the new one. This is a two step process so that you can review the occurrences and replace them as desired.
Display of Rule Names
In the RPL Search and Replace dialog, RPL statement names were incorrectly shown. Now rule/block/method names are correctly shown instead of statement names.
Revised: 07/05/2022