Flow modules

Using flow modules

You can use flow modules in Reves DSE to force a directional solve order of the knowledge contained in a Reves DSE model. The knowledge containing canvas items are arranged on the canvas from the top to the bottom of the worksheet. A flow module works like a procedure element by assigning parameters from top to bottom. Parameters from a flow module cannot be used or viewed outside the flow module unless explicitly stated. A flow module on itself can be considered an advanced procedure element.

You can add a flow module to the canvas by dragging the Flow module item from the toolbox to the canvas or by double click it. Inside a flow module you can add items like text, tables, images, interpolation tables and library functions in the same way as a regular module. Inside a flow module you are however restricted to using flow modules, and knowledge rules can only be defined in flow model expressions.

Adding a flow model expression

Inside a flow module you can add a flow model expression to the canvas by following these steps:

  1. Drag the Flow model expression  item from the toolbox to the canvas or double click it. When using double click the new expression item will be added below the lowest knowledge containing item on the canvas
  2. The flow model expression editor opens in the knowledge tab page.
  3. In the text field you can type your knowledge rules using assign expressions (a= b + c) and procedure syntax. Set the expression by leaving the editor by clicking on the canvas. Just like a regular expression, Reves DSE will automatically detect the used parameters and remember them for you. To prevent a parameter from being created in case it is only meant as a temporary parameter, you can also declare local variables using the procedure syntax.
Press Ctrl + Space on your keyboard while typing the expression to bring up a list of variables and available functions with an explanation to use them. See the syntax section for more information on available functions.
  1. While editing the expression any errors will be underlined by a red error line. You can toggle the visibility of the error window containing the details with the Error list button in the toolbar of the expression editor.
You can test and debug your expression by clicking the Debug button A close up of a logoDescription automatically generated in the toolbar of the expression editor. This will open a popup window where you can run and test your expression.

Setting input and output parameters in flow modules

Any non-local variable can become either an input or output parameter of the flow module.  The flow parameters tab page in the knowledge panel displays an overview of these for the current active module level, or if one item is selected, of the parameters in that item. Additionally, the output/input parameters that are visible on the canvas are highlighted in green. Just like to the parameter overview in regular modules you can edit the following parameter properties:

  • Input/Output
  • Parameter symbol
  • Name and description.
  • Type
  • (Calculation) Unit
  • Lower and upper bound for the parameter values.
  • Constant value
  • Array parameter length
See the topic “Using the parameter overview”  for details on editing these properties.

Once a parameter is explicitly set to be a input or output parameter it will become available outside the flow module to connect to another parameter.  You can manage these settings parameters in by toggling the input or output checkbox in front of the parameter row. Only one of both checkboxes will be available for each parameter. The assigned parameter role, either input or output, is determined by the order of the expressions and the assignment of a value to a parameter.

The bounds of parameter that are not added to the input or output parameter are ignored during calculation and considered to be infinite when determining a random value for input parameters. (Interpolation) tables are however and exception since their bounds are limited due to their data points.
In a flow module, the parameters and expressions are checked on consistency. The error list tab page will display any errors or warnings if any inconsistencies are detected based on the order of the knowledge rules and the assigned roles of the model parameters.

Flow model parameters in the view

In a view that belongs to a flow model you are restricted in the parameters which you can use in the input fields. The input fields only accept parameters which are recognized as input parameters, these do not have to be explicitly set as model inputs. All other elements accept all non-local variables. Outside the module only the model parameters are available and the input field can only contain the model input parameters from flow modules

Directional parameter connections

Connectors which are attached to flow modules will always be directional connectors, meaning that the value connection is also one way only. For example, in a connection chain of  Model_1.a <-> Model_2.a->Model_3.a, where ‘<->’ is a normal connector and ‘->’ a directional connector this would mean that Model_3.a cannot be solved before Model_1.a and Model_2.a.

Converting regular modules to flow modules

You can semi-automatically convert a created regular module to a flow module by selecting the module, right click the item and selecting Convert to flow module from the context popup menu. The same action can be done on a flow module to convert it to a regular module. This action will automatically convert the expressions and procedures on the canvas to flow model expression. This conversion however does not provide a working flow module out of the box. You will be required to correct and check the following items:

  • The order of the flow model expression: Order the knowledge rules in a logical order from top to bottom. Make sure that all parameters required for solving a flow model expression have received a value before reaching the expression.
  • The expressions themselves: Expressions must be restructured to always assign a value to a single parameter on the left side of the equal sign. Furthermore, the values of all parameters on the right side of the equal sign must be available before the expression is reached, either by being a model input parameter or a previously calculated parameter. Finally, a parameter should not be assigned multiple times since this would overwrite a previous calculated value which is currently not allowed.
  • The parameters: The current approach during conversion is to not automatically determine the model input output parameters since the order of expressions and the expressions themselves might be incorrect. You are required to manually to set these after conversion.
  • The input field parameters in the view: The views attached the converted model are not corrected to match the parameter limitation in the input fields. The input fields might still contain parameters which cannot receive input, this will give an error.
  • Any connectors and parameters attached to this module: The direction of the parameter connection cannot be accurately determined and might need to be corrected.
You can check the error list tab page on any errors or warnings to determine if any inconsistencies remain after any initial corrections.
The model parameter configuration (bounds of output parameters etc.) is not kept when a flow model is converted to a regular model. This means you cannot restore this configuration by reconverting a previously converted model.