You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

Using Flows

Getting started - Using Flows

Contents

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.
fig

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.

fig

Search results for "Using Flows"

Flows

Note that flows are as powerful as scripts in the sense that any functionality that can be implemented using scripts can also be implemented using flows. Typically an application will contain a combination of scripts and flows to implement the business logic.

Running Flows