• 1Installation
  • 2Preliminary Knowledge
  • 3FlowScript
  • 4Flow Func Signature
  • 5Variable Assignment
  • 6Function Invocation
  • 7Return Statement
  • 8If Block
  • 9For Block
  • 10While Block
  • 11Break and Continue
  • 12Switch Block
  • 13Recursion
  • 14Flow Debug

Flow.apex

  • Docs
  • Tutorials
Getting started with Flow.apex

Flow Func Signature

A Flow is actually a Func.

Func f = new Flow()
    .inputAs('a', 'b').returnInteger();

Here we create a Func of (a, b) => Integer, with an empty body.

Or we can give it a name.

Flow f = new Flow('f')
    .input('a', 'b').returnInteger();

This will add Func f to FlowScript, so that it can be referenced in the future.

This definition creates a Func that takes a and b as arguments, and returns Integer.

As a Flow is jsut a Func, we can use it wherever we can use Funcs.

Object result = f.run(1, 2); // Call the Flow(Func)
Done