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.

DataSource

Flow Elements - DataSource

Description

The DataSource element represents a passive source of data. It can not directly be evaluated by the general execution flow, but instead it will be evaluated on demand by connected nodes, when the data is requested.

Parameters

Name Description
DataSource Accepts another element’s DataSource
DataTarget Connects to another element’s DataSource
Script Given script will be executed as StructrScript with data in it’s context.

Search results for "DataSource"

IsTrue

Name Description
DataSource Accepts another element’s DataSource
DataTarget Connects to another logic element’s DataSource

KeyValue

Name Description
DataTarget Connects to a ObjectDataSource’s DataSource.
DataSource Accepts another element’s DataTarget.
Key Key identifier under which given data will be added to the object

Loop

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.

First

Name Description
Prev Accepts another element’s Next socket
Next Connects to another element’s Prev socket
DataSource Accepts another element’s DataSource
DataTarget Connects to another element’s DataSource

Aggregate

Name Description
Prev Accepts another element’s Next socket
Next Connects to another element’s Prev socket
CurrentData Accepts another element’s DataSource. Given data is made available as currentData within the scripting context.
Data Accepts another element’s DataSource. Given data is start value of the aggregation and used to set it’s initial value.
DataTarget Connects to another element’s DataSource socket. Contains the aggregated data of the element.
ExceptionHandler If connected to an ExceptionHandler, exceptions thrown in the scripting context will be handled by the referenced handler.
Script context used to aggregate the data. Return value will be written to the element’s data.

DataSource

Name Description
DataSource Accepts another element’s DataSource
DataTarget Connects to another element’s DataSource
Script Given script will be executed as StructrScript with data in it’s context.

Store

Name Description
Prev Accepts connection from another element’s Next socket
Next Connects to another elements Prev socket
DataTarget Connects to element’s DataSource
DataSource Accepts connection from another element’s DataTarget
Operation Switches between storing or receiving data. When receiving DataSource is ignored and when storing DataTarget is ignored.
Key Key under which to store or from which to retrieve data

Comparison

Name Description
DataSources Accepts multiple DataTarget connections. Data that will be compared.
ValueSource Accepts DataTarget connection. Value that given data will be checked against.
Operation Defines boolean operator to be applied.
Result Connects to a logic node DataSource or a Decision Condition

NotEmpty

Name Description
DataSources Accepts multiple DataTarget connections
Result Connects to a logic node DataSource or a Decision Condition

Condition

Name Description
DataSource Accept another element’s DataTarget
ScriptSource Accepts another element’s DataTarget. Can be used to dynamically supply a script
Script Supplies script given for evaluation. Only used when ScriptSource is not connected
DataTarget Connects to a logic node DataSource or a Decision Condition
ExceptionHandler Connects to an ExceptionHandler’s HandledNodes socket

And

Name Description
DataSources Accepts multiple logic node DataTarget connections
Result Connects to a logic node DataSource or a Decision Condition

CollectionDataSource

Name Description
DataTarget Connects to another element’s DataSource
DataSources Accepts multiple DataTarget connections

Or

Name Description
DataSources Accepts multiple logic node DataTarget connections
Result Connects to a logic node DataSource or a Decision Condition

Return

Name Description
Prev Accepts another element’s Next socket
DataSource Accepts another element’s DataSource
Script Given script will be executed as StructrScript with data in it’s context. If no script is given, Return will just use the given data as return value.

Action

Name Description
Prev Accepts another element’s Next socket
Next Connects to another element’s Prev socket
DataSource Accepts another element’s DataTarget
DataTarget Connects to another element’s DataSource
Script Given script will be executed with data in it’s context.

NotNull

Name Description
DataSources Accepts multiple DataTarget connections
Result Connects to a logic node DataSource or a Decision Condition

Not

Name Description
DataSources Accepts multiple logic node DataTarget connections
Result Connects to a logic node DataSource or a Decision Condition

Filter

Name Description
Prev Accepts another element’s Next socket
Next Connects to another element’s Prev socket
DataSource Accepts another element’s DataTarget
DataTarget Connects to another element’s DataSource
Condition Acceps connections from logic elements and uses connected logic to determine whether an element of the given collection gets filtered

Connecting flow elements

Now that our Action contains a script, we want it to return its result. For this to happen we have to make sure the flow execution does not stop at the Action element. Drag a connection from the “Next” socket of the Action element to the “Prev” socket of the Return element to create an execution flow, indicated by the green color of the connection. Our function is now capable of returning something after the Action has been dealt with, but at this point in time, it will return an empty result, because we have not yet connected data to the Return element. In the same way the first connection was handled, create a connection between the elements “DataTarget” and “DataSource” sockets to create a data flow. When a node is being evaluated by the engine, it will try to consider connected data flows and make them available within its scripting context in the example of an Action or Return element.

CollectionDataSource

The CollectionDataSource is used to provide collections. With no connected data sources, it will pass on an empty collection and every instance of given data will be added as element of the collection.