Class GlobalVariable

  • All Implemented Interfaces:
    ExtensionPoint
    Direct Known Subclasses:
    EnvActionImpl.Binder, ParamsVariable, RunWrapperBinder

    public abstract class GlobalVariable
    extends Object
    implements ExtensionPoint
    Defines a provider of a global variable offered to flows. Within a given flow execution, the variable is assumed to be a singleton. It is created on demand if the script refers to it by name.

    Note: This extension point was designed for a handful of variables defined by generic Pipeline plugins. If you find yourself implementing this in a domain-specific plugin, you are probably doing too much work and harming usability in the process. For example, there will be no Snippetizer integration except to list its name and help text. Variables will also not generally be compatible with Declarative Pipeline, and may not work at all in alternate FlowExecution implementations. It is also all too easy to introduce security vulnerabilities for variables implemented using Groovy code. Just because you can does not mean you should. If at all possible, limit your plugin to implementing plain Steps.

    Should have a view named help offering usage.

    See Also:
    GlobalVariableSet