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.

Loop

Flow Elements - Loop/ForEach

Description

The Loop or ForEach element are used to iterate over collections of data.

Parameters

Name Description
Prev Accepts another element’s Next socket
Next Connects to another element’s Prev socket
DataSource Accepts another element’s DataSource. Represents the collection to iterate.
DataTarget Accepts another element’s DataSource. Contains the object of the current iteration.
FirstAction Connects to another element’s Prev socket. Represents the first node to be called for each iteration of the collection.

Search results for "Loop"

Aggregate

The Aggregate element is used to aggregate data within loops in the Flow Engine. It works similar like reduce functions in other languages. In it’s scripting context the keywords data and currentData become available. Data represents the initial value for the aggregation and currentData contains the dataset of the current loop iteration. The script must then process and return the aggregation result and in the next iteration data will contain the result of the previous aggregation.

Loop

The Loop or ForEach element are used to iterate over collections of data.

Cypher

In Cypher model, the console executes a REPL (Read–Eval–Print Loop) for Cypher expressions, so this is a good place to test-run Cypher statements.

Interfaces

application.host The listen address of the Structr HTTP server. If you set the listen address to 127.0.0.1, Structr will only be accessible for applications that run on the local host. This value essentially binds the HTTP server to the local loopback interface. The other option is 0.0.0.0 which makes Structr accessible from all networks.
application.http.port The HTTP port that Structr listens on. If you want to be able to access Structr under a simple http:// URL, you need to set this value to 80.
application.https.port The HTTPS port that Structr listens on. If you want to be able to access Structr under a simple https:// URL, you need to set this value to 443.
application.ssh.port The port that the SSHService listens on.
application.ftp.port The port that the FTPService listens on.
application.https.enabled If enabled, the internal HTTP server will be configured to allow HTTPS connections to the application.https.port.
application.keystore.path The path to a JKS keystore file that contains the certificate chain and private key for the SSL configuration needed for HTTPS. The keystore must be in PCK12 format.
application.keystore.password The password for the JKS keystore used in application.keystore.path.
application.baseurl.override Overrides baseUrl value that is originally assembled dynamically from the protocol, hostname and port of the server instance Structr is running on.

Execution Flow

When a flow is called, execution will begin at it’s starting element. In case of no entry point being set or no elements being contained, the flow will simply return a null result. Otherwise the Flow Engine will evaluate the starting element and then proceed with the evaluation of the element connected to the initial element as next element. This continues until there is no more next element available, an error has been thrown or the evaluated element is a Return element, in which case the result of the element’s evaluation will be returned. Although this sums up the general execution flow of a Flow, there are notable exceptions to this in the form of specialized elements. For example a Decision element will branch into two execution paths and choose one based on the connected conditional elements. Likewise, a Loop element will enter a different execution path for each element and finally proceeds with the original next element.