Appearance
Data Manipulation in Workflows
Data manipulation is a crucial aspect of workflow management, allowing users to transform, filter, and aggregate data as it moves through various stages of a workflow. This document outlines the key concepts and techniques for effective data manipulation within workflows.
FEEL Expressions for Data Manipulation
PLANQK workflows use FEEL (Friendly Enough Expression Language) for data manipulation. Here are the most common expressions you'll use:
Accessing Variables
javascript
variableName // Access a variable
object.property // Access nested property
array[1] // Access array element (0-indexed)
String Operations
javascript
"Hello " + name // Concatenate strings
string(value) // Convert to string
upper case(text) // Convert to uppercase
lower case(text) // Convert to lowercase
Number Operations
javascript
count(array) // Count array elements
sum(numbers) // Sum array of numbers
5 + 3 // Addition
10 * 2 // Multiplication
Comparison Operations
javascript
value > 10 // Greater than
value < 5 // Less than
value = 10 // Equals (single =)
value != 10 // Not equals
Logical Operations
javascript
condition1 and condition2 // Both conditions true
condition1 or condition2 // At least one condition true
not condition // Negate condition
Working with Arrays
javascript
[1, 2, 3] // Create array
array[1] // Access element
count(array) // Array length
for i in array return i * 2 // Transform array
Creating Objects
javascript
{
"key": value, // Using variable value
"name": "literal" // Using literal string
}
Common Patterns
Referencing workflow variables (no quotes):
javascript
flightRoutes // Variable from Start Event or previous task
Literal values (with quotes for strings):
javascript
"binary" // String literal
1000 // Number literal
true // Boolean literal
Nested property access:
javascript
quantumMapping.routes // Access 'routes' inside 'quantumMapping'
map_output.id // Access 'id' inside 'map_output'
Building complex objects:
javascript
{
"id": datapool.id,
"ref": "datapool",
"timestamp": now()
}