Skip to main content

Simple Transform

The minimal pipeline pattern: one input, one module call, one output.

Use Case

You need to transform a string to uppercase.

The Pipeline

# simple-test.cst
# Demonstrates basic module usage with a single transformation

@example("Hello, World!")
in message: String

# Transform the message to uppercase
result = Uppercase(message)

out result

Explanation

StepExpressionPurpose
1@example("Hello, World!")Provides a default test value
2in message: StringDeclares the input
3Uppercase(message)Calls the Uppercase module (PascalCase = module call)
4out resultDeclares the output

Module names use PascalCase (Uppercase, WordCount, Trim). The name must exactly match the module registered in the Scala runtime.

warning

Module names are case-sensitive. Uppercase works, but uppercase or UPPERCASE will fail with a "module not found" error.

Running the Example

Input

{
"message": "Hello, World!"
}

Expected Output

{
"result": "HELLO, WORLD!"
}

Variations

Chain two transforms

@example("  Hello, World!  ")
in message: String

trimmed = Trim(message)
upper = Uppercase(trimmed)

out upper

Multiple outputs from one input

@example("Hello, World!")
in message: String

upper = Uppercase(message)
lower = Lowercase(message)
length = TextLength(message)

out upper
out lower
out length
tip

Stdlib functions (like trim, concat) use lowercase. Custom modules (like Uppercase, WordCount) use PascalCase. The convention helps distinguish built-in functions from user-defined modules.

Best Practices

  1. One responsibility per step — each variable assignment should do one thing
  2. Use @example for every input — enables quick testing from the dashboard
  3. Module names are case-sensitiveUppercase works, uppercase does not (unless it's a stdlib function)