Skip to content

Overview

Development

Overview

IDEs

API Explorer

examples Package: Invoking Gloop in Groovy and Groovy in Gloop

Introduction

There are three primary types of services in TORO Integrate: Gloop, Groovy, and Flux; and all three can be used in conjunction with each other. The examples package shows how you can use Gloop and Groovy together; in particular, how to call Groovy services in Gloop services and vice versa.

Related articles

Please see the following articles for more information:

Try It!

To see how to invoke Groovy in Gloop, open up and run the invokeGloop.gloop.InvokeGroovy.gloop service. For invoking Gloop in Groovy, open up and run invokeGloop.groovy.GloopInvoker.groovy instead.

Both can be found under the invokeGloop package, as seen below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
examples
├── ...
└── code
    └── invokeGloop
        ├── gloop
        │   ├── ComputeNumbers.gloop
        │   └── InvokeGroovy.gloop
        └── groovy
            ├── GloopInvoker.groovy
            └── Sample.groovy

How It Works...

Invoking a Groovy in a Gloop Service

To invoke a Groovy method in Gloop, you just need to drag and drop the method to the Gloop service, like so:

Dragging and dropping a Groovy method onto Gloop

Dragging and dropping a Groovy method onto Gloop

Doing this will create an invoke step in your Gloop service, as seen in invokeGloop.gloop.InvokeGroovy.gloop.

Invoking Gloop in Groovy

To invoke a Gloop service from a Groovy method, a special instance extension method must be used. The syntax roughly goes like:

1
'qualified.service.Name'.gloop(arguments)

This method will return a GloopModel object, from which you can extract the outputs of the Gloop service.