Skip to content

Toro Cloud Dev Center

Service inputs and outputs

Input and output properties are optional for any type of service but in most cases, a service will be defining at least one of either. In Gloop, you can define as many input or output properties you like through the Input/Output view.

Injectable input properties

When a service is made invokable via HTTP or used in a Martini endpoint, additional input variables can be injected for further use. All you need to do is declare the input variables needed by your service and ensure they are named accordingly. Martini won't inject arguments for parameters which do not follow expected parameter names.

Example injectable input variables are:

There are multiple other injectable input properties. In Gloop, they include the following:

Injecting input properties

To inject an argument in Gloop, you must declare the variable under the Input/Output view. You can use the designated hotkeys or right click, pick a type, and then rename the variable. In Gloop and Flux, the names of injectable arguments must be prepended by the $ character. From there, you can use the parameter by mapping.

The example below shows how you can obtain the HttpServletRequest object in an HTTP-invokable service:

HTTP request-logging service

HTTP request-logging service

When a service is invoked via HTTP, a proxy is used to map inputs to the service. The proxy will then handle the injection of the variables for you.