MacroHealth Internal

Route on Expression

Evaluates the list of expressions in order and takes the output from the first expression that evals to true.

Widget
Route_on_Expression.png
Configuration
Route_on_Expression_Config.png
  1. Fill in the following fields:

    • Description: Allows changing the name that appears on the widget. This may be useful to quickly find a particular widget or distinguishing it from other similar shovel operation widgets when building large flows.

      Description.png
    • Shovel Operation: The name of the Shovel Operation. Pre-configured to RouteOnExpression.

    • Routes: The list of route entries this operation is aware of/responsible for. For each of the routes, you will give a condition to evaluate (E.g. To filter out the claims that have validation failures in order to log them. When a condition is not met, it will fall in the next route of the flow, until it meets the condition. A new route is added as a branch off from the flow.

      Routes.png
      • + Add Route: Allows adding another entry to Routes. For every route that is added, an outport is added to the Route on Expression widget.

        Tip

        As many routes as necessary can be added, but if exceeding four to five may need reassessing the design of the flow.

        • Route Name: The name of a route entry. This will also become the label of that connection in NiFi. Multiple routes can have the same route name, meaning any of those Expressions that evaluate to true will send the data to that output.

        • Expression: Shovel Expression to evaluate. The first route entry that matches the condition(top to bottom in the list) will determine where the data goes.

          Example:

          eqString(getElemAt(getElemAt(getElemAt(readField(<builtin:document/secondary|builtin:key/data/functionalgroups|builtin:array|builtin:key/transactionsets|builtin:array|builtin:key/segments|builtin:array_filter_by_key_value/name=AK9|builtin:key/AK901/value>), 0), 0), 0), "R")
    • Default Route: Required fallback route to send data to if none of the explicit route Expressions match.

  2. If necessary, click the Notes tab and enter any relevant information.

    NotesTab.jpg
  3. Click Save.

    RouteOnExpressionSave.png
  4. The widget will be marked with a green check.

    RouteOnExpressionGC.png