Throughout Membrane, certain plugins like:
support expressions written in Javascript, Groovy or SpEL.
When using Membranes scripting capabilities, a set of pre-defined attributes and APIs are available to provide access to useful information about the current context:
Outcomes are enums that depict the current state of the request/response flow.
Next to the enum class itself Outcome
, the individual enum states are available as well.
Outcome | Description |
---|---|
RETURN | Changes the direction of flow. The request handling mechanisms of the active plugins get activated. |
CONTINUE | Continues the flow. |
ABORT | Aborts the current flow, the direction is changed and the abort handling mechanisms of the active plugins get activated. |
The exc
keyword grants access to the current Exchange object, housing request and response information.
The message
keyword is a shortcut to exc.getRequest()
/exc.getResponse()
.
Depending on direction of flow, message
can stand for a request or response object.
The params
keyword can be used to access request query parameters.
If the body of a message is of type application/json
, json
is a parsed JSON object representation of the body's JSON document.
The flow
keyword houses the Flow enum. Values are REQUEST
and RESPONSE
.
These stand for the direction of flow.
The properties
keyword is a shortcut to exc.getProperties()
.
The spring
keyword grants access to Membrane's Spring ApplicationContext.