Designing processes with UI
In this section you will learn how to create Nussknacker processes using defined model. In the examples we'll use sample model that comes with Nussknacker distribution. You can find latest sources here.
Global process properties
- parallelism (see Flink docs)
- checkpoint interval (see Flink docs)
- should state be kept in memory, or should RocksDB be used (see Flink docs)
- properties for configuring ExceptionHandler of model
At beginning there is only one variable -
input, contains single record for processing.
Currently expressions in Nussknacker can be written using Spring Expression Language. You can find extensive documentation here.
Node works with data stream. It can produce, fetch, send, collect data or organize data flow.
Each node has at least two parameters:
Id has to be unique in process. It identifies node usage.
Description is just comment for node.
Depends on type, node could have input and output. Input if exists has to have exactly one assigned flow from another node. Output could have multiple flows, or none, or could have at least one obligatory.
Filter passes records which satisfies its condition.
It can have one or two outputs.
First output is for records satisfying the condition, second (optional) is for others.
source which meets condition go to
true sink, and others go to
source which meets condition go to
blue sink, and others are filtered out.
There are two parameters:
Expression is written in SpEL. Should be evaluated to logical value. Outgoing data flow depends on expression result.
Disabled has logical value.
If is checked, expression isn't evaluated, and returns value
Has input and one or two outputs.
If there is one output, only outgoing pipe is named
and each record which expression evaluates to true passes.
Otherwise record is gone.
If there are two outputs, one pipe is named
true and another
Each record which expression evaluates to
true goes to
and other record goes to
It doesn't have additional parameters. Each output receives all records and processes them independently.
Every record from
source go to
sink 1 and
Have at least one output. Each output has same record as input, so all outputs are identical.
Distributes incoming data between outputs.
Each record form
source is tested against condition defined on edge.
blue record goes to
green record goes to
For every other value record goes to
sink for others.
There are two important parameters
Expression contains expression which is evaluated for each record,
and expression value is assigned to variable named like
Switch node edges can be of one of two types.
Record go to first output which condition it matches.
There can be at most one edge of
and it gets all records that doesn't match to any
For each record from input switch
Expression is evaluated and result is assigned to
After that records are tested against condition
Expressions from output edges one by one.
Record goes to first output which condition it satisfies.
If record doesn't match any conditional output, and default output exists, record goes to default output.
Otherwise mismatching record is filtered out.
Expression, and assigns to
Doesn't change records flow. Have to have exactly one output. Variable once defined cannot be overwritten.
Defines new variable with one or more fields.
Each field value is evaluated by using
Doesn't change records flow. MapVariable once defined cannot be overwritten.
Subprocesses let you abstract common used parts of process. See subprocesses for more detailed description of how they work.
Using custom transformers
Sometimes basic building blocks are not enough - you may want to code custom aggregations or other statuful processing in Flink. See below for more detailed guide: