Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A Scripted ContextFunction is instantiated using one of a large number of static factory methods (rather than created directly by invoking a Java constructor), so they have a different syntax in Spring. You can refer to the javadoc for complete details.

inlineScript, inlineMessageContextScript

These factory methods are used to construct functions over a ProfileRequestContext or MessageContext respectively. Various variants exist to control the scripting engine and output type, but all of them rely on a String parameter to supply the script itself.

...

The following additional bean properties are available:

PropertyName

Type

Default

Description

customObject

Bean/Reference


An object to make available to the script via a variable named custom

returnOnError

Object

null

What to return if the script fails

hideExceptions

boolean

false

If true, then the returnOnError value is returned if the script raises an exception, otherwise the exception is passed out

outputType

Class<?>


Adds type checking against the output of the function to enforce type safety

Script Context

The script environment will have two variables populated:

...