Getting started - Using Flows


This section of the Getting Started guide will illustrate some ways to use flows within Structr applications.

Calling flows from a scripting context

Flows can be called from any serverside scripting context using the in-built flow() function. The function is supplied with a reference in the form or a flow id or name and optional parameters as alternating key-value-pairs. Detailed instructions can be found on the flow() article.

In this example a flow is bound to an entity’s FunctionProperty read function and as such the flow would be evaluated every time the property is read.

Reusing flows within flows with FlowCall

Besides calling flows from a scripting context, it’s also possible to reuse flows from within flows by using the FlowCall element. This allows the user to select a flow from all existing flows and optionally supply parameters to the call as well.
In the following example a very basic use is illustrated.



About this article
Last change 2018-09-25
Topics FrontendStructr 3.0