Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

Gloop Fork Icon

Fork

A Fork Step in Gloop is very similar to a Java switch statement. When a Fork Step is executed, Gloop will evaluate the Expression property (as a Groovy snippet), and then find the child step whose Label is equal to the output of the expression. If the output is null, it will find a child with the Label of $null. If no matching child is found, it will try and execute the child whose Label is $else. If still no child matches, no children will be executed. All children steps of a Fork Step are treated similarly to a Java case block with a break. In other words, if a matching child is found for the expression output, only that child will be executed.

A sample Gloop Service using a Fork Step

Assuming myValue is a String, the following lines will be executed with the following inputs:

myValue Line Number
'hEllo' 2
'toro' 7
null 6
'WOrld' 3
'galaxY' 4
'UniverSE' 5
'' 7