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.

Constant

Flow Elements - Constant

Description

The Constant element represents a data source with constant value.

Parameters

Name Description
DataTarget Connects to another element’s DataSource
Value Constant value that will be passed as data

Search results for "Constant"

Constant

The Constant element represents a data source with constant value.

JavaScript

JavaScript scripting contexts are explicitely defined by enclosing dollar sign and double curly brackets (${{}}) or single curly brackets ({}) within auto-scripting contexts. In an R context, access to Structr’s built-in functionality is provided via the Structr keyword or dollar sign $ as a global variable.

The JavaScript engine provides special bindings allowing built-in functions to be called directly on the binding object. Built-in functions can be called using Structr.call([Function Name], [Parameters]) and Structr constants can be retrieved using Structr.get('[Constant Name]').

This allows expressions like:

Python (Experimental)

A Python scripting context is explicitely defined by ${python{}} (or python{} in an auto-scripting context). In a Python context, access to Structr’s built-in functionality is provided via the Structr keyword as a global variable. Built-in functions can be called using Structr.call([Function Name], [Parameters]) and Structr constants can be retrieved using Structr.get('[Constant Name]').

R (Experimental)

An R scripting context is explicitely defined by ${Renjin{}} (or Renjin{} in an auto-scripting context). In an R context, access to Structr’s built-in functionality is provided via the Structr keyword as a global variable. Built-in functions can be called using Structr.call([Function Name], [Parameters]) and Structr constants can be retrieved using Structr.get('[Constant Name]').

Constant

Name Description
DataTarget Connects to another element’s DataSource
Value Constant value that will be passed as data

JavaScript

In any other than the JavaScript context, you are required to use get() and call() to access built-in functions and constants. This results in code like the following example.

Usage

If the value of a constant is an object, its contents can be dereferenced using dot notation.

Most keywords can be used in JavaScript and StructrScript contexts. In a StructrScript context, they can be used directly. In a JavaScript context the can be used via the $.get(<keyword>) function (or since release 3.5 also via $.<keyword>).

JavaScript-only keywords are made available by functions.