Class ScriptingEngines

  • All Implemented Interfaces:
    org.camunda.bpm.dmn.engine.impl.spi.el.DmnScriptEngineResolver

    public class ScriptingEngines
    extends Object
    implements org.camunda.bpm.dmn.engine.impl.spi.el.DmnScriptEngineResolver

    Manager for JSR-223 ScriptEngine handling.

    Resolving a script engine: This class supports resolving a script engine for a given 'language name' (eg. 'groovy'). If the configuration option enableScriptEngineCaching is set to true, the class will attempt to cache 'cachable' script engines. We assume a ScriptEngine is 'cachable' if it declares to be threadsafe (see #isCachable(ScriptEngine))

    Custom Bindings: this class supports custom Bindings implementations through the scriptBindingsFactory. See ScriptBindingsFactory.

    Author:
    Tom Baeyens, Daniel Meyer
    • Method Detail

      • isEnableScriptEngineCaching

        public boolean isEnableScriptEngineCaching()
      • setEnableScriptEngineCaching

        public void setEnableScriptEngineCaching​(boolean enableScriptEngineCaching)
      • getScriptEngineForLanguage

        public ScriptEngine getScriptEngineForLanguage​(String language)
        Loads the given script engine by language name. Will throw an exception if no script engine can be loaded for the given language name.
        Specified by:
        getScriptEngineForLanguage in interface org.camunda.bpm.dmn.engine.impl.spi.el.DmnScriptEngineResolver
        Parameters:
        language - the name of the script language to lookup an implementation for
        Returns:
        the script engine
        Throws:
        ProcessEngineException - if no such engine can be found.
      • getGlobalScriptEngine

        protected ScriptEngine getGlobalScriptEngine​(String language)
      • createBindings

        public Bindings createBindings​(ScriptEngine scriptEngine,
                                       VariableScope variableScope)
        override to build a spring aware ScriptingEngines
        Parameters:
        engineBindin -
        scriptEngine -
      • setScriptBindingsFactory

        public void setScriptBindingsFactory​(ScriptBindingsFactory scriptBindingsFactory)
      • setScriptEngineResolver

        public void setScriptEngineResolver​(ScriptEngineResolver scriptEngineResolver)