• 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

Switch Block

We can use switch in Flows too.

Flow f = new Flow()
    .inputAs('a', 'b').returnInteger()
    .var('word = "a"')
    .doSwitch('word', new List{
        'a', Flow.block().var('output = debug("Matched")'),
        'b', Flow.block().var('output = debug("Not Matched")')
    });

Also we can use break in switch blocks.

Done