Expressions
Tweakstreet represents all configuration and all data using tweakflow expressions. Since both data and configuration are represented in the same way, data can be used to drive the configuration of steps and flows dynamically.
Evaluation
All expressions evaluate to values. In the simplest case, an expression is a literal constant like a number or string. In more complex cases, the expression might be a formula involving local variables, conditional statements, or function calls. When evaluated, an expression always yields a value.
You can evaluate expresions in the UI or launch an interactive repl.
No side effects
All expressions are pure and thus have no side effects. All processing involving side effects is performed by steps.
If a task involves side effects, such as performing I/O or fetching the current time, an expression cannot do the task, and a step must provide the functionality.
Computationally universal
Expressions are limited to be pure, but are otherwise computationally universal.
This means that it is possible for an expression to solve every computational problem: If a problem does not involve side effects, there is a way to solve it in a tweakflow expression.
Data types
A value always has a type. The following data types are available:
- boolean, representing true or false
- long, representing integer numbers
- double, representing floating point numbers
- binary, representing binary data
- string, representing text
- datetime, representing points in time
- list, representing arrays of data
- dict, representing key-value maps
- function, representing reusable computations
- void, special type reserved for the
nil
value
Debugging
You can use the debug construct to log debugging information when the flow is running. Debugging information is logged when the log-level is set to DEBUG
or TRACE
.
You can also evaluate expresions in the UI or launch an interactive repl.
Libraries
You can use the standard library, tweakstreet libraries, and custom modules, by specifying imports in the flow properties dialog.