The following Rio Grande-specific method is available on the Confluence.
This method sets the Slot Inflow for accounts with water type “RioGrande” proportionally to the Inflow to the account. All Slot Inflows on accounts with water type “SanJuan” are set to 0.0.
The logic is follows.
1. Get a list of all the Inflow slots on accounts with water type RioGrande.
2. Register each as a RPL dependency.
3. Get a list of all the Slot Inflows slots on accounts with water type RioGrande.
RioGrandeInflowSUM = Sum of RioGrande Inflows
4. If the RioGrandeInflowSUM is zero, divide Inflow 2 equally to all Rio Grande accounts.
Otherwise, for each account of water type RioGrande:
5. Get a list of all the Slot Inflow slots on accounts with water type SanJuan.
6. Set all SanJuan Slot Inflows to 0.0.